Hello,

Sign up to join our community!

Welcome Back,

Please sign in to your account!

Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

SAP EWM Help Latest Questions

  • 0
  • 0
admin

Create Multiple ALVs in single container(SALV)

DATA:
    lo_splitter   TYPE REF TO cl_gui_splitter_container,
    lo_container1 TYPE REF TO cl_gui_container,
    lo_container2 TYPE REF TO cl_gui_container.

  DATA:
    lo_alv1 TYPE REF TO cl_salv_table,
    lo_alv2 TYPE REF TO cl_salv_table.

  DATA:
    lv_header     TYPE lvc_title.

* Create Splitter
  CREATE OBJECT lo_splitter
    EXPORTING
      parent  = go_cc                " Your custom container
      rows    = 1                    " Number of rows
      columns = 2.                   " Number of columns

* Get container for first ALV
  lo_splitter->get_container(
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = lo_container1 ).

* Get container for second ALV
  lo_splitter->get_container(
    EXPORTING
      row       = 1
      column    = 2
    RECEIVING
      container = lo_container2 ).

  IF p_selcrt IS NOT INITIAL.
* Create SALV for first container
    cl_salv_table=>factory(
      EXPORTING
        r_container  = lo_container1
      IMPORTING
        r_salv_table = lo_alv1
      CHANGING
        t_table      = gt_newcr ).    " Your internal table

    lo_alv1->get_columns( )->set_optimize( abap_true ).

    DATA(cols1) = lo_alv1->get_columns( ).
    cols1->get_column( 'DOCNO' )->set_visible( space ).
    cols1->get_column( 'WERKS' )->set_visible( space ).
    DATA(lo_fun) = lo_alv1->get_functions( ).
    lo_fun->set_all( abap_true ).

    lv_header = 'New Batch Selection'(008).

* Get display settings
    DATA(lr_display_settings) = lo_alv1->get_display_settings( ).

* Set the list header
    lr_display_settings->set_list_header( lv_header ).

* Display ALVs
    lo_alv1->display( ).

  ENDIF.

  IF p_btccls IS NOT INITIAL.
* Create SALV for second container
    cl_salv_table=>factory(
      EXPORTING
        r_container  = lo_container2
      IMPORTING
        r_salv_table = lo_alv2
      CHANGING
        t_table      = gt_batcr ).    " Your internal table

    lo_alv2->get_columns( )->set_optimize( abap_true ).
    DATA(cols2) = lo_alv2->get_columns( ).
    cols2->get_column( 'DOCNO' )->set_visible( space ).
    cols2->get_column( 'WERKS' )->set_visible( space ).

    lv_header = 'Batch Classification'(009).

* Get display settings
    DATA(lr_display_sett2) = lo_alv2->get_display_settings( ).

* Set the list header
    lr_display_sett2->set_list_header( lv_header ).

    lo_alv2->display( ).

  ENDIF.
Leave an answer

Leave an answer