ā2012 Oct 19 9:50 AM
Hello peers,
I want to put a push button in the toolbar of a selection screen which should serve the purpose of modifying the current screen by displaying more parameter in selection screen block.
This is not working as the modifying screen statement can only be triggered in the event ' AT SELECTION SCREEN OUTPUT' where as the Function code for the user command at the push button in selection screen can be captured only at event 'AT SELECTION SCREEN'.
Help me on dis.
ā2012 Oct 19 9:59 AM
Hi
The ok-code has to be managed in the event AT SELECTION-SCREEN, the screen modifications in the event AT SELECTION-SCREEN OUTPUT, but
AT SELECTION-SCREEN is triggered before AT SELECTION-SCREEN OUTPUT, so you can set a flag in order to decide which modifications have to be done:
AT SELECTION-SCREEN.
CLEAR: FL_1, FL_2,.....
CASE SSCRFIELDS-UCOMM.
WHEN 'BOT1'. FL_1 = 'X'.
WHEN 'BOT2'. FL_2 = 'X'.
WHEN .............
ENDCASE,
AT SELECTION-SCREEN OUTPUT.
CASE 'X'.
WHEN FL_1.
LOOP AT SCREEN.
..............
ENDLOOP.
WHEN FL_2.
LOOP AT SCREEN.
..............
ENDLOOP.
WHEN.................
ENDCASE.
Max
ā2012 Oct 19 10:32 AM
Below is the coding..... cant find why is it working....help will be very much appreciated.
TABLES sscrfields.
data: flag(1) type c.
SELECTION-SCREEN begin of block b1 WITH FRAME TITLE t001.
PARAMETERS: p_matnr type mara-matnr.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF block b1.
SELECTION-SCREEN begin of block b2 WITH FRAME TITLE t002.
PARAMETERS: pp_matnr type mara-matnr MODIF ID sc1.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF block b2.
SELECTION-SCREEN FUNCTION KEY 1.
INITIALIZATION.
sscrfields-functxt_01 = 'SHOW'.
t001 = 'Title 1'.
t002 = 'Title 2'.
AT SELECTION-SCREEN.
case sscrfields-ucomm.
when 'FC01'.
flag = '1'.
ENDCASE.
AT SELECTION-SCREEN OUTPUT.
if flag <> '1' and screen-group1 = 'SC1'.
loop AT SCREEN.
screen-active = '0'.
MODIFY SCREEN.
ENDLOOP.
endif.
ā2012 Oct 19 10:37 AM
ā2012 Oct 19 10:00 AM
You should have debugged after clicking the tool bar button.
ā2012 Oct 19 10:54 AM
Hi,
This event is executed at PBO of the selection screen every time the user presses ENTER ā in contrast to INITIALIZATION . Therefore, this event is not suitable for setting selection screen default values
Regards,
venkat.
ā2012 Oct 19 11:18 AM
Hi all,
as THANDLAM VENKATESWARLU said I started this thread to know the feasibility of triggering a change in the current screen by capturing a user command from a push button at selection screen toolbar.
Kesavadas Thekkillath i hav done enuf debugging ...please look at the scenario before suggesting for debugging.
and max bianchi AT SELECTION SCREEN OUTPUT is triggered before AT SELECTION SCREEN event. However, thanks for the prompt reply.
ā2012 Oct 19 11:29 AM
Until you put it like this, nothing is going to happen.
at selection-screen.
case sscrfields-ucomm.
when 'FC01'.
if flag <> 1. "<-----
flag = '1'.
else.
flag = 0.
endif.
endcase.
at selection-screen output.
loop at screen.
if flag = '1' and screen-group1 = 'SC1'. "<--------
screen-active = '0'.
modify screen.
endif.
endloop.
This can be identified in a simple debugging.
ā2012 Oct 19 11:33 AM
Santhosh Yadav wrote:
..........
and max bianchi AT SELECTION SCREEN OUTPUT is triggered before AT SELECTION SCREEN event. However, thanks for the prompt reply.
uhm.....have you a new SAP release?
It's not possible:
AT SELECTION-SCREEN is like PAI
AT SELECTION-SCREEN OUTPUT is like PBO
That means:
- AT SELECTION-SCREEN OUTPUT is triggered just before displaying the selection-screen
- AT SELECTION-SCREEN is triggered just after pressing a push button.
So if you need to manage a new button in selection-screen, your new button doesn't call START-OF-SELECTION, so your program will back to selection-screen, that means:
AT SELECTION-SCREEN will be triggered before AT SELECTION-SCREEN OUTPUT
Only the first time AT SELECTION-SCREEN OUTPUT will be called before AT SELECTION-SCREEN, but in this case AT SELECTION-SCREEN won't be called, but only INITIALIZATION (and then AT SELECTION-SCREEN OUTPUT)
Max
ā2012 Oct 19 11:47 AM
The same solution I wrote before....so I can't understand your affirmation if you've chosen it as good solution for you
Max
ā2012 Oct 19 11:43 AM