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 using REUSE_ALV_GRID_DISPLAY question

Former Member
0 Kudos

Folks,

I am use REUSE_ALV_GRID_DISPLAY for ALV report. I have customized

the tool bar to have 3 to 4 columns as editable. In the FORM USER_COMMAND

of ALV, at SAVE, you can check the field name and update your internal table and report the changes. No problem....

Please note, I AM NOT using OO here. Just the regular Grid_display.

But if I change contents of all the 4 cells in a row, how can I capture all together and save these changes back to my internal table? Any thoughts?

-Thanks...Raj

4 REPLIES 4

Former Member
0 Kudos

Hi rajesh,

1. One thing i had done was to

have a copy of the internal table,

and compare each record by looping.

2. in that i used to come to know, if anything was changed.

regards,

amit m.

Former Member
0 Kudos
use this code in your user-command subroutine..

FORM USER_COMMAND...

Data ref1 type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
call method ref1->check_changed_data

CASE P_UCOMM.

When 'SAVE'.
   MODIFY ITAB.

ENDCASE.

ENDFORM.

0 Kudos

Thanks Chandrasekhar. That works like a charm.

Can I ask you one more question related to the user-command.

1) I run the report.

2) I make changes to certain fields and save.

3) Report displays updated rows

4) I can add more rows etc.

When I click on the back button, it should take me to the selection screen. Instead, it goes one screen back at a time navigating through all the screen changes.

Have you come across this?

Thanks, Rajesh

0 Kudos

Hi Rajesh,

I think that is the exepected behavior in this case. The user command handling is handled by the standard alv programs and hence cannot be altered for our requirements.

As an alternative, you can have your own pf status defined, whose function codes can be handled the way way we want them to behave.

Regards,

ravi