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: 

ALV container

Former Member
0 Kudos

Hi all,

I need information regarding ALV containers.

Please help me if i can get material regarding this topic.

Thanks & Regards

Gowthami

6 REPLIES 6

Former Member
0 Kudos

There are five kinds of SAP Containers:

1.The SAP Custom Container allows you to display controls in an area defined on a normal

screen using the Screen Painter.

Class: CL_GUI_CUSTOM_CONTAINER

2. The SAP Dialog Box container allows you to display controls in an amodal dialog box or

fullscreen.

Class: CL_GUI_DIALOGBOX_CONTAINER

3. 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.

Class: CL_GUI_DOCKING_CONTAINER

4. The SAP Splitter Container allows you to display more than one control in a given area by dividing it into cells.

Class: CL_GUI_SPLITTER_CONTAINER

5. The SAP Easy Splitter Container allows you to divide an area into two cells with a control in each. The cells are separated by a moveable splitter bar.

Class: CL_GUI_EASY_SPLITTER_CONTAINER

1. DATA: alv TYPE scrfname VALUE 'ALV',

obj_c_container_alv TYPE REF TO cl_gui_custom_container,

obj_grid TYPE REF TO cl_gui_alv_grid.

CREATE OBJECT obj_c_container_alv

EXPORTING

container_name = alv

.

IF obj_grid IS INITIAL.

CREATE OBJECT obj_grid

EXPORTING

i_parent = obj_c_container_alv.

3. CREATE OBJECT w_docking_container

EXPORTING

ratio = 95

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

others = 6.

CREATE OBJECT w_alv_grid

EXPORTING

i_parent = w_docking_container.

4. CREATE OBJECT obj_c_container_alv

EXPORTING

container_name = alv

.

IF obj_grid IS INITIAL.

CREATE OBJECT v_split

EXPORTING

parent =

obj_c_container_alv

  • left = 0

  • top = 300

  • width = 400

  • height = 200

rows = 2

columns = 1

  • ORIENTATION = 0

  • sash_position = 25

  • with_border = 0

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

others = 3.

  • Set row height for row 1

CALL METHOD v_split->set_row_height

EXPORTING

id = 1

height = 40.

5. CREATE OBJECT obj_c_container_alv

EXPORTING

container_name = alv

.

IF obj_grid IS INITIAL.

CREATE OBJECT v_split

EXPORTING

parent = obj_c_container_alv

ORIENTATION = 0

  • sash_position = 25

  • with_border = 0

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

others = 3.

  • Get the containers of the splitter control

v_contnr_top = v_split->top_left_container.

v_contnr_bot = v_split->bottom_right_container.

CREATE OBJECT obj_grid

EXPORTING

i_parent = obj_c_container_alv.

*********************************

check these links

http://www.sapgenie.com/abap/OO/

http://www.sapgenie.com/abap/OO/index.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm

http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt

http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt

http://www.allsaplinks.com/

http://www.sap-img.com/

http://www.sapgenie.com/

http://help.sap.com

http://www.sapgenie.com/abap/OO/

http://www.sapgenie.com.

http://www.sapgenie.com/abap/OO/index.htm

http://www.sapgenie.com/abap/controls/index.htm

http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf

http://www.sapgenie.com/abap/OO/index.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

http://www.sapgenie.com/abap/OO/

****************************************

SAP Custom Container

Use

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.

Prerequisites

Before you can include a control in a Custom Container, you must define the area that the container will occupy. You do this in the Screen Painter.

http://help.sap.com/saphelp_nw04/helpdata/en/64/9e7759068011d294f000a0c94260a5/frameset.htm

the above link gives the procedure to create a container.

Also, Jus go thro the following links.

http://help.sap.com/saphelp_nw04s/helpdata/en/7f/485382045211d294ed00a0c94260a5/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/83/7a1901de6e11d195460000e82de14a/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/e9/635fa6e01e11d195490000e82de14a/frameset.htm

amit_khare
Active Contributor
0 Kudos

Welcome to SDN.

Refer the link -

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

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

A very simple program to understand about using containers in ALV Programs!!!


REPORT ZND_ALVFIRST .


data: okcode like sy-ucomm,
      t_mara type standard table of mara,
      custom1 type ref to cl_gui_custom_container,
      grid1 type ref to cl_gui_alv_grid.




start-of-selection.
set screen '0100'.


*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.

case okcode.

when 'EXIT'.
set screen '0'.
endcase.

ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*

MODULE STATUS_0100 OUTPUT.

CREATE OBJECT CUSTOM1
  EXPORTING
    CONTAINER_NAME              = 'MYCUSTOM'.

CREATE OBJECT GRID1
  EXPORTING

    I_PARENT          = custom1.


perform loaddata.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Form  loaddata
*&---------------------------------------------------------------------*

FORM loaddata.


select * from mara into table t_mara.

CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
 EXPORTING

   I_STRUCTURE_NAME              = 'mara'

  CHANGING
    IT_OUTTAB                     = t_mara

        .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDFORM.                    " loaddata

Reward points if useful!!!

Thanks Naveena.

0 Kudos

Follow the steps which are below:

1) declare reference variables for the ALV grid control and the container.

DATA: grid TYPE REF TO cl_gui_alv_grid,

G_custom_container TYPE REF TO cl_gui_custom_container,

Gt_sflight TYPE TABLE OF sflight. (Output table)

2) the SAP custom container allows you to display controls in an area defined on a normal screen using the screen painter.

Class: CL_GUI_CUSTOM_CONTAINER

3) in the PBO module of the screen, you must now instantiate the container control and the ALV grid control. By doing this, you create a link between the container control and the screen, using the container created in the screen painter.

CREATE OBJECT g_custom_container

Exporting

Container_name = 'ccontainer'. (As declared on screen)

Create object grid1

Exporting

I_PARENT = g_custom_container.

4) pass the output table and the structure data to the ALV grid control.

CALL METHOD grid->set_table_for_first_display

Exporting i_structure_name = 'sflight'

CHANGING IT_OUTTAB = gt_sflight.

In this case, the structure data is provided through the data dictionary. The ALV grid control gets the field information from table SFLIGHT and displays all fields of the table. GT_SFLIGHT is the output table.

former_member386202
Active Contributor
0 Kudos

Hi,

Goto SE38 and give BCALV* and press F4, it will display list of all the sap stadard alv container reports. Refer that.

Regards,

Prashant

Former Member
0 Kudos

Hi

Check out this link

<u>https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4c70444a-0801-0010-7688-9e4bd844b783</u>

Thanks

Vasudha