06-10-2011 9:12 AM
Hello Expert,
In my project, we need to read data from DB and display in the ALV. In the ALV output, we should be able to edit the records, and after user clicks the "Save" button in the applicaiton toolbar, the program should be able to save the changed data into DB.
Currently, I can display the data in ALV and all fields are editable. After I change some data and click "Save", the program will go into subroutine 'F_ALV_USER_COMMAND', but the data in the internal table GT_OUTTAB is not changed.
I generate the ALV output by the following calling:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = wf_pgm
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_callback_pf_status_set = 'F_PF_STATUS_SET'
i_callback_user_command = 'F_ALV_USER_COMMAND'
is_variant = g_variant
tables
t_outtab = gt_outtab
exceptions
program_error = 1
others = 2.
In the subroutine 'F_PF_STATUS_SET', I call a GUI Status defined by myself.
But if I call as below
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = wf_pgm
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_callback_pf_status_set = 'F_PF_STATUS_SET'
i_callback_user_command = 'F_ALV_USER_COMMAND'
is_variant = g_variant
tables
t_outtab = gt_outtab
exceptions
program_error = 1
others = 2.
GT_OUTTAB is changed accordingly after clicking the "Save".
Can any expert tell me why Internal table is not changed in the case I use user-defined GUI Status?
Thanks & Regards, Johnny
Edited by: Yongbo Wu on Jun 10, 2011 10:51 AM
06-10-2011 10:48 AM
Hi,
After updation of the Ztable try to write one more select query To change the ITAB and pass the ITAB to Grid.
Regards,
Dhina..
06-10-2011 10:39 AM
Hi Yongbo;
Unfortunately REUSE_ALV_GRID_DISPLAY has update problem.
REUSE_ALV_LIST_DISPLAY FM is making automatic update/change itab.
You can change REUSE_ALV_GRID_DISPLAY FM with REUSE_ALV_LIST_DISPLAY FM.
Best Regards.
call function 'REUSE_ALV_LIST_DISPLAY' "'REUSE_ALV_GRID_DISPLAY'
06-10-2011 10:48 AM
Hi,
After updation of the Ztable try to write one more select query To change the ITAB and pass the ITAB to Grid.
Regards,
Dhina..