‎2007 Oct 01 10:32 AM
Hi.
I want to add my own buttons to a Selection-screen.
If I add them through the <b>SELECTION-SCREEN: FUNCTION KEY 1</b> they are not calling the <b>START-OF-SELECTION</b> event.
When I add them through the <b>SET PF-STATUS 'SEL_SCR'</b> statement, 2 buttons are working correctly (i.e. calling the <b>START-OF-SELECTION</b> event) and 1 isn't.
Any thought as to the odd behaviour?
thanx.
ayal.
Message was edited by:
Yes SAP Team
‎2007 Oct 01 10:38 AM
Hi..
To avoid this problem.
Place this statement as the Last statement in AT SELECTION-Screen event.
<b>Tables SSCRFIELDS.
AT SELECTION-SCREEN.
<<STATEMENTS>>
SSCRFIELDS-UCOMM = 'ONLI'. "Execute button that triggers start-of-selection.</b>
START-OF-SELECTION.
<<STATEMENTS>>
<b>reward if Helpful.</b>
‎2007 Oct 01 10:34 AM
‎2007 Oct 01 10:36 AM
hi,
please refer to this if you want to add pushbutton to selection screen.
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.
Demo Program: demo_sel_screen_pushbutton
Jayant Sahu
‎2007 Oct 01 10:38 AM
Hi..
To avoid this problem.
Place this statement as the Last statement in AT SELECTION-Screen event.
<b>Tables SSCRFIELDS.
AT SELECTION-SCREEN.
<<STATEMENTS>>
SSCRFIELDS-UCOMM = 'ONLI'. "Execute button that triggers start-of-selection.</b>
START-OF-SELECTION.
<<STATEMENTS>>
<b>reward if Helpful.</b>
‎2007 Oct 01 10:54 AM
Issue resolved !!!
Varma lead me to the right direction: the buttons on the Selection-screen must have "ONLI" at thier Function-code. The 2 buttons that worked had "ONLI" & "ONLI1" while the button that didn't work had "HISTORY" as a Function-code.
When I changed it to "ONLI2" it worked.
My guess is that SAP asks something like if <b>SSCRFIELDS-UCOMM cs "ONLI"</b> to know if they need to call the <b>START-OF-SELECTION</b> event.
Anyway, I think it's very ackward behaviour and I'm going to post a call to the OSS about it.
Thanx.
ayal.
‎2007 Oct 01 10:39 AM
‎2007 Oct 01 10:40 AM