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 Problem

Former Member
0 Kudos

Hello all,

I had a requirement wherein, i have created an editable ALV [Using REUSE_ALV_GRID_DISPLAY] with one column is made editable - here the user will enter the price and accordingly i have to change the column values in the next column..

I have created an editable alv using REUSE_ALV_GRID_DISPLAY and tried using cl_gui_alv_display-> change_data

everything is coming perfectly alright...But...........

Is there any way to handle 'ENTER' event in REUSE_ALV_GRID_DISPLAY...[ I had event tried event handling using cl_gui_alv_display->mc_enter but giving dump - i think parent container name should b given to create the object for cl_gui_alv_grid]

What should i do to handle the ENTER Event in editable alv using REUSE_ALV_GRID_DISPLAY??

- bit confused

Please guide me with regard to the same..........

1 ACCEPTED SOLUTION

anup_deshmukh4
Active Contributor
0 Kudos

hellow jagannathan krishnan ,

In REUSE_ALV_GRID_DISPLAY one can have a Call back Routine and ( There is a passing parameter for same FM ..!) and like when you press any button say save Catch the same function code in the call back routine and modify the internal table or say UPDATE DB what ever you want. Your can have your own tool bar For alv (Standard also works just debug and get the function code for the standard Save button...! )

and About the DATA changed event you when you do alv with OO approch...you need to have a Container Class Grid Class

display yor alv Using SET_TABLE_FOR_GRID_DISPLAY

and have a EVENT handler method ( For the events of the Grid Class ) attachet to the Grid Class so that you can Track the Changes in the Grid .

Hope it Clears you confusion...at some level...!

Thanks and regards,

3 REPLIES 3

anup_deshmukh4
Active Contributor
0 Kudos

hellow jagannathan krishnan ,

In REUSE_ALV_GRID_DISPLAY one can have a Call back Routine and ( There is a passing parameter for same FM ..!) and like when you press any button say save Catch the same function code in the call back routine and modify the internal table or say UPDATE DB what ever you want. Your can have your own tool bar For alv (Standard also works just debug and get the function code for the standard Save button...! )

and About the DATA changed event you when you do alv with OO approch...you need to have a Container Class Grid Class

display yor alv Using SET_TABLE_FOR_GRID_DISPLAY

and have a EVENT handler method ( For the events of the Grid Class ) attachet to the Grid Class so that you can Track the Changes in the Grid .

Hope it Clears you confusion...at some level...!

Thanks and regards,

0 Kudos

Hey thanks Anup,

could you suggest me the solution...

To be specific....

I have created an editable ALV [Using REUSE_ALV_GRID_DISPLAY] with one column made editable - the user will enter the price and accordingly the next column values had to be changed...everything is coming perfectly alright.

Is there any way to handle 'ENTER' event in REUSE_ALV_GRID_DISPLAY....

0 Kudos

Can't Tell you specifically if you can handle the Enter event but look at the below steps,

1. Write the call Back Routine(initally with a break point )

2. When you diplay ALV swith on the debugger

3. When you edit and press enter check if the call back routing is invoked (it will stop at the break point) if yes you can check the SY-UCOM value and handler.

5. if not just When you Edit the Cells in alv and press the SAVE button on the grid it surely will invoke the call back routing where you will get the Sy-ucom value for SAVE i.e. when the User changes the content of the alv and hits save you need to do your changes...!'

Hope it solves your problem.