{"id":7111,"date":"2025-07-24T00:47:40","date_gmt":"2025-07-23T19:17:40","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?post_type=question&#038;p=7111"},"modified":"2025-08-30T21:45:35","modified_gmt":"2025-08-30T16:15:35","slug":"create-multiple-alvs-in-single-containersalv","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=create-multiple-alvs-in-single-containersalv","title":{"rendered":"Create Multiple ALVs in single container(SALV)"},"content":{"rendered":"\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>DATA:\n    lo_splitter   TYPE REF TO cl_gui_splitter_container,\n    lo_container1 TYPE REF TO cl_gui_container,\n    lo_container2 TYPE REF TO cl_gui_container.\n\n  DATA:\n    lo_alv1 TYPE REF TO cl_salv_table,\n    lo_alv2 TYPE REF TO cl_salv_table.\n\n  DATA:\n    lv_header     TYPE lvc_title.\n\n* Create Splitter\n  CREATE OBJECT lo_splitter\n    EXPORTING\n      parent  = go_cc                &quot; Your custom container\n      rows    = 1                    &quot; Number of rows\n      columns = 2.                   &quot; Number of columns\n\n* Get container for first ALV\n  lo_splitter-&gt;get_container(\n    EXPORTING\n      row       = 1\n      column    = 1\n    RECEIVING\n      container = lo_container1 ).\n\n* Get container for second ALV\n  lo_splitter-&gt;get_container(\n    EXPORTING\n      row       = 1\n      column    = 2\n    RECEIVING\n      container = lo_container2 ).\n\n  IF p_selcrt IS NOT INITIAL.\n* Create SALV for first container\n    cl_salv_table=&gt;factory(\n      EXPORTING\n        r_container  = lo_container1\n      IMPORTING\n        r_salv_table = lo_alv1\n      CHANGING\n        t_table      = gt_newcr ).    &quot; Your internal table\n\n    lo_alv1-&gt;get_columns( )-&gt;set_optimize( abap_true ).\n\n    DATA(cols1) = lo_alv1-&gt;get_columns( ).\n    cols1-&gt;get_column( &#39;DOCNO&#39; )-&gt;set_visible( space ).\n    cols1-&gt;get_column( &#39;WERKS&#39; )-&gt;set_visible( space ).\n    DATA(lo_fun) = lo_alv1-&gt;get_functions( ).\n    lo_fun-&gt;set_all( abap_true ).\n\n    lv_header = &#39;New Batch Selection&#39;(008).\n\n* Get display settings\n    DATA(lr_display_settings) = lo_alv1-&gt;get_display_settings( ).\n\n* Set the list header\n    lr_display_settings-&gt;set_list_header( lv_header ).\n\n* Display ALVs\n    lo_alv1-&gt;display( ).\n\n  ENDIF.\n\n  IF p_btccls IS NOT INITIAL.\n* Create SALV for second container\n    cl_salv_table=&gt;factory(\n      EXPORTING\n        r_container  = lo_container2\n      IMPORTING\n        r_salv_table = lo_alv2\n      CHANGING\n        t_table      = gt_batcr ).    &quot; Your internal table\n\n    lo_alv2-&gt;get_columns( )-&gt;set_optimize( abap_true ).\n    DATA(cols2) = lo_alv2-&gt;get_columns( ).\n    cols2-&gt;get_column( &#39;DOCNO&#39; )-&gt;set_visible( space ).\n    cols2-&gt;get_column( &#39;WERKS&#39; )-&gt;set_visible( space ).\n\n    lv_header = &#39;Batch Classification&#39;(009).\n\n* Get display settings\n    DATA(lr_display_sett2) = lo_alv2-&gt;get_display_settings( ).\n\n* Set the list header\n    lr_display_sett2-&gt;set_list_header( lv_header ).\n\n    lo_alv2-&gt;display( ).\n\n  ENDIF.\n<\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"478\" src=\"https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/07\/Multi-ALV-in-one-containert.png\" alt=\"\" class=\"wp-image-7112\" style=\"width:649px;height:auto\" srcset=\"https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/07\/Multi-ALV-in-one-containert.png 780w, https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/07\/Multi-ALV-in-one-containert-300x184.png 300w, https:\/\/www.sapewmhelp.com\/wp-content\/uploads\/2025\/07\/Multi-ALV-in-one-containert-768x471.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/figure>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[158],"question_tags":[152,156,154,153,155],"class_list":["post-7111","question","type-question","status-publish","hentry","question-category-abap","question_tags-alv-report-with-salv","question_tags-alv-splitter","question_tags-cl_gui_container","question_tags-cl_gui_splitter_container","question_tags-cl_salv_table"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7111"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7111"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7111"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}