If you are confuse with above explanation then just forgot it and see the example. I have created a SCREEN 100 with custom container name 'CONTAINER'.
Below is the code for above screen shot.
REPORT zreport.
TABLES : scarr .
DATA : it_scarr TYPE TABLE OF scarr .
DATA : ob_custom TYPE REF TO cl_gui_custom_container ,
ob_split1 TYPE REF TO cl_gui_easy_splitter_container ,
ob_split2 TYPE REF TO cl_gui_easy_splitter_container ,
ob_grid1 TYPE REF TO cl_gui_alv_grid ,
ob_grid2 TYPE REF TO cl_gui_alv_grid ,
ob_grid3 TYPE REF TO cl_gui_alv_grid .
SELECT-OPTIONS : s_carrid FOR scarr-carrid .
START-OF-SELECTION .
SELECT *
INTO TABLE it_scarr
FROM scarr
WHERE carrid IN s_carrid .
CALL SCREEN 100 .
*&---------------------------------------------------------------------*
*& Module status_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET TITLEBAR 'ZTITLE01' .
SET PF-STATUS 'ZPF01' .
* This will create a container
CREATE OBJECT ob_custom
EXPORTING
container_name = 'CONTAINER' .
* This spit the container OB_CUSTOM into two
CREATE OBJECT ob_split1
EXPORTING
parent = ob_custom
orientation = cl_gui_easy_splitter_container=>orientation_vertical .
* Now we have two container
* OB_SPLIT1->TOP_LEFT_CONTAINER
* OB_SPLIT1->BOTTOM_RIGHT_CONTAINER
* Since these two are itself a container we can further devide them into two.
* Let try to divide OB_SPLIT1->BOTTOM_RIGHT_CONTAINER into two
CREATE OBJECT ob_split2
EXPORTING
parent = ob_split1->bottom_right_container
orientation = cl_gui_easy_splitter_container=>orientation_horizontal .
* Now we have total 3 container available with us
* OB_SPLIT1->TOP_LEFT_CONTAINER
* OB_SPLIT2->TOP_LEFT_CONTAINER
* OB_SPLIT2->BOTTOM_RIGHT_CONTAINER
* Note that OB_SPLIT1->BOTTOM_RIGHT_CONTAINER is not available because we divided
* that into two.
* Now Put a grid in each container
CREATE OBJECT ob_grid1
EXPORTING
i_parent = ob_split1->top_left_container .
CREATE OBJECT ob_grid2
EXPORTING
i_parent = ob_split2->top_left_container .
CREATE OBJECT ob_grid3
EXPORTING
i_parent = ob_split2->bottom_right_container .
CALL METHOD ob_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'SCARR'
CHANGING
it_outtab = it_scarr.
CALL METHOD ob_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'SCARR'
CHANGING
it_outtab = it_scarr.
CALL METHOD ob_grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'SCARR'
CHANGING
it_outtab = it_scarr.
ENDMODULE. " status_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module user_command_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
IF sy-ucomm = 'BACK' OR sy-ucomm = 'EXIT' .
FREE : ob_grid1 ,
ob_grid2 ,
ob_grid3 ,
ob_split1 ,
ob_split2 ,
ob_custom .
LEAVE TO SCREEN 0 .
ENDIF.
ENDMODULE. " user_command_0100 INPUTRecommended blogs
Display ALV Grid (OOP) Fullscreen
Use of Application Log FMs to display Message List/Log
Creating custom page format for sapscript/smartform
Reset ALV Export Option for User
nice explanation
ReplyDeleteGreat explanation! I was curious whether you could essentially split a screen into thirds (top/middle/bottom) by splitting vertically twice. Can you do this, or does a secondary split have to be opposite of the first?
ReplyDeleteThanks!!!
I think in above code if you replace the second split by
ReplyDeleteCREATE OBJECT ob_split2 EXPORTING parent = ob_split1->bottom_right_container orientation = cl_gui_easy_splitter_container=>orientation_vertical .
then you will get the desire result.
Hi, I'm getting an error: ASSERTION_FAILED scrolling down in the first ALV Grid. Have you ever got it????
ReplyDeleteTry sap note 1053399
ReplyDeletewhen i run the code am getting error
ReplyDeleteDynpro does not exist.
Have you defined screen 100 with custom container in it?
ReplyDeletewhat is procedure to define ?
ReplyDeletepls..
how to identify in wich ALV we triggered event?
ReplyDelete(in my case double click)
Usually we write a local class with method and assiciate that method double click of ALV grid. Write a local class for each ALV grid and register their method with double click.
ReplyDeleteCould you explain this in detail.
DeleteI need to create different action buttons for different ALVs.
Thanks & Regards
Amit Pal
Mob:+91-9999026862
clearly explained, but i need to know abt the screen 100 used here, do we need to draw the windows on the screen or is it a empty screen.
ReplyDeleteYou need to create screen 100. Put a custom container with name 'CONTAINER'
ReplyDeletei tried with this example.It is working fine.Here when i divide the Container (using split container using TOP_LEFT and BOTTOM_RIGHT) it is dividing the screen into two equal portions. How can i control this. I want the top Container to be minimal and below as bigger one. Can i control this. I tried with SET_HEIGHT method.But did't work. Can you look into this if get time.
ReplyDeleteThanks in Advance.
If you are using class CL_GUI_EASY_SPLITTER_CONTAINER as shown in above example, just pass SASH_POSITION parameter in constructor to control the position.
ReplyDeleteIts position in percentage
Is there a way to make it dynamic?
ReplyDeleteAs in a scenario where there are multiple company code records and each company code is a separate ALV grid
is there a way to make it dynamic...so we could control the no. of ALV grids based on the data in the internal table?
ReplyDeletehi, nice code. i'have tried and it works!. But i'm searching the abap code to display this such result using OOP ALV without using Screen/Container
ReplyDeleteIs it necessary to use CL_GUI_EASY_SPLITTER_CONTAINER? Can't we use CL_GUI_SPLITTER_CONTAINER? What is the difference between the two?
ReplyDeleteIs it possible to i_structure_name = 'st', where 'st' is define in the abap code and not in the dictionary?
ReplyDeleteIs it possible to i_structure_name = 'st', where 'st' is define in the abap code and not in the dictionary?
ReplyDeletei_structure_name = 'ST' , ST should be defined in dictionary.
oh, ok thanks bro
ReplyDeleteIts not working , so kindly explain me to do..........
ReplyDeletehave you defined screen 100, titlebar and pf status ZPF01?
Delete