03-24-2009 9:48 AM
Hello community,
i put a table on a custom control of a dynpro using the class above. Now, after altering the table contents and doing a refresh, the visible table will not show any change.
here is the relevant code:
* The alv object is created like this
try.
cl_salv_table=>factory(
exporting
r_container = go_joblist_container
importing
r_salv_table = go_joblist_alv
CHANGING
* The table gt_joblist is global...
t_table = gt_joblist
).
catch cx_salv_msg.
exit.
ENDTRY.
lo_columns ?= go_joblist_alv->get_columns( ).
lo_columns->set_optimize( abap_true ).
go_joblist_alv->display( ).
* after a user command, the following code is processed
data ls_stat type zdb_fspo_stat01.
ls_stat = go_stat->get_stat( ).
go_jobs->shift( ls_stat-strtdate ).
clear gt_joblist. " For test reasons, the table is cleared
* gt_joblist = go_jobs->get_joblist( ).
go_joblist_alv->refresh( ).
cl_gui_cfw=>flush( ). " I event tried to do a flush - without effect
Can anybody help me?
Thanks to all
Jörg
03-24-2009 1:46 PM
Have you implemented the Events for the SALV object?
Check demo program: SALV_DEMO_TABLE_REFRESH which works well for the refresh on the button Change Data Records & Select Rows.
Regards,
Naimesh Patel
03-24-2009 3:35 PM
No, the user action is being initiated by the dynpro that carries the alv (PAI-Processing). I don't see how the implementation of events could help here?
03-24-2009 3:57 PM
Your code for refreshing must be triggered form the event handlers of your ALV.
Try to implement Events & the event handlers for your ALV e.g. BEFORE_SALV_FUNCTION.
Regards,
Naimesh Patel
03-24-2009 2:21 PM
What is the scope of the table variable?
I had a similar problem that I fixed by making the table an attribute of the local class, rather than a global variable of the report program. Once I did that, the method that caught the user action saw the updated (sorted) version of the table, not the original.
03-24-2009 3:37 PM
There is no report. It's a object-orientated transaction with a function module that contains a dynpro with the alv on it. The table is a global, private attribute of the main class. I did several similar programs where the refresh works fine...
03-24-2009 6:55 PM
Sorry, I was misunderstanding your question.
AFAIK, the refresh should work.
Have you tried the set_data method instead? Be aware, it'll wipe your display settings...