‎2010 Aug 23 9:18 PM
Hello everyone,
I have a toolbar (in a docking container) attached to a dynpro which contains two buttons (save and refresh). I want to have the save button to invoke PAI, but the refresh button should not!
I only found method SET_REGISTERED_EVENTS with eventid CL_GUI_TOOLBAR=>M_ID_FUNCTION_SELECTED that applies the event handling to the complete toolbar. Is it possible to do this function code specific?
Regards,
Alej
‎2010 Aug 25 11:00 AM
Hello Alej
If I am right the executing toolbar functions do not trigger PAI but just raise event USER_COMMAND (in case of custom-defined buttons). If you want to trigger PAI explicitly you simply have to use statement:
CALL METHOD cl_gui_cfw=>set_new_ok_code(...)
The ALV framework will finish the event handling method and then jump to PAI with the newly set OK-code.
Instead of doing any "SAVE" functionality within the event handler method I recommend to do this at a module / routine at PAI.
Regards
Uwe
‎2010 Aug 24 7:56 AM
Hi Alej,
You should be able to achieve that using this method, however you have to set the flag APPL_EVENT for certain event id. This way this event will entail PAI after triggering.
As for the event id to register please refer toolbar specific events [here|http://help.sap.com/saphelp_470/helpdata/es/1b/8c2eb4c57511d2bd8e080009b4534c/frameset.htm]
Regards
Marcin
‎2010 Aug 24 6:59 PM
Hello Marcin,
unfortunately I'm not sure what you are suggesting... Method SET_REGISTERED_EVENTS applies the state trigger or don't trigger PAI on click to the complete toolbar, doesn't it?
My requirement is that function code SAVE runs the dynpro field checks, but the refresh function should not (like an exit command).
Regards,
Alej
‎2010 Aug 25 8:19 AM
Indeed this most likely applies to whole toolbar, but is set for specific event type (the one which you pass for eventid ).
But for your requirement I think may help the following: in handling method once SAVE button is pressed force the screen processing once again with LEAVE TO SCREEN main_screen_number. This should then entail dialog step once again. Try it out, it worked once for me.
Regards
Marcin
‎2010 Aug 25 11:00 AM
Hello Alej
If I am right the executing toolbar functions do not trigger PAI but just raise event USER_COMMAND (in case of custom-defined buttons). If you want to trigger PAI explicitly you simply have to use statement:
CALL METHOD cl_gui_cfw=>set_new_ok_code(...)
The ALV framework will finish the event handling method and then jump to PAI with the newly set OK-code.
Instead of doing any "SAVE" functionality within the event handler method I recommend to do this at a module / routine at PAI.
Regards
Uwe