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: 

Refresh method in cl_salv_hierseq_table not working

former_member210118
Participant
0 Kudos

Hi all,

I'm facing a problem with the refresh method of the class mentioned.

What I am trying to do is making a auto-refresh in the grid (using class cl_gui_timer). For that, I'm doing the following:

(this is all done in a local class)

At the START-OF-SELECTION I'm getting the data and creating the object for the TIMER.

Then, after END-OF-SELECTION, I have a form to display the grid. in this form I'm creating the bindings, the factory method, defining the event handlers and start the TIMER and display the grid itself.

In the event HANDLE_FINISHED is where i do the refresh. I defined 60 seconds for each refresh. In this event what i'm doing is getting the data again into the internal tables and then using these three lines of code:

"Refresh the Grid
gr_hierseq->refresh( refresh_mode = if_salv_c_refresh=>full ).
"Diplay Grid
gr_hierseq->display( ).
"Start Timer
go_timer->run( ).

The problem is that the program really gets to this code, the internal tables are modified and the call to the refresh method returns sy-subrc = 0, BUT the data on the grid stays the same, doesn't change at all.

One odd thing is that I have a button that i created that does the same as the "auto-refresh", and in this case the grid data appears changed.

Can anyone help me on this one ?

Than you,

Ricardo Monteiro

1 ACCEPTED SOLUTION

sdfraga
Participant

Hello Ricardo,

I have done a simple exercise with your instructions and I have manage to solve it.

It seems that the refresh is not enought and we need to force a dynpro event on top of it. (try to double click the table after the refresh is executed and you should see the modifications)

Try the following after you call the refresh method of the SALV object:

    call function 'SAPGUI_SET_FUNCTIONCODE'
      exporting
        functioncode           = '=ENT'
      exceptions
        function_not_supported = 1
        others                 = 2.

Hope it helps!

KR

Sérgio

1 REPLY 1

sdfraga
Participant

Hello Ricardo,

I have done a simple exercise with your instructions and I have manage to solve it.

It seems that the refresh is not enought and we need to force a dynpro event on top of it. (try to double click the table after the refresh is executed and you should see the modifications)

Try the following after you call the refresh method of the SALV object:

    call function 'SAPGUI_SET_FUNCTIONCODE'
      exporting
        functioncode           = '=ENT'
      exceptions
        function_not_supported = 1
        others                 = 2.

Hope it helps!

KR

Sérgio