Create pushbutton in selection screen in ABAP/4

You can create the pushbutton in your selection screen by applying statement ’SELECTION-SCREEN PUSHBUTTON ...’.

Example

TABLES sscrfields.


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
  PARAMETERS: p_fld1 TYPE i DEFAULT 1,
              p_fld2 TYPE i DEFAULT 2.
  SELECTION-SCREEN PUSHBUTTON /1(10) Execute USER-COMMAND EXEC.
SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.
  Execute = ’Testing’.

AT SELECTION-SCREEN.
  IF sscrfields-ucomm = ’EXEC’.
    MESSAGE I398(00) WITH ’Testing Pushbutton Action between value’
                          p_fld1 ’and’ p_fld2.
  ENDIF.

The output is: 
img55

When you select the pushbutton, the output is:
img56

Technorati Tags: ABAP, SAP

Post new comment