Application Development and Automation 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: 
Read only

Selection-screen pushbutton

Former Member
0 Likes
1,889

Hi All,

Just want to know abt selection-screen pushbutton,

am using one pushbutton in selection screen and given name as execute, if i click on this execute pushbutton one perform statement has to execute, i had written the code as AT Selection-Screen.

case sy-ucomm.

when 'pbutt1'. (pbutt1 is a pushbutton)

perform subroutine1.

when 'pbutt2'.

perform subroutine2.

endcase.

Frnds, but its not working, can any body send me Correct code ASAP.

BALU.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,464

hi try this

tables sscrfields.

selection-screen pushbutton 5(5) push user-command push1.

selection-screen pushbutton 20(5) push1 user-command push2.

at selection-screen.

case sscrfields-ucomm.

when 'PUSH1'.

when 'PUSH2'.

endcase.

9 REPLIES 9
Read only

Former Member
0 Likes
1,465

hi try this

tables sscrfields.

selection-screen pushbutton 5(5) push user-command push1.

selection-screen pushbutton 20(5) push1 user-command push2.

at selection-screen.

case sscrfields-ucomm.

when 'PUSH1'.

when 'PUSH2'.

endcase.

Read only

0 Likes
1,464
TABLES sscrfields.
 
SELECTION-SCREEN: 
  BEGIN OF SCREEN 500 AS WINDOW TITLE title, 
    PUSHBUTTON 2(10)  but1 USER-COMMAND cli1, 
    PUSHBUTTON 12(30) but2 USER-COMMAND cli2 
                           VISIBLE LENGTH 10, 
  END OF SCREEN 500. 
 
AT SELECTION-SCREEN. 
  CASE sscrfields. 
    WHEN 'CLI1'. 
      your code......
    WHEN 'CLI2'. 
     perform-----
  ENDCASE.
Read only

0 Likes
1,464

Hi ,

I tried that one also, but its not coming, subroutines r not working, and even if i give the messages also its not working, plz give me the correct code

Read only

Former Member
0 Likes
1,464

Hi Bala,

Refer standard program:

DEMO_SEL_SCREEN_FUNCTION_KEY

DEMO_SEL_SCREEN_PUSHBUTTON

Reward points if this helps.

Manish

Read only

Former Member
0 Likes
1,464

Use this:


SELECTION-SCREEN PUSHBUTTON /15(20) button1 USER-COMMAND EXEC1.
SELECTION-SCREEN PUSHBUTTON /15(20) button2 USER-COMMAND EXEC2.

You can initialize the texts for the push-buttons at INITIALIZATION.

  CONCATENATE icon_green_light
              'Button 1'(029) INTO button1.

You can select the icon if needed,

AT SELECTION SCREEN.
  CASE sscrfields.
    WHEN 'EXEC1'.
       perform subroutine1.
    WHEN 'EXCE2'.
       perform subroutine2.
  ENDCASE.

Hope this helps

Read only

anversha_s
Active Contributor
0 Likes
1,464

hi,

Refer the demo example:

<i>demo_sel_screen_pushbutton</i>

The event that is triggered is the very familiar " at selection-screen."


REPORT ypra_sample60. .

INCLUDE <icon>.

DATA: ls_icon(14).


SELECTION-SCREEN:
BEGIN OF BLOCK b3 WITH FRAME,
BEGIN OF LINE,
COMMENT 1(32) text-001,
PUSHBUTTON 33(10) pushy USER-COMMAND upload,
END OF LINE,
END OF BLOCK b3.

INITIALIZATION.
CONCATENATE icon_export text-002 INTO ls_icon.
MOVE ls_icon TO pushy.

Here text-001 = Index and Quotations Upload,

text-002 = Upload

Whenever the user presses this button selection screen event will triggered.

rgds

Anver

Read only

Former Member
0 Likes
1,464

hi

good

go through this example and use accordingly.

REPORT DEMO.

TABLES SSCRFIELDS.

DATA FLAG.

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.

thanks

mrutyun^

Read only

Former Member
0 Likes
1,464

check the capital letter and small letter also please use capital letter for defining user-command and case statement also.

selection-screen pushbutton 5(5) push user-command PUSH1

selection-screen pushbutton 20(5) push1 user-command PUSH2.

at selection-screen.

case sscrfields-ucomm.

when 'PUSH1'.

when 'PUSH2'.

endcase.

try this.

Read only

Former Member
0 Likes
1,464

hi,

tables: sscrfields.

AT Selection-Screen.

case <b>sscrfields.</b>

when 'pbutt1'. (pbutt1 is a pushbutton)

perform subroutine1.

when 'pbutt2'.

perform subroutine2.

endcase.

hope this helps,

do reward if it helps,

Priya.