Professional Documents
Culture Documents
Displaying ALV in Splitter Container With Heading Using OOABAP
Displaying ALV in Splitter Container With Heading Using OOABAP
Community
Follow
Former Member
May 24, 2012 | 6 minute read
Author: Avinash Palavai, SAP Technical Consultant, Atos India Pvt. Ltd.
Introduction:
Splitter Container can be used to display data either from two or more tables or from a
single table based on particular conditions in ALV format using a single container at a time.
The classes that are used for achieving this are as follows,
1. CL_GUI_CUSTOM_CONTAINER .
2. CL_GUI_SPLITTER_CONTAINER .
3. CL_GUI_CONTAINER .
4. CL_GUI_ALV_GRID .
5. CL_DD_DOCUMENT.
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 1/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
Procedure:
1. First we have to design a modulepool screen (Screen No.100 ) with two custom controls,
each for ALV and Heading as below,
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 2/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
6. Here i took a case of displaying the material details of a particular material type ‘ZSEM’, in
the parent split alv list and the descriptions of those materials that are listed in
parent split alv in child split alv.
7. The heading being maintained for this ALV is ‘Material Master Report’.
************************************Coding****************************************
**
*REPORT ZOOALV_WITH_SPLITTER.
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 3/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
START-OF-SELECTION .
*&———————————————————————*
*&———————————————————————*
* text
*———————————————————————-*
PERFORM create_objects.
PERFORM spli_main_cont .
PERFORM DISP_HEADING.
PERFORM disp_alv1 .
PERFORM disp_alv2 .
*&———————————————————————*
*&———————————————————————*
* text
*———————————————————————-*
*———————————————————————-*
FORM CREATE_OBJECTS .
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 4/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
EXPORTING
CREATE OBJECT DD
* EXPORTING
* STYLE =
* BACKGROUND_COLOR =
* BDS_STYLESHEET =
* NO_MARGINS =
. ENDFORM. ” CREATE_OBJECTS
*&———————————————————————*
*&———————————————————————*
* text
*———————————————————————-*
*———————————————————————-*
FORM SPLI_MAIN_CONT .
EXPORTING
ROWS = 2
COLUMNS = 1.
EXPORTING
ROW = 1
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 5/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
COLUMN = 1
RECEIVING
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
ENDFORM. ” SPLI_MAIN_CONT
*&———————————————————————*
*&———————————————————————*
* text
*———————————————————————-*
*———————————————————————-*
FORM DISP_ALV1 .
EXPORTING
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 6/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
EXPORTING
CHANGING
*&———————————————————————*
*&———————————————————————*
* text
*———————————————————————-*
*———————————————————————-*
FORM DISP_ALV2 .
EXPORTING
EXPORTING
CHANGING
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 7/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
ENDFORM. ” DISP_ALV2
*&———————————————————————*
*&———————————————————————*
* text
*———————————————————————-*
*———————————————————————-*
form DISP_HEADING .
HEAD = CL_DD_DOCUMENT=>HEADING .
EXPORTING
EXPORTING
ENDFORM. ” DISP_HEADING
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 8/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
9. The result clearly illustrates the purpose and advantage of displaying the ALV in Splitter
Container.
Alert Moderator
Assigned Tags
ABAP Development
abap
abap objects
alv
ooabap
ooalv
Refresh of CL_SALV_TREE
By Matthew Billingham Aug 06, 2021
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 9/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
Related Questions
Create Dynamic Container
By Furkan Kızılarslan Mar 29, 2022
4 Comments
Former Member
May 24, 2012 at 9:39 pm
Rob
Like 0 | Share
Hello Rob,
HEAD = CL_DD_DOCUMENT=>HEADING .
Thanks ...
Like 0 | Share
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 10/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
Wolfgang Dörner
May 25, 2012 at 6:23 am
Hey!
Create a dynpro (no custom control needed in the example below this is "2000").
Then you can add following code. Here new SALV-Model (cl_salv_table) is used. If you want you can add one more row to the
splitter-container and then put your header document in it.
*--create salv1---------------------------*
cl_salv_table=>factory(
exporting
changing
t_table = lt_data2
).
*--create salv2---------------------------*
cl_salv_table=>factory(
exporting
*--show---------------------------*
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 11/12
19/7/23, 9:08 Displaying ALV in Splitter Container with heading using OOABAP | SAP Blogs
lo_alv1->display( ).
lo_alv2->display( ).
Like 0 | Share
Vinod Kumar
May 26, 2012 at 5:31 am
All known OO (S)ALV scenarios are well explained in the blog Against All Odds - Programming of Communicating (S)ALV Grid
Controls written by Uwe Schieferstein way back in 2010.
Unfortunately the source code mentioned in the blog seems to be unformatted after migration to new SCN. (may be due to
different formatting options)
Regards, Vinod
Like 0 | Share
Find us on
Newsletter Support
https://blogs.sap.com/2012/05/24/displaying-alv-in-splitter-container-with-heading-using-ooabap/ 12/12