Application Development and Automation 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: 
Read only

cl_salv_table - refresh does not work

jrgkraus
Active Contributor
0 Likes
6,370

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

6 REPLIES 6
Read only

naimesh_patel
Active Contributor
0 Likes
1,352

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

Read only

0 Likes
1,352

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?

Read only

0 Likes
1,352

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

Read only

bryan_cain
Contributor
0 Likes
1,352

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.

Read only

jrgkraus
Active Contributor
0 Likes
1,352

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

Read only

0 Likes
1,352

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