Application Development and Automation 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: 
Read only

ALV Grid - Trigger PBO ?

Former Member
0 Likes
3,604

Hi,

I have a screen 100 which calls a subscreen 500.

500 has an alv grid (cl_gui_alv_grid). User shd choose a record and press button "Accept" and the certain values of this record shd populate teh screen fields of Screen 100.

on pressing Accept, it will call my event handler for user command and will populate the corresponding screen field of 100.

Now the value will reflect on screen 100, only if the PBO is called. But since the event was generated out of the ALV, PBO of 100 is not called. I know explicitly calling screen 100 in the event handler is a bad idea.

1. So how else to trigger the PBO ?

2. Or may be another idea would be to set this event user_command as an application event and hence it will come to PAI-PBO. but how to do this ?

Rgds,

Prash.

1 ACCEPTED SOLUTION
Read only

thomas_jung
Developer Advocate
Developer Advocate
1,912

You can trigger PBO/PAI with CL_GUI_CFW=>SET_NEW_OK_CODE( ). This can be called from within an event handler.

Hi,

I have a screen 100 which calls a subscreen 500.

500 has an alv grid (cl_gui_alv_grid). User shd choose a record and press button "Accept" and the certain values of this record shd populate teh screen fields of Screen 100.

on pressing Accept, it will call my event handler for user command and will populate the corresponding screen field of 100.

Now the value will reflect on screen 100, only if the PBO is called. But since the event was generated out of the ALV, PBO of 100 is not called. I know explicitly calling screen 100 in the event handler is a bad idea.

1. So how else to trigger the PBO ?

2. Or may be another idea would be to set this event user_command as an application event and hence it will come to PAI-PBO. but how to do this ?

Rgds,

Prash.

4 REPLIES 4
Read only

Former Member
0 Likes
1,912

You can try to use LEAVE SCREEN statament, infact only acive screen should be screen 100, so LEAVE SCREEN should leave PAI of 100 and trigger PBO of 100.

Read only

thomas_jung
Developer Advocate
Developer Advocate
1,913

You can trigger PBO/PAI with CL_GUI_CFW=>SET_NEW_OK_CODE( ). This can be called from within an event handler.

Read only

0 Likes
1,912

...

or fm <b>SAPGUI_SET_FUNCTIONCODE</b>

Andreas

Read only

0 Likes
1,912

14 years later Thomas Jung and you fixed my problem!