06-25-2022 8:46 AM
hi every one
i use cl_salv_table without countainer to display data
i want after click buttom in status bar chnage display data with different strucher
for example i display all data in table EKKO after click buttom display me all data in table EKPO without create new screen.
can i destroy salv and create it again ? or another solution
I hope i have been able to correctly put what i have meant.
06-25-2022 9:13 AM
You must use CL_SALV_TABLE=>FACTORY again if you want to display a new structure.
If you display the ALV in the same container, you must free it the ALV Grid. CL_SALV_TABLE doesn't have a FREE method as far as I know, instead you can free the container which will free all the controls inside it, including the ALV Grid control instantiated by CL_SALV_TABLE.
After that, re-instantiate the container (except if it's a system container like CL_GUI_CONTAINER=>SCREEN0) and do CL_SALV_TABLE=>FACTORY again.
PS: it's "structure", not "strucher".
06-25-2022 9:13 AM
You must use CL_SALV_TABLE=>FACTORY again if you want to display a new structure.
If you display the ALV in the same container, you must free it the ALV Grid. CL_SALV_TABLE doesn't have a FREE method as far as I know, instead you can free the container which will free all the controls inside it, including the ALV Grid control instantiated by CL_SALV_TABLE.
After that, re-instantiate the container (except if it's a system container like CL_GUI_CONTAINER=>SCREEN0) and do CL_SALV_TABLE=>FACTORY again.
PS: it's "structure", not "strucher".
06-27-2022 3:55 PM
Did you try to use the public SET_DATA method 'Create New Instance with New Data Structure' ?
(If unlucky, you would have to handle the cx_salv_no_new_data_allowed class exception)