A SAP Container is a control that accommodates other controls, such as the SAP Tree Control, SAP Picture Control, SAP Textedit Control, SAP Splitter Control, and so on. It manages these controls logically in a collection, and provides a physical area in which they are displayed.
All controls live in a container. Since containers are themselves controls, you can nest them. The container is the parent of the control within it.
There are five kinds of SAP Containers:
SAP Custom Container
The SAP Custom Container allows you to display controls in an area defined on a normal screen using the Screen Painter.
SAP Docking Container
The SAP Docking Container allows you to attach a control to any of the four edges of a screen as a resizable screen area. You can also detach it so that it becomes an independent amodal dialog box.
SAP Splitter Container
The SAP Splitter Container allows you to display more than one control in a given area by dividing it into cells.
W_GRID TYPE REF TO CL_GUI_ALV_GRID.
CREATE OBJECT W_GRID
I_SHELLSTYLE = 0
I_PARENT = CL_GUI_CONTAINER=>SCREEN0
I_FCAT_COMPLETE = SPACE
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0
By defining a CONTAINER we will be able to display the output in the CONTAINER rather than the whole LIST.