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: 

Push button in the selection screen

Former Member
0 Kudos

Hi folks,

I need to display a push button the selection screen.its not on the application tool bar..but in one of the selection block in the selection screen..could anybody guide how to do this...

Thanks in advance,

shyam.

Edited by: shyam prasad on Jan 15, 2009 7:34 AM

4 REPLIES 4

former_member209217
Active Contributor
0 Kudos

Hi Shyam,

Try the following code..

TABLES sscrfields.

TYPE-POOLS icon.

*SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE title,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 28(30) but2 USER-COMMAND cli2

VISIBLE LENGTH 10.

END OF SCREEN 500.

AT SELECTION-SCREEN.

CASE sscrfields.

WHEN 'CLI1'.

...

WHEN 'CLI2'.

...

ENDCASE.

START-OF-SELECTION.

title = 'Push button'.

but1 = 'Button 1'.

CALL FUNCTION 'ICON_CREATE'

EXPORTING

name = icon_information

text = 'Button 2'

info = 'My Quickinfo'

IMPORTING

RESULT = but2

  • EXCEPTIONS

  • OTHERS = 0.

Hope it will be useful..

Regards,

Lakshman.

Edited by: Lakshman N on Jan 15, 2009 7:39 AM

Former Member
0 Kudos

Try this

SELECTION-SCREEN BEGIN OF SCREEN 1111.

SELECTION-SCREEN BEGIN OF BLOCK BL1.

SELECT-OPTIONS SEL0 FOR SY-REPID.

PARAMETERS PAR0.

SELECTION-SCREEN END OF BLOCK BL1.

SELECT-OPTIONS SEL1 FOR SY-REPID.

PARAMETERS PAR1.

SELECTION-SCREEN PUSHBUTTON /10(30) PUBU USER-COMMAND US03.

SELECTION-SCREEN END OF SCREEN 1111.

Hope this helps...

Former Member
0 Kudos

Detailed documentation with examples are available in SAP help.

Write Selection-screen in your ABAP editer and press F1 and look for Selection-screen Pushbutton.

Murthy.

Former Member
0 Kudos

Hi Shyam,

Please try to search SDN before posting for basic questions, Anyways for bush button on selection screen do it this way:

SELECTION-SCREEN:
  BEGIN OF BLOCK B1 WITH FRAME TITLE text-000,
    PUSHBUTTON 2(10)   but1 USER-COMMAND cli1,
    PUSHBUTTON 20(10) but2 USER-COMMAND cli2,
  END OF BLOCK B1.

INITIALIZATION.
  but1 = 'BUTTON1'.
  but2 = 'BUTTON2'.

AT SELECTION-SCREEN.
  CASE SY-UCOMM.
    WHEN 'CLI1'.
      MESSAGE 'You have clicked button1' type 'I'.
    WHEN 'CLI2'.
      MESSAGE 'You have clicked button2' type 'I'.
  ENDCASE.

With luck,

Pritam.