Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we create a pushbutton on the selection screen?

Former Member
0 Kudos

Hi

Can we create a pushbutton on the selection screen?

If yes please tell me how?

thank You

5 REPLIES 5

suresh_datti
Active Contributor
0 Kudos

PL check demo_sel_screen_pushbutton

~Suresh

Former Member
0 Kudos

Hi,

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON POS_HIGH(8) PUSHY

USER-COMMAND ABCD.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

PUSHY = 'Command'.

Thanks,

Naren

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please try this.


SELECTION-SCREEN PUSHBUTTON 1(15) P_PP USER-COMMAND PUS MODIF ID GP1.

INITIALIZATION.
P_PP = 'TEST'.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'GP1'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

Regards,

Ferry Lianto

Former Member
0 Kudos

Former Member
0 Kudos

To create a pushbutton on the selection screen you use the following statement during the definition of the selection screen:

<b>SELECTION SCREEN PUSHBUTTON [/]pos(len) push

USER-COMMAND fcode [MODIF ID key].</b>

REPORT demo_sel_screen_pushbutton.

TABLES sscrfields.

DATA flag(1) TYPE c.

SELECTION-SCREEN:
  BEGIN OF SCREEN 500 AS WINDOW TITLE tit,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) but1 USER-COMMAND cli1,
      PUSHBUTTON 12(10) text-020 USER-COMMAND cli2,
    END OF LINE,
    BEGIN OF LINE,
      PUSHBUTTON 2(10) but3 USER-COMMAND cli3,
      PUSHBUTTON 12(10) text-040 USER-COMMAND cli4,
    END OF LINE,
  END OF SCREEN 500.

AT SELECTION-SCREEN.

  CASE sscrfields.
    WHEN 'CLI1'.
      flag = '1'.
    WHEN 'CLI2'.
      flag = '2'.
    WHEN 'CLI3'.
      flag = '3'.
    WHEN 'CLI4'.
      flag = '4'.
  ENDCASE.

START-OF-SELECTION.

  tit  = 'Four Buttons'.
  but1 = 'Button 1'.
  but3 = 'Button 3'.

  CALL SELECTION-SCREEN 500 STARTING AT 10 10.

  CASE flag.
    WHEN '1'.
      WRITE / 'Button 1 was clicked'.
    WHEN '2'.
      WRITE / 'Button 2 was clicked'.
    WHEN '3'.
      WRITE / 'Button 3 was clicked'.
    WHEN '4'.
      WRITE / 'Button 4 was clicked'.
    WHEN OTHERS.
      WRITE / 'No Button was clicked'.
  ENDCASE.

See another Program also

http://www.sap-img.com/abap/create-push-buttons-in-application-tool-bar.htm

Regards

Sudheer