ABAP – Pushbutton sample code

Pushbutton in selection screen can be implemented as folows:

TABLES: SSCRFIELDS.

SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECTION-SCREEN PUSHBUTTON /20(10) btn1 USER-COMMAND CLI1.
SELECTION-SCREEN PUSHBUTTON /20(10) btn2 USER-COMMAND CLI2.

SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.

btn1 = ‘Button1′.
btn2 = ‘Button2′.

AT SELECTION-SCREEN.
CASE SSCRFIELDS.
WHEN ‘CLI1′.
MESSAGE ‘Button1 Clicked’ TYPE ‘I’.

WHEN ‘CLI2′.
MESSAGE ‘Button2 Clicked’ TYPE ‘I’.
ENDCASE.

0 Comments

Leave A Reply