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: 

change data in salv table

0 Kudos

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.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

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".

2 REPLIES 2

Sandra_Rossi
Active Contributor

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".

raymond_giuseppi
Active Contributor

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)