Application Development 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: 

why we use custom container in OOPS ALV

Former Member
0 Kudos

Dear ABAPers Plz answer the following question

why we use custom container in OOPS ALV?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

<b>SAP Custom Container</b>

The SAP Custom Container allows you to display controls( ALV GRID,

ALV TREE control, displaying LOGO) in an area defined on a normal screen using the Screen Painter.

<b>Class: CL_GUI_CUSTOM_CONTAINER</b>

<b>Use</b>

Use the 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.

for defining the custom container you must maintain refarence variable to CL_GUI_CUSTOM_CONTAINER in declaration part and create object to CL_GUI_CUSTOM_CONTAINER in PAI or PBO event's of SCREEN.

1) ****maintaining refarence variable to CL_GUI_CUSTOM_CONTAINER

<b>DATA: container TYPE REF TO CL_GUI_CUSTOM_CONTAINER.</b>

here we can instantation and screen integration.

here we can specifies the output location, where we can display GRID CONTROL or LOG based on our requirement.

2) <b>in SCREEN we can define the contianer.</b>

1) goto SE51.

2) provide screen number and description

3) select LAYOUT option

4) select one control.( seelct 2nd screen element from bottom)

5) maintain ATTRIBUTES ( provide name, it must same as

CONTAINER_NAME = 'container1')

6)save and activate.

3) ******in flow logic PBO/PAI of screen you we can creating object to CL_GUI_CUSTOM_CONTAINER

IF container IS INITIAL.

<b>CREATE OBJECT container CONTAINER_NAME = 'container1'.</b>

you must pass the same name( screen atribute name ) to container_name parameter while creating object to CL_GUI_CUSTOM_CONTAINER.

<b>for more information on custom container follow this link.</b>

http://help.sap.com/saphelp_nw04/helpdata/en/c2/27e14e59ed11d29bd90000e8a47b2e/content.htm

<b>for sample program follow this link</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d97...

regards,

Ashok Reddy

5 REPLIES 5

p291102
Active Contributor
0 Kudos

Hi,

Have a look at below link. Its a PDF document Which will give you information abt OO ALV.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf

Also have a look at below link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm

Check the following standard programs also.

BCALV_GRID_01 to BCALV_GRID_11,BCALV_GRID_DEMO.

Thanks,

Sankar M

Former Member
0 Kudos

Hi,

<b>SAP Custom Container</b>

The SAP Custom Container allows you to display controls( ALV GRID,

ALV TREE control, displaying LOGO) in an area defined on a normal screen using the Screen Painter.

<b>Class: CL_GUI_CUSTOM_CONTAINER</b>

<b>Use</b>

Use the 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.

for defining the custom container you must maintain refarence variable to CL_GUI_CUSTOM_CONTAINER in declaration part and create object to CL_GUI_CUSTOM_CONTAINER in PAI or PBO event's of SCREEN.

1) ****maintaining refarence variable to CL_GUI_CUSTOM_CONTAINER

<b>DATA: container TYPE REF TO CL_GUI_CUSTOM_CONTAINER.</b>

here we can instantation and screen integration.

here we can specifies the output location, where we can display GRID CONTROL or LOG based on our requirement.

2) <b>in SCREEN we can define the contianer.</b>

1) goto SE51.

2) provide screen number and description

3) select LAYOUT option

4) select one control.( seelct 2nd screen element from bottom)

5) maintain ATTRIBUTES ( provide name, it must same as

CONTAINER_NAME = 'container1')

6)save and activate.

3) ******in flow logic PBO/PAI of screen you we can creating object to CL_GUI_CUSTOM_CONTAINER

IF container IS INITIAL.

<b>CREATE OBJECT container CONTAINER_NAME = 'container1'.</b>

you must pass the same name( screen atribute name ) to container_name parameter while creating object to CL_GUI_CUSTOM_CONTAINER.

<b>for more information on custom container follow this link.</b>

http://help.sap.com/saphelp_nw04/helpdata/en/c2/27e14e59ed11d29bd90000e8a47b2e/content.htm

<b>for sample program follow this link</b>

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d97...

regards,

Ashok Reddy

Former Member
0 Kudos

Hi,

If we use standard FM to create a container, it will be created at standard place / position. we can change the position of the container. If you want 2 containers at desired places its not possible through standard Fm so we will custom containers.

Regards

  • Dj

reward for all useful answers

matt
Active Contributor

s2jha

See moderator comment on your post here: https://answers.sap.com/questions/4077716/difference-between-modify--append-and-update.html

Don't ask for upvotes. It's perceived as rude, and causes quite a few people to simply down vote.

Sandra_Rossi
Active Contributor
0 Kudos

It doesn't answer the OP question. The question is "why", not "how". Maybe the OP didn't express the question well anyway, but difficult to ask now, as the OP seems not be an active SAP user ("former member") for almost 15 years.

Possible answer to the question, 15 years ago (that I would have posted as a comment so that the OP first clarifies the question before I can post an adequate answer): "you seem to assume that an ALV grid can be displayed only in a Custom Container. That's wrong, it can be displayed in any type of Container (Custom, Docking, etc.) If your point is more about why using a Custom Container rather than a Docking Container, or any other one, I guess that the question would be more about the difference between all the types of Containers. Please refine your question."