‎2009 Sep 25 8:59 PM
Hi all,
I have a zclass and a program with a screen.
In this program i have an instance of my zclass. My question is, is it possible to refresh a screen in a method of my class?
Or there is a way to refresh a screen of a program within another program?
Regards,
Pedro Bessa
‎2009 Sep 26 8:34 PM
Hi Pedro,
whaever you call the refreshing of the screen, it is not related to your classes instance. The PBO of a screen is automatically processed after the PAI. PAI is triggered by anay kind of user-command. As long as you do not leave the screen or call another screen, the PBO is executed after PAI and the screen is displayed again.
If you want a method of your class to refresh the screen, the method should be called in PBO returning, exporting or changin the screen fields.
If all screen fields are in the same structure, you can do like this
* PBO
z_screen_structure = zxy->get_screenfields( ).
* PAI
zxy->set_screenfields( z_screen_structure ).In the get method, define a RETURNING parameter, in the set method an IMPORTING parameter with the TYPE of your screen structure.
Regards,
Clemens
‎2009 Sep 25 9:30 PM
each time the PBO is called (i.e) the screen is displayed, the program will automatically fill the values to the screen, if they are mapped to the variables from which you want them to be refreshed.
if not, pass them in the PBO modules
‎2009 Sep 25 9:34 PM
My variables are being refreshed in the pbo but how can i force the pbo to be executed from another program?
‎2009 Sep 26 8:34 PM
Hi Pedro,
whaever you call the refreshing of the screen, it is not related to your classes instance. The PBO of a screen is automatically processed after the PAI. PAI is triggered by anay kind of user-command. As long as you do not leave the screen or call another screen, the PBO is executed after PAI and the screen is displayed again.
If you want a method of your class to refresh the screen, the method should be called in PBO returning, exporting or changin the screen fields.
If all screen fields are in the same structure, you can do like this
* PBO
z_screen_structure = zxy->get_screenfields( ).
* PAI
zxy->set_screenfields( z_screen_structure ).In the get method, define a RETURNING parameter, in the set method an IMPORTING parameter with the TYPE of your screen structure.
Regards,
Clemens
‎2009 Sep 26 9:52 PM
Hi Clemens,
I'll try to explain what i want to do...
I'm trying to build a toolbar for a table control. But the instance of the toolbar (CL_GUI_TOOLBAR) is in my zclass.
The problem is when the user click in a button of my toolbar the PBO is not executed. It passes automaticaly to the event receiver of the toolbar... But i need the PBO to be executed before this...
Regards,
Pedro Bessa
‎2009 Sep 26 10:38 PM
You need to use
call method cl_gui_cfw=>set_new_ok_code
exporting
new_code = 'REFR'. " Dummy OKcode
After this call system auto calls PBO,.
a®
‎2009 Sep 27 10:07 AM
Hi Pedro,
[The handler method that you defined for the event is called automatically by the system.However, you can use the method set_new_ok_code to set a new value for the OK_CODE field. This then triggers the PAI and PBO modules, and you can evaluate the contents of the OK_CODE field as normal in a PAI module.|http://www.sapalv.net/2009/07/sap-alv-tutorial-2-%E2%80%93-event/]
Regards,
Clemens