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

set_new_ok_code affects alv grid methods.

Former Member
0 Likes
1,219

Hello everyone.

I have an unusual issue. I have a toolbar custom ok_code to determine selected row in alv grid and update corresponding fields below with the chosen data. Methods like get_current_cell and get_selected_rows works until I do a cl_gui_cfw=>set_new_ok_code. I call that command to fire the PAI after updating screen fields. After that get_current_cell only returns row 1 and the get_selected_rows returns empty tables.

I am using the FM set table for first display. Is there a setting I am missing?

It almost seems like it loses its cursor.

Thanks for any help you can provide.

Steve

1 REPLY 1
Read only

Former Member
0 Likes
660

Hi Stephen,

System event: A system event is triggered before any automatic field checks (for example,

required fields) have taken place on the screen, and before any field transport. The PAI and

PBO events are not triggered. Consequently, you cannot access any values that the user

has just changed on the screen. Furthermore, there is no field transport back to the screen

after the event, so values that you have changed in the event handling are not updated on

the screen.

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 [Page 49] 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.

Application event: This event is processed in the PAI event. Consequently, all field checks

and field transport has taken place. If you want the event handler method to be called at a

particular point in your application program, you must process the event using the static

method CL_GUI_CFW=>DISPATCH.

I think u need to use CL_GUI_CFW=>DISPATCH before calling get_current_cell and get_selected_rows.

Regards,

Amitava