How to Format the Selection Screen in SAP ABAP?
SELECTION-SCREEN statement allows
- Insertion of texts/comments
- Underlines
- Insertion of blank lines
SELECTION-SCREEN BEGIN OF BLOCK
- Combine logically related fields
- Draw a box around them using WITH FRAME
SELECTION- SCREEN BEGIN OF LINE
COMMENT <format> <name>
POSITION <n>
SELECTION-SCREEN END OF LINE.
REPORT ZSAPTEST
TABLES: SPFLI, SFLIGHT, SBOOK. SELECTION-SCREEN: BEGIN OF LINE,
COMMENT 1(11) TEXT-002,
POSITION 33.
PARAMETERS: PRICE LIKE SFLIGHT-PRICE OBLIGATORY. SELECTION-SCREEN: COMMENT 55(8) TEXT-003,
POSITION 65.
PARAMETERS: CURRENCY LIKE SFLIGHT-CURRENCY OBLIGATORY. SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP <n>.
leaves <n> blank lines on the selection screen
SELECTION-SCREEN ULINE
draws an underline on the selection screen
SELECTION-SCREEN BEGIN OF BLOCK <block>
… WITH FRAME
… TITLE title
SELECTION-SCREEN END OF BLOCK <block>.
REPORT ZSAPTEST.
- TABLES: SPFLI, SFLIGHT, SBOOK. SELECTION-SCREEN BEGIN OF BLOCK SPFLI WITH FRAME TITLE TEXT-001.
- SELECT-OPTIONS CARR FOR SPFLI-CARRID DEFAULT ‘LH’. SELECT-OPTIONS CITY FOR SPFLI-CITYFROM
- DEFAULT ‘BERLIN’.
- SELECT-OPTIONS DEPART FOR SPFLI-DEPTIME DEFAULT ‘100000’ TO ‘130000’.
- SELECTION-SCREEN END OF BLOCK SPFLI.
Formatting Selection Text
Default text on the selection screen
- PARAMETERS <pname>
- SELECT-OPTIONS <seltab>
More explanative text
- Text Maintenance … Selection Texts
- SELECT-OPTIONS BEGIN OF LINE … COMMENT ...