Skip to Content
0
Jun 12, 2020 at 10:28 AM

CL_SALV_TABLE Calling a second CL_SALV_TABLE

940 Views

Hello all!

using Paul Hardy 's great blog, I managed to create my CL_SALV_TABLE with all the functions (customs and not) I need, making it editable thanks to Naimesh Patel 's hints.

Now a new businness requirement comes up: clicking on a new function button (added and implemented!) i should call a second alv already managed within its class with all the functions and the hotspots and user commands.

I naively tried to just create the new object and call the method to show the alv, but i do not get any refresh of the screen, the shown alv is always the "old one".

Here some code snippets to explain better:

  • Class 1 - Method SHOW_ALV
  METHOD show_alv.
    CALL FUNCTION 'SALV_CSQT_CREATE_CONTAINER'
      EXPORTING
        r_content_manager = me
        title             = 'Tabella guida per interfaccia file'.
  ENDMETHOD.

Still Class 1, implementing interface if_salv_csqt_content_manager~fill_container_content to create and show ALV

METHOD if_salv_csqt_content_manager~fill_container_content.

    alv = create_alv( r_container ).
    set_alv_fcat( CHANGING c_alv = alv ).
    set_alv_functions( CHANGING c_alv = alv ).
    alv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).
    SET HANDLER on_user_command FOR alv->get_event( ).
    SET HANDLER on_link_click FOR alv->get_event( ).

    alv->display( ).
  ENDMETHOD.

always Class 1, user command (NB. "transcode" is defined type ref class2)

      WHEN 'TRASCODE'.
        CREATE OBJECT transcode EXPORTING i_setup = setup_data .
        CHECK transcode IS NOT INITIAL.
        transcode->update_from_config( return_config_table_extended( ) ).
        transcode->show_alv(   ).
      WHEN OTHERS.
    ENDCASE.

  ENDMETHOD.

In class 2, SHOW_ALV and interface if_salv_csqt_content_manager~fill_container_content are implemented in similar way.

Any suggestion?

Thanks!

Simone