Application Development 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: 

ALV Grid

Former Member
0 Kudos
108

Hi,

I have a modifiable ALV Grid embedded in an GUI container on a dynpro. If the user now enters new data into the grid and presses the enter button on the dynpro, I can raise an event on the ALV class object in order to transport this new data from the GUI to the program. Unfortunately, if the cursor is positioned on the grid itself and the user press the enter button on the keyboard, no event is raised and the data are not transported. Is there any way to force the ALV to transport the data on this event?

Thanks.

Thomas

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
77

After setting the ALV grid for first display in the PBO, try calling this.

          call method alv_grid->register_edit_event
                        exporting
                           i_event_id = cl_gui_alv_grid=>mc_evt_enter.

Regards,

Rich Heilman

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
78

After setting the ALV grid for first display in the PBO, try calling this.

          call method alv_grid->register_edit_event
                        exporting
                           i_event_id = cl_gui_alv_grid=>mc_evt_enter.

Regards,

Rich Heilman

0 Kudos
77

Thanks, that's it!

Former Member
0 Kudos
77

Hi,

the Sy-UCOMM of the ENTER button is captured in the PAI of the Screen and thus the Data change event, which is exclusive for ALV and its elements, will not be triggered. YOu have to call the

<b>CALL METHOD LG_ALV_GRID01->CHECK_CHANGED_DATA</b> method in the PAI of the Screen. Check the Sy-UCOMM of the enter button(sometimes it will be SPACE).

thus add the below code in your PAI of the Screen

CASE OKCODE

WHEN SPACE

<b>CALL METHOD LG_ALV_GRID01->CHECK_CHANGED_DATA</b>

ENDCASE/.

CHECK_CHANGED_DATA method will internally raise the DATA_CHANGED Event.

I hope it solves your problem

Regards,

Vara