Professional Documents
Culture Documents
keywords: Keyword CALL CHAIN ENDCHAIN ENDLOOP FIELD LOOP MODIFY MODULE ON PROCESS SELECT VALUES ON INPUT ON CHAIN-INPUT ON REQUEST ON CHAIN-REQUEST Description Calls a subscreen. Starts a processing chain. Ends a processing chain. Ends loop processing. Refers to a field. You can combine this with the MODULE and SELECT keywords. Starts loop processing. Modifies a table. Identifies a processing module. Used with FIELD assignments. Defines a processing event. Checks an entry against a table. Defines allowed input values.
is changed
Once the exit command function code has been created you will then need to add it to the relevant PAI module call within the flow logic of the SAP dynpro.
... *dynpro PAI flow logic PROCESS AFTER INPUT. *EXIT-COMMAND means module will be called first bypassing any feild validation MODULE USER_COMMAND_0100 AT EXIT-COMMAND.
The module <mod> is called whenever the function code of the user action is CS with function type S. If you use this statement, it is best to assign the function code CS to function key F2. This also assigns it to the mouse double-click. The module is called in the sequence in which it occurs in the flow logic. It does not bypass the automatic input checks. Data is transported from screen fields in the order in which it is defined by the FIELD statements. The function code is empty, and neither SY-UCOMM nor the OK_CODE field is affected. You can also combine this MODULE statement with the FIELD statement: FIELD <f> MODULE <mod> AT CURSOR-SELECTION. or, for more than one field: CHAIN. FIELD: <f1>, <f 2>,... MODULE <mod> AT CURSOR-SELECTION. ENDCHAIN. The module <mod> is only called if the cursor is positioned on an input/output field <f> or an input/output field <fi> in the processing chain. You can only apply this statement to input/output fields. The call hierarchy of the different combinations is as follows: If a MODULE... AT CURSOR-SELECTION statement is executed that was combined with FIELD, a statement without FIELD is not executed. If a statement using FIELD appears more than once for the same screen field <f>, only the first statement is executed. If a statement without FIELD occurs more than once, only the last statement is executed.
It is irrelevant whether the statements occur within a CHAIN ... ENDCHAIN block or not.
Conditional module calls PROGRAM DEMO_DYNPRO_ON_CONDITION. DATA: OK_CODE LIKE SY-UCOMM, INPUT1(20), INPUT2(20), INPUT3(20), FLD(20). CALL SCREEN 100. MODULE INIT_SCREEN_100 OUTPUT. SET PF-STATUS 'STATUS_100'. ENDMODULE. MODULE CANCEL INPUT. LEAVE PROGRAM. ENDMODULE. MODULE CURSOR INPUT. GET CURSOR FIELD FLD. MESSAGE I888(BCTRAIN) WITH TEXT-001 FLD. ENDMODULE.
MODULE MODULE_1 INPUT. MESSAGE I888(BCTRAIN) WITH TEXT-002. ENDMODULE. MODULE MODULE_2 INPUT. MESSAGE I888(BCTRAIN) WITH TEXT-003. ENDMODULE. MODULE MODULE_* INPUT. MESSAGE I888(BCTRAIN) WITH TEXT-004 INPUT3. ENDMODULE. MODULE C1 INPUT. MESSAGE I888(BCTRAIN) WITH TEXT-005 '1'. ENDMODULE. MODULE C2 INPUT. MESSAGE I888(BCTRAIN) WITH TEXT-005 '2' TEXT-006 '3'. ENDMODULE. The next screen (statically defined) for screen 100 is itself. It has the following layout:
The screen fields INPUT1, INPUT2, and INPUT3 are assigned to the input fields. The function code of the pushbutton is EXECUTE. In the GUI status STATUS_100, the icon (F12) is active with function code CANCEL and function type E. The function key F2 is also active with function code CS and function type S. The F8 key is active with the function code EXECUTE and no special function type. The screen flow logic is as follows: PROCESS BEFORE OUTPUT. MODULE INIT_SCREEN_100. PROCESS AFTER INPUT. MODULE CANCEL AT EXIT-COMMAND. CHAIN. FIELD: INPUT1, INPUT2. MODULE MODULE_1 ON CHAIN-INPUT. FIELD INPUT3 MODULE MODULE_* ON *-INPUT. MODULE MODULE_2 ON CHAIN-REQUEST.
ENDCHAIN. FIELD INPUT1 MODULE C1 AT CURSOR-SELECTION. CHAIN. FIELD: INPUT2, INPUT3. MODULE C2 AT CURSOR-SELECTION. ENDCHAIN. MODULE CURSOR AT CURSOR-SELECTION. The program uses information messages to show which modules are called following user interaction and which data is transported. Whenever one of the input fields 1 or 2 is not initial, the system calls the module MODULE_1 for any user interaction. Whenever one of the three input fields is changed, the system calls the module MODULE_2 for any user interaction. Whenever input field 3 contains a * entry, the system calls module MODULE_* for any user interaction. If the user chooses F2 or double-clicks a text field on the screen, the system calls the module CURSOR. If the user chooses F2 or double-clicks input field 1, the system calls the module C1. If the user chooses F2 or double-clicks input field 2 or 3, the system calls the module CURSOR. Module C2 is never executed, since the MODULE ... AT CURSOR SELECTION statement occurs twice, and only the last is processed.