ABAP Keyword Documentation → ABAP − Reference → SAP GUI User Dialogs → General Dynpros → Statements in the Dynpro Flow Logic → FIELD → FIELD - Data Transport in Event PAI
Dynpros, FIELD Statement
This example demonstrates how to transport data using the statement FIELD
.
Other versions: 7.31 | 7.40 | 7.54
Source Code
PROGRAM demo_dynpro_field.
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
box1(1) TYPE c, box2(1) TYPE c, box3(1) TYPE c, box4(1) TYPE c,
mod1_result1(1) TYPE c, mod1_result2(1) TYPE c,
mod1_result3(1) TYPE c, mod1_result4(1) TYPE c,
mod2_result1(1) TYPE c, mod2_result2(1) TYPE c,
mod2_result3(1) TYPE c, mod2_result4(1) TYPE c,
mod3_result1(1) TYPE c, mod3_result2(1) TYPE c,
mod3_result3(1) TYPE c, mod3_result4(1) TYPE c.
CALL SCREEN 100.
MODULE init_screen_100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
CLEAR: box1, box2, box3, box4.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
IF save_ok = 'CANCEL'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
MODULE module_1 INPUT.
mod1_result1 = box1.
mod1_result2 = box2.
mod1_result3 = box3.
mod1_result4 = box4.
ENDMODULE.
MODULE module_2 INPUT.
mod2_result1 = box1.
mod2_result2 = box2.
mod2_result3 = box3.
mod2_result4 = box4.
ENDMODULE.
MODULE module_3 INPUT.
mod3_result1 = box1.
mod3_result2 = box2.
mod3_result3 = box3.
mod3_result4 = box4.
ENDMODULE.
Description
The static next dynpro number of dynpro 100 is 100. The checkboxes which are ready for input are assigned
the dynpro fields box1
, box2
, box3
, and box4
. The screen flow logic is as follows:
MODULE init_screen_100.
PROCESS AFTER INPUT.
MODULE user_command_0100.
MODULE module_1.
FIELD box2.
MODULE module_2.
FIELD: box1, box3.
MODULE module_3.
In GUI status STATUS_100, the Cancel icon (F12) is activated using the function code CANCEL. If the user selects the checkboxes ready for input and triggers the PAI event by pressing Enter, the output fields indicate which dynpro field is available in which dialog module.
- The screen field
box4
is transported in the PAI event, since it does not occur in anyFIELD
statements.
- Dynpro field
box2
is not transported until before the dialog module module_2 is called and is therefore not available inuser_command_0100
ormodule_1
.
- Dynpro fields
box1
andbox3
are transported before dialog modulemodule_3
, and are therefore only available in that module.