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?

MaryM
Participant
0 Likes
10,806

Hi everyone,

I'm using cl_salv_table to dispaly ALV (fullscreen)

with customized toolbar button.

The problem is, that my table is not getting updated.

Im using on_user:command and after that REFRESH.

********************************************************************

CLASS lcl_handle_events IMPLEMENTATION.

METHOD on_user_command.

PERFORM handle_user_command USING e_salv_function.

gr_table->refresh( refresh_mode = 2 ).

ENDMETHOD. "on_user_command

ENDCLASS. "lcl_handle_events IMPLEMENTATION

Am I missing something here?

Thanks in advance!

MaryM

Hi everyone,

I'm using cl_salv_table to dispaly ALV (fullscreen)

with customized toolbar button.

The problem is, that my table is not getting updated.

Im using on_user:command and after that REFRESH.

********************************************************************

CLASS lcl_handle_events IMPLEMENTATION.

METHOD on_user_command.

PERFORM handle_user_command USING e_salv_function.

gr_table->refresh( refresh_mode = 2 ).

ENDMETHOD. "on_user_command

ENDCLASS. "lcl_handle_events IMPLEMENTATION

Am I missing something here?

Thanks in advance!

MaryM

4 REPLIES 4
Read only

MaryM
Participant
0 Likes
1,042

I saw the problem myself.

I just had to clear and refill gt_outtab before calling gr_table->refresh( ).

Read only

Former Member
0 Likes
1,042

I'm facing the same problem here.

I've tried this logic and it still doesn't work.

data: lt_outtab like gt_outtab.

lt_outtab = gt_outtab.

refresh gt_outtab.

gt_outtab = lt_outtab.

gr_alv_table->refresh( ).

Can you please explain how you clear and refill data?

Read only

Former Member
0 Likes
1,042

You have to update your internal table which is passed to ALV and then  you call method refresh

Read only

Former Member
0 Likes
1,042

Hi ketlin,

use this code,wherever u want to update the table. for example.........

-------------------------------------------------------------------

*****refresh the internal table

   refresh lt_sflight.

******Append the empty table first.

   lo_nd_sflight->bind_table( new_items = lt_sflight set_initial_elements = abap_true ).

******whatever u want, u can fetch the data from dictionary

SELECT CARRID CONNID FLDATE CURRENCY PLANETYPE FROM SFLIGHT

                               INTO CORRESPONDING FIELDS OF TABLE LT_SFLIGHT

                               WHERE CARRID = LV_ID.

******Append the data internal table

   lo_nd_sflight->bind_table( new_items = lt_sflight set_initial_elements = abap_true ).

Regards,

Anand.