MODULEPOOLPROGRAM

WHAT AT EXIT-COMMAND DO IN MODULEPOOL?

HI
GOOD
PAI Modules for Type E Functions
The MODULE ... AT EXIT-COMMAND statement is normally used to leave the current screen without the automatic input checks taking place. You should therefore program it to contain an appropriate variant of the LEAVE statement, to leave the current screen, the call chain, or the entire program, as appropriate. If the module does not leave the screen, normal PAI processing resumes after it has finished, that is, the automatic field checks take place, and the normal PAI modules are called, with data being transported from the screen back to the program according to the sequence defined in the FIELDS statements.
PROGRAM DEMO_DYNPRO_AT_EXIT_COMMAND.
DATA: OK_CODE LIKE SY-UCOMM,
      SAVE_OK LIKE OK_CODE,
      INPUT1(20), INPUT2(20).
CALL SCREEN 100.
MODULE INIT_SCREEN_0100 OUTPUT.
  SET PF-STATUS 'STATUS_100'.
ENDMODULE.
MODULE CANCEL INPUT.
  MESSAGE I888(BCTRAIN) WITH TEXT-001 OK_CODE INPUT1 INPUT2.
  IF OK_CODE = 'CANCEL'.
    CLEAR OK_CODE.
    LEAVE PROGRAM.
  ENDIF.
ENDMODULE.
MODULE BACK INPUT.
  MESSAGE I888(BCTRAIN) WITH TEXT-002 OK_CODE INPUT1 INPUT2.
  IF OK_CODE = 'BACK'.
    CLEAR: OK_CODE, INPUT1, INPUT2.
    LEAVE TO SCREEN 100.
  ENDIF.
ENDMODULE.
MODULE EXECUTE1 INPUT.
  MESSAGE I888(BCTRAIN) WITH TEXT-003 OK_CODE INPUT1 INPUT2.
  SAVE_OK = OK_CODE.
  CLEAR OK_CODE.
ENDMODULE.
MODULE EXECUTE2 INPUT.
  MESSAGE I888(BCTRAIN) WITH TEXT-004 OK_CODE INPUT1 INPUT2.
  IF SAVE_OK = 'EXECUTE'.
    MESSAGE S888(BCTRAIN) WITH TEXT-005.
  ENDIF.
ENDMODULE.
THANKS
MRUTYUN

Similar Messages

  • Values to be added in Listbox in modulepoolprogram

    Hi,
    I have one listbox in my module pool program..
    for thgis list box i need to add values like quarter...Halfyear and year
    how to add to this list box.

    hi,
    U can use the function module VRM_SET_VALUES to add the values into list box. for that u have to use TYPE-POOOLS VRM in your prg..
    here is the sample code for adding values into the listbox using VRM.
    pls reward points if its useful for u.
    *& Report  ZTEST1                                                      *
    REPORT  ZTEST1                                  .
    TABLES: ZEMP.
    TYPE-POOLS VRM.
    DATA SCR LIKE SY-DYNNR VALUE 9002.
    DATA: OK_CODE LIKE SY-UCOMM,
          save_ok TYPE sy-ucomm.
    DATA: name  TYPE vrm_id VALUE 'ZEMP-EMPNO',
          list  TYPE vrm_values,
          value LIKE LINE OF list.
    DATA: wa_EMP TYPE ZEMP.
    DATA: name1  TYPE vrm_id VALUE 'ZEMP-EMPNAME',
          list1  TYPE vrm_values,
          value1 LIKE LINE OF list1.
    DATA: wa_EMP1 TYPE ZEMP.
    CALL SCREEN 9001.
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    *OK_CODE = SY-UCOMM.
    CASE SY-UCOMM.
    *MODIFY ZSAMPLE1.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CLICK'.
    SCR = 9000.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    SELECT * FROM ZEMP WHERE EMPNO = ZEMP-EMPNO.
    ENDSELECT.
    CASE SY-UCOMM.
    WHEN 'SAVE'.
    *ZEMP-EMPNO = ZEMP-EMPNO.
    *ZEMP-EMPNAME = ZEMP-EMPNAME.
    INSERT ZEMP.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  VRM_VALUE  OUTPUT
          text
    MODULE VRM_VALUE OUTPUT.
    BREAK-POINT.
    SELECT EMPNO FROM  ZEMP INTO  CORRESPONDING FIELDS OF wa_EMP.
        value-key  = wa_EMP-EMPNO.
       APPEND value TO list.
    ENDSELECT.
    CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id     = name
                values = list.
    SELECT EMPNAME FROM  ZEMP INTO  CORRESPONDING FIELDS OF wa_EMP1.
        VALUE1-KEY  = wa_EMP1-EMPNAME.
       APPEND value1 TO list1.
       ENDSELECT.
    CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                id     = name1
                values = list1.
    ENDMODULE.                 " VRM_VALUE  OUTPUT

  • Validação de campos em um Table Control

    Boa tarde.
    Gostaria de pedir um auxilio .
    Tenho uma duvida, na seguinte situação. Estou construindo um programa de Module Pool
    Neste programa vai ter um tabstrip, para atualizar duas tabelas Z
    Na primeira u201CABAu201D, serão  inseridos os registros da tabela pai e na segunda u201CABAu201D, os registros da tabela
    Filho a relação será de 1 para N.
    Na tabela filho os campos  chaves serão um identificador próprio , mais o registro chave da tabela pai.
    Na segunda a aba para inserir os registros da tabela filho, terei que usar um table Control.
    O meu problema é que ao inserir os registros na tabela filho, terei que de forma automática preencher o campo que corresponde a chave da tabela pai. Ou seja o usuário na primeira u201Cabau201D digamos digite o código da tabela pai como 10 ao inserir na table Control um registro o campo correspondente a chave  da tabela pai devera ser preenchido com o valor 10 e não permitir ao usuário efetuar qualquer manutenção neste campo.
    Como eu faço isso???
    Alguém tem algum exemplo????
    Obrigado a todos

    Olá, bom dia!
    Este é um dessenvolvimento bem específico, talvez por isso ninguem lhe respondeu ainda. Voce já deu uma olhada na seção de Wiki, buscando algum código de exemplo?
    Vai alguns links que encontrei:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1499ec90-0201-0010-769f-860989655f7e?QuickLink=index&overridelayout=true
    http://wiki.sdn.sap.com/wiki/display/sandbox/ModulePoolProgramming
    O primeiro link traz um exemplo de como torna um campo ineditavel via codigo. Espero que possa ajudar.
    Abraços,
    Rodrigo Paisante

Maybe you are looking for

  • E-Mail Array - Showing Up As Blank.

    Hey Again.. So I'm now trying to e-mail a log of some script actions, which include an array of data that was processed, however it seems that while I can display the data with a write-host command, I cannot e-mail it? In this one I am trying to load

  • Problem with printing some report

    hi very body we have some problems with printing some reports. the problem is when printing a report the computer processes stoped and i should restart the computer a gain to print the report for first time and then in the second time i have same pro

  • Setting values in bindings

    Hi, I have a jspx file that has a backing java file. In the jspx file I have inputText components whose values are binded to a database. In the java file, I can get the values of these inputText components like this: String fn = bindings.get("firstNa

  • Finer sound volume setting?

    Hi everyone, I'm finally annoyed to a level where I turn to you. For years I used my Harman/Kardon Sound Sticks (the older ones with USB) with several PPC-Macs and today with my MacBook Pro. Ever since switching to OS X my Sound Sticks were a lot lou

  • Quotation screen by default tab "Sales" should come

    Dear Experts, In transaction VA21 ( Quotation) by default in main screen tab item overview is coming but i want first tab SALES should come as by default like normal sales order how can i achieve this ??? Thanks