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: 

Pushbuttons on selection-screen

Former Member
0 Kudos

Hi ,

i have a push button on the selection screen , when press it my list must be displayed.

how can i do it.

Regards

Arun

1 ACCEPTED SOLUTION

Former Member
0 Kudos

The Function Code for the Push-Button has to be 'ONLI'. Otherwise, I doubt it would work.

Regards,

Subramanian V.

9 REPLIES 9

Former Member
0 Kudos

The Function Code for the Push-Button has to be 'ONLI'. Otherwise, I doubt it would work.

Regards,

Subramanian V.

0 Kudos

Hi ,

Yes , i tried setting sy-ucomm to ONLI , but it is not working.

Regards

Arun

0 Kudos

Can you list your code here ?


selection-screen begin of block blk_001 with frame.
parameters: p_lifnr type lfa1-lifnr.
SELECTION-SCREEN PUSHBUTTON /10(20) mypb USER-COMMAND ONLI.
selection-screen end of block blk_001.

initialization.
move 'My Button' to mypb.

start-of-selection.
write 'Hello'.

The above code works for me.

Regards,

Subramanian V.

Message was edited by: Subramanian Venkateswaran

0 Kudos

No, not indeed

0 Kudos

REPORT Z3_SELECTION_SCREEN .

Tables : MAKT,SSCRFIELDS.

DATA : FLAG VALUE '0'.

SELECTION-SCREEN BEGIN OF BLOCK ONE WITH FRAME title TEXT-001 NO

INTERVALS .

."

selection-screen begin of line.

Parameters : MATNR like MAKT-MATNR MODIF ID SC1 value check,

MAKTX LIKE MAKT-MAKTX MODIF ID SC1.

selection-screen end of line.

SELECTION-SCREEN END OF BLOCK ONE .

*SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN : PUSHBUTTON 10(20) TEST USER-COMMAND ABCD.

SELECTION-SCREEN : PUSHBUTTON 40(20) TEST1 USER-COMMAND ABCD1.

SELECTION-SCREEN : PUSHBUTTON 70(20) TEST2 USER-COMMAND ABCD2.

*SELECTION-SCREEN END OF LINE.

INITIALIZATION.

TEST = 'List'.

TEST1 = 'TEST1'.

TEST2 = 'TEST2'.

AT SELECTION-SCREEN .

IF SSCRFIELDS-UCOMM = 'ABCD'.

SELECT SINGLE MAKTX FROM MAKT INTO (MAKTX) WHERE MATNR = MANTR AND

SPRAS = SY-LANGU.

eNDIF.

Start-of-selection.

Write: / MAKTX.

.

0 Kudos

Hi Arun,

THere is a difference between <b>List Events</b> and <b>Selection-Screen Events</b>. You can have as many pushbutton events you want, but to go from <b>selection-screen to list</b>, I have noticed that, you have to press the Execute(ONLI) button. So according to your code, it will never go to START-OF-SELECTION event, unless and until you press Execute. The pushbuttons can be used to trigger , something like CALL SCREEN etc...

Regards,

Subramanian V.

0 Kudos

Thank you ,

This code works.

Regards

Arun

Former Member
0 Kudos

SELECTION-SCREEN PUSHBUTTON /10(20) pushy USER-COMMAND abcd.

INITIALIZATION.

MOVE 'DOSOMETHING' TO pushy.

AT SELECTION-SCREEN.

CHECK sscrfields-ucomm = 'ABCD'.

perform do_what_you_want.

-


If it helps please give points.

0 Kudos

This works

DATA:

zucomm TYPE sy-ucomm.

SELECTION-SCREEN PUSHBUTTON /10(20) pushy USER-COMMAND onli.

INITIALIZATION.

MOVE 'DOSOMETHING' TO pushy.

AT SELECTION-SCREEN.

CHECK sscrfields-ucomm = 'ONLI'.

zucomm = sscrfields-ucomm.

START-OF-SELECTION.

IF zucomm EQ 'ONLI'.

WRITE: 'SOMETHING'.

ENDIF.

-


Please give points if it helps.