Skip to Content
0
Former Member
Jan 05, 2012 at 10:36 AM

CL_SALV_TABLE list refresh after change of field visibility (set_technical)

612 Views

Dear all,

in a ALV list i hide some collums with method cl_salv_column_table-set_technical. If the user presses a butten, i like to show the hidden columns, but the filelds are still hidden. I called the method cl_salv_table->refresh and i tryed method cl_salv_table->set_data, but no effect. Only if i destroy the ALV Object the hidden fields are shown. How can i show the hidden fields without creating the ALV new?

Here a short code fragment:

  IF r_dock_cont_top IS INITIAL.                      "Reference to Dynprocontainer
    CREATE OBJECT r_dock_cont_top
      EXPORTING
        side      = r_dock_cont_top->dock_at_top
        extension = '250'.

    TRY.
        CALL METHOD cl_salv_table=>factory
          EXPORTING
            r_container  = r_dock_cont_top
          IMPORTING
            r_salv_table = r_salv_top
          CHANGING
            t_table      = <t_alv_top>.
      CATCH cx_salv_msg .
    ENDTRY.
    PERFORM alv_field_visibility.                      "hide collumns SET_TECNICAL = TRUE
    r_salv_top->display( ).

  ELSE.
    PERFORM alv_field_visibility.                       "show hidden collumns SET_TECNICAL = FALSE
    CALL METHOD r_salv_top->set_data         " no effect
      CHANGING
        t_table = <t_alv_top>.
*    r_salv_top->refresh( refresh_mode = if_salv_c_refresh=>full ). " no effect
  ENDIF.

Thanks for Answer!

Wolfgang

Edited by: Wolfgang Boehm on Jan 5, 2012 11:36 AM