2007 Jul 12 3:26 PM
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
2007 Jul 12 4:18 PM
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.
2007 Jul 12 4:26 PM
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.
2007 Jul 12 5:24 PM
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
2007 Jul 12 5:28 PM
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