Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

container class

Former Member
0 Likes
2,524

please anybody tell me the functionality of these classes.it will be better if u give a brief.

CL_GUI_CUSTOM_CONTAINER ,

CL_GUI_ALV_GRID ,

CL_GUI_ALV_GRID ,

CL_GUI_DIALOGBOX_CONTAINER .

3 REPLIES 3
Read only

Former Member
1,358

A SAP container is a control that can accommodate other controls, such as the SAP Tree Control, SAP Picture Control, or the SAP Textedit Control. It maintains the controls in a logical collection, and provides an area in which they can be displayed.

A container is always assigned to a screen and takes over the role of communicating with the screen.

Each control lives in a container. Since containers are themselves controls, you can nest them.

Controls within a container are usually displayed in the same size as the container itself. Containers are known as the "parents" of the control that they contain. All SAP Containers are derived from a common superclass, the global class CL_GUI_CONTROL. They are derived from this basic container and thus have a uniform object-oriented interface.

SAP containers can contain:

*An area on a screen (SAP Custom Container)

*An entire screen (SAP Docking Container, SAP Dialog Box Container)

*Another container (SAP Splitter Container, SAP Easy Splitter Container)

The fact that you can nest controls provides further display possibilities.

When you create an instance of a SAP container, you assign it to a dialog box level, which you cannot subsequently change.

A dialog box level is created in ABAP by executing the statement CALL SCREEN <screen_no> STARTING AT <left_column_no> <top_row_no> [ENDING AT <right_column_no> <bottom_row_number>].

When you instantiate a container, the class constructor creates the container instances SCREEN0, SCREEN1, ..., SCREEN9. These are assigned to the different dialog box levels. Dialog box level 0 = SCREEN0, level 1 = SCREEN1, ... Dialog box level 9 = SCREEN9.

The container instances SCREEN0, ... , SCREEN9 are called top-level containers. They are used as "parents" for the SAP Custom Container, SAP Docking Container, and SAP Dialog Box Container. The top-level container is automatically assigned to the Container Control when it is instantiated. You cannot change this assignment at runtime.

The top-level container to which a container is assigned affects its visibility, and hence that of the other controls you display in it.

Controls in a container are only visible when the corresponding container is visible.

You need to know what the dialog box level has been assigned if you want to assign a container to a new screen (using the LINK method) or if a container is instantiated within a function module.

Use the SAP Custom Container Control to attach a control to a reserved area on a screen.

Create the area using the Custom Control element in the Screen Painter. The area can be resized.

You can assign a Custom Container Control instance to the area. This assigns the container to the screen. The container can be resized if the user changes the size of the SAP window.

The following parameters identify a custom control area uniquely at the CFW:

*Program name

*Screen number

*Name of the area

*Number of the dialog box level at which the container and screen can be displayed.

To create an instance of the SAP Custom Container Control, you need a data object that you declare using TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

To create the instance itself, use the statement CREATE OBJECT <object_reference_var>. In the statement, you must pass the relevant parameters to specify the attributes of the container. This is illustrated in the graphic. If you do not assign values to the parameters parent, repid, and dynnr, the system uses the current values at runtime (current dialog box level , current program name, current screen). You must specify the name of the screen area in which the container should appear in the parameter container_name.

At runtime, you can assign a custom container instance to a different screen area (with the type Custom Control). The new area can be on the same screen, on another screen in the same program, or even on a screen in a different program.

The screen containing the new area to which you want to link the control can only be displayed in the same dialog box level.

To reassign an instance, you call the method LINK for the container instance you want to reassign. The method links the container instance to the new screen area and dissolves the link to the old one.

SAP Dialog Box Container:

The SAP Dialog Box Container allows you to display controls in a moveable mode-less dialog box. You can also display controls in a full screen. The mode-less dialog box can have a title.

To create an instance of the SAP Dialog Box Container Control, you need a data object that you declare using TYPE REF TO cl_gui_dialogbox_control.

To create the instance itself, use the statement CREATE OBJECT <object_reference_var>. In the statement, you must pass the relevant parameters to specify the attributes of the container. This is illustrated in the graphic. If you do not assign values to the REPID and DYNNR parameters, the system uses the current values at runtime (current dialog box level , current program name, current screen).

Use the WIDTH and HEIGHT parameters to specify the size of the dialog box. The user can also change the size of the dialog box at runtime.

Use the CAPTION parameter to give a title to the modeless dialog box.

You can also change the window title at runtime using the instance method SET_CAPTION.

The SAP Dialog Box Container Control possesses a CLOSE event. This is triggered when the user tries to close the modeless dialog box.

In the event handler method, you must close the window using the instance method free.

You can find out which instance raised the event using the optional import parameter of the event handler method.

SAP Docking Container

The SAP Docking Container allows you to attach one or more areas to a screen. You can attach the area to any of the four edges of the screen. The area available to the actual screen is reduced by the space taken up by the docking container.

The user can change the size of the docking container control.

You can attach the container area of a SAP Docking Container Control to any of the four edges of the screen. To specify the edge of the screen technically, use one of the four class constants of the CL_GUI_DOCKING_CONTAINER class.

Generally, you assign the area to one edge of the screen in the constructor (using the SIDE parameter). By default the container is docked on the left.

You can change this assignment at runtime by using the DOCK_AT method.

To create an instance of the SAP Docking Container Control, you need a data object that you declare using TYPE REF TO cl_gui_docking_container.

To create the instance itself, use the statement CREATE OBJECT <object_reference_var>. In the statement, you must pass the relevant parameters to specify the attributes of the container. This is illustrated in the graphic. If you do not assign values to the REPID and DYNNR parameters, the system uses the current values at runtime (current dialog box level , current program name, current screen).

Use the SIDE parameter to determine the side of the screen to which the container will be attached.

At runtime, you can a docking container to another screen at the same dialog box level (re-link it). To do this, use the instance method LINK.

In the interface, you need to specify the new screen number and the name of the program to which it belongs. If you do not set a new program name, the system assumes that the new screen belongs to the same program as the old one.

SAP Splitter Container Control

The SAP Splitter Container Control allows you to display a group of controls in individual cells. The splitter container regulates the cells and displays them. The user can change the size of the individual cells using split bars. Increasing the size of one cell decreases that of the adjacent cell.

You can make the splitter bars immovable from within your program.

You can only place a Splitter Container Control in another container such as a Custom Container or a Docking Container.

You can nest splitter container instances.

The grid of a Splitter Container Control instance is initially set to 0 x 0. The maximum division is 16 x 16. You can specify the size of the lines and columns either absolutely in pixels or relatively as a percentage. The default setting is relative.

To create an instance of the SAP Splitter Container Control, you need a data object that you declare using TYPE REF TO CL_GUI_splitter_container as well as a reference to another container instance.

To create the instance itself, use the statement CREATE OBJECT <object_reference_var>. In the statement, you must pass the relevant parameters to specify the attributes of the container. This is illustrated in the graphic. If you do not assign values to the REPID and DYNNR parameters, the system uses the current values at runtime (current dialog box level , current program name, current screen).

Use the rows and columns parameters to specify the number of ROWS and COLUMNS that your grid should have.

Use the PARENT parameter to assign your splitter control instance to another container.

You can only assign a Splitter Container instance to a screen by using another container that is directly attached to the screen.

The cells of a splitter container are containers themselves. They are created when the Splitter Control is instantiated. They are used as containers for other controls, for which they are the "parents."

To assign further control instances to the cells of your splitter container instance, you need object references to the individual cells. To get a reference to a cell, use the instance method GET_CONTAINER. In the method call, use the row and column parameters to specify the cell. The RETURNING parameter contains a reference to a container instance.

SAP Easy Splitter Container

The SAP Easy Splitter Container is a simplified version of the SAP Splitter Container with a smaller range of functions. It allows you to display two controls in separate cells of a container area. You can arrange the cells either horizontally or vertically.

You can only use instances of the SAP Easy Splitter Container in other container instances.

You can nest Easy Splitter Container instances.

To create an instance of the SAP Easy Splitter Container Control, you need a data object that you declare using TYPE REF TO cl_gui_easy_splitter_container.

To create the instance itself, use the statement CREATE OBJECT <object_reference_var>. In the statement, you must pass the relevant parameters to specify the attributes of the container. This is illustrated in the graphic. If you do not assign values to the REPID and DYNNR parameters, the system uses the current values at runtime (current dialog box level , current program name, current screen).

Use the ORIENTATION parameter to specify whether the areas should be arranged horizontally or vertically. You can do this using the class constants cl_gui_easy_splitter_container=>orientation_vertical and cl_gui_easy_splitter_container=>orientation_horizontal.

Use the PARENT parameter to assign your splitter control instance to another container.

To set the position of the splitter bar at runtime, use the instance method SET_SASH_POSITION. For further details, refer to the online documentation

To assign further control instances to the cells of your splitter container, you need references to the individual cells. These are contained in the instance attributes TOP_LEFT_CONTAINER and BOTTOM_RIGHT_CONTAINER.

Regards,

Balaji

**Rewards if answers are useful

Read only

Former Member
0 Likes
1,358

Hello Ramesh,

A SAP container is a control that can accomodate other controls,it provides an area in which they can be displayed.It is always assigned to a screen and takes over the role of communicating with the screen.

All containers are derived from the super class CL_GUI_CONTROL,it has a subclass CL_GUI_CONTAINER which has further subclasses.

Some of the commonly used containers are custom container,splitter container,docking container.Some of the commonly used controls are trees,ALV Grids,Text Editors,HTML Controls,Picture Control.

<b>CL_GUI_DIALOGBOX_CONTAINER</b> .:This is used to display the dialog box container.It is displayed in a movable modelless dialog box which can have a title.

Chk demo program:<b>RSDEMO_DIALOGBOX_CONTROL</b>

<b>CL_GUI_CUSTOM_CONTAINER</b> :SAP Custom Container to build a control into an area on a screen or subscreen. You define the area occupied by the control in the Screen Painter. The default size of the control that you place in the Custom Container is the same as that of the container itself.

Chk demo program:<b>RSDEMO_CUSTOM_CONTROL</b>

<b>CL_GUI_ALV_GRID</b>:This is a control.The ALV grid control tool allows you to display and print non-hierarchial lists in a standardized format.The list data is displayed as a table on the screen.

Chk demo program:<b>BCALV*</b>

For ALV: http://www.sapdevelopment.co.uk/reporting/alvhome.htm

<b>You will get sample programs for all the containers and the controls on this link:

http://www.geocities.com/victorav15/sapr3/abap_ood.html</b>;

Regards,

Beejal

**Reward if helpful