2013 Jul 24 4:00 PM
Hello,
Is there any way to gain access to the protected attribute MT_OUTTAB in class cl_gui_alv_grid?
Using function 'GET_GLOBALS_FROM_SLVC_FULLSCR', I am able to retrieve the class of type cl_gui_alv_grid, but because the attribute is protected, I can't access it.
The reason I need this, is because I can't rely solely on the changed data alone. The data I'm displaying in the ALV grid has default values that can be optionally overwritten by the user, but it isn't necessary. So after input validation (using method cl_gui_alv_grid->check_changed_data) I still need to retrieve the complete table, and not just the changes.
I've looked around, and see this question popping up from time to time, but it's never answered completely.
2013 Jul 24 4:40 PM
Hi Dave, try use CL_ISSR_BASI_ALV_GRID class, its superclass is CL_GUI_ALV_GRID and also has GET_DATA and SET_DATA method.
Its construction is similar to CL_GUI_ALV_GRID, I hope this help you
Regards
David Carballido
2013 Jul 24 6:07 PM
Hi,
Is there any reason why want to access the MT_OUTTAB from CL_GUI_ALV_GRID, as the internal table values will be available in your program...can you not get the internal table records stored inside your program which you used it for ALV?
Please correct me if I am wrong in my understanding.
Thanks
Naren
2013 Jul 25 4:45 AM
Hi Dave,
If you see the method set_table_for_first_display
SAP Exports the table to memory ID you can try accessing it from there.
Also there is a way to gain access to the ITAB of any alv executed there is a very nice blog have a look.
I hope it solves your problem
Cheers
2021 Apr 15 11:45 PM
Hello Dave,
MT_OUTTAB is pointing to your internal table in your z program if you make changes after the calling of the grid method set_table_for_first_display You will be able to see those changes in the internal table.
I hope It helps
2022 Oct 31 4:58 PM
DATA: l_s_itab TYPE zfoca_s_alv_mrr_detail.
ENDIF.
2024 Jun 15 3:24 AM
2024 Jun 15 8:34 AM - edited 2024 Jun 15 8:35 AM
You do not need the access.
1. Delegate all ALV events(e.g. enter) to the PAI of your program. That can be done by CL_GUI_CFW=>SET_NEW_OK_CODE(<your_ok_code>).
2. In PAI, the first call you do is : go_alv->check_data_changed( ).
After this call the data in mt_outtab have been transferred to your own data table that has been given to the ALV via .set_table_for_first_display.