ABAP Dialog Programming Techniques
ABAP Dialog Programming Techniques
List
Selection
Dialog
Normal
Selection screen
FIELD fieldname
[LINE] fieldname or structure(store rep line)
SCREEN -REQUEST
SCREEN -VALUES_IN_COMBO
SCREEN -COLOR
ABAP code to modify Screen fields
Loop at screen.
If screen-name EQ SFLIGHT-CONNID
Or
If screen-group
ETC.
Screen-input = .
Modify screen.
Endif.
Endloop
Insert ICONS
Place Status ICON field on screen (i.e. icon1)
Use CALL FUNCTION ICON_CREATE from within PBO to assign ICON to Status ICON
field on screen.
Declare DATA statement for each icon.
(i.e DATA: icon1 LIKE ICONS-TEXT)
Leaving screen
Set Screen 200. Sets next screen value
Leave screen. Leaves to next screen value
Leave to screen 200 Leaves to screen 200
Leave to screen 0 Returns to point where screen was called
CURSOR Position
Can be set in a number of ways:
Within the ABAP(PBO): SET CURSOR field SFLIGHT-CONNID.
Within screen attributes (Settings)
Screen numbers
Numbers greater than 9000 are reserved for SAP customers
Numbers 1000 through 1010 are reserved for maintenance screen of ABAP dictionary tables
and the standard selection screen report.
TABLES Statement
If you create screen fields based on DATABASE table fields (I.e. EKKO-EBELN) remember the
TABLES: statement. This creates a WA with the same name and structure as the DB table.
BUT
TABLES: makes and interface between the Program(ABAP) and the screen:
TABLES: SFLIGHT Does NOT work the same as DATA: SFLIGHT TYPE SFLIGHT
Note: The TABLES: statement will populate the screen fields the DATA: statement will not.
TABLES: VBAK, "Creates WA based on VBAK
*VBAK. "Creates second WA based on VBAK
CALL Screen
CALL SCREEN 100
STARTING AT
ENDING AT
Get / SET PArameter ID
Get Parameter "Get value stored in Parameter ID
Set Parameter "Store entered value in Parameter ID
Flow Logic
FIELD SPFLI-CARRID MODULE validate_carrid.
"If the module validate_carrid produces and Error message, it returns to screen making field
SPFLI-CARRID ready for INPUT. Without this all fields would be output only.
CHAIN.
FIELD: SPFLI-CARRID,
SPFLI-CONNID. MODULE validate_carrid_connid.
ENDCHAIN.
"Returns to screen making multiple field ready for INPUT.
FIELD SPFLI-CARRID MODULE validate_carrid ON INPUT
"Has the contents of the field changed from its initial value.
CHAIN.
FIELD: SPFLI-CARRID,
SPFLI-CONNID.
MODULE validate_carrid_connid ON CHAIN-INPUT
ENDCHAIN.
"Has the contents of any of the fields changed from its initial value.
ON REQUEST and ON CHAIN-REQUEST
"Similar to ON INPUT but checksif contents of field has changed since the last time the screen
was displayed.