Skip to Content
author's profile photo Former Member
Former Member

ALV container class

Can anyone please let me know difference between cl_gui_docking_container and cl_gui_custom_container. And use of each of them.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 11:22 AM

    Hi,

    The docking container is the class used to implement the container which hangs on the side of the screen, for example, in SE80 it would be the entire left part of the screen which you are able to resize left to right and right to left. Docking containers can be implemented on any side of teh screen, and there can be more than one. Custom containers are containers which are embeded into the screen, so that class is used when you have defined a custom container area in your dynpro, of cource you can more than one here as well and be placed anywhere on the screen.

    <b>Use:</b>

    Custome Container - you can disply any where you want. Example - Module pool

    Docking Container - Starting from the First position.

    Custom Container: 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.

    Use the SAP Docking Container to attach one or more areas to a screen . You can attach an area to any or all of the four edges of the screen (top, bottom, left, or right). The screen is made smaller to accommodate the docking container. You can detach the docking container from the screen (floating) and reattach it.

    Docking container :

    The behavior of the areas in the container is determined by the sequence in which they are initialized. Docking Containers are attached to the screen from the inside out. This means that when you create a second container, it is attached to the edge of the screen, and the container that was already there is pushed outwards. From a purely technical point of view, you can attach any number of docking containers to a screen. However, remember that using too many can make your application confusing for the user.

    Regards,

    Padmam.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2007 at 01:01 PM

    Hi,

    The diffrence between Docking container and Custom container is that using docking container programatically you can craete the lay out for a grid how ever using custom container you need to drop and drag Custom container element on the screen and then craete the object for it and populate field catalogue and output Internal table how ever with docking container we dont do drag and drop but instead is is created programatically. see below example code on Docking container...

    tables:mara.

    DATA:pav1 TYPE REF TO cl_gui_alv_grid.

    data : o_docking type ref to cl_gui_docking_container.

    DATA:BEGIN OF itab OCCURS 0,

    matnr LIKE mara-matnr,

    mtart LIKE mara-mtart,

    matkl LIKE mara-matkl,

    END OF itab.

    PARAMETERS: s_matnr LIKE mara-matnr.

    SELECT matnr mtart matkl FROM mara INTO CORRESPONDING FIELDS OF TABLE

    itab WHERE matnr = s_matnr.

    CREATE OBJECT o_docking

    • EXPORTING

    • PARENT =

    • REPID =

    • DYNNR =

    • SIDE = DOCK_AT_LEFT

    • EXTENSION = 50

    • STYLE =

    • LIFETIME = lifetime_default

    • CAPTION =

    • METRIC = 0

    • RATIO =

    • NO_AUTODEF_PROGID_DYNNR =

    • NAME =

    • EXCEPTIONS

    • CNTL_ERROR = 1

    • CNTL_SYSTEM_ERROR = 2

    • CREATE_ERROR = 3

    • LIFETIME_ERROR = 4

    • LIFETIME_DYNPRO_DYNPRO_LINK = 5

    • others = 6

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    create object pav1 exporting i_parent = o_docking.

    CALL METHOD pav1->set_table_for_first_display

    EXPORTING

    • I_BUFFER_ACTIVE =

    • I_BYPASSING_BUFFER =

    • I_CONSISTENCY_CHECK =

    I_STRUCTURE_NAME = 'mara'

    • IS_VARIANT =

    • I_SAVE =

    • I_DEFAULT = 'X'

    • IS_LAYOUT =

    • IS_PRINT =

    • IT_SPECIAL_GROUPS =

    • IT_TOOLBAR_EXCLUDING =

    • IT_HYPERLINK =

    • IT_ALV_GRAPHICS =

    • IT_EXCEPT_QINFO =

    CHANGING

    it_outtab = itab[]

    • IT_FIELDCATALOG =

    • IT_SORT =

    • IT_FILTER =

    • EXCEPTIONS

    • INVALID_PARAMETER_COMBINATION = 1

    • PROGRAM_ERROR = 2

    • TOO_MANY_LINES = 3

    • others = 4

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Hope it resolved your query...

    <b>Kindly reward points if it hepled you..</b>

    Thanks and Rewards

    Tanweer

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.