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: 

dock container

Former Member
0 Kudos

what is dock container in a class?how to create it in a report.

3 REPLIES 3

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

We use docking container to place ALV grid.We do not need to drag and drop container in the screen.It will be created through coding.

We can also use custom container to hold ALV grid.In that,it needs to be placed in the screen thro' drag and drop.

We can create docking container in a report as follows.

data : o_docking type ref to cl_gui_docking_container.

Then go to pattern in ABAP Editor.

Select ABAP object patterns radio button.

Then click Create object radio button.

Instance : o->docking

Objecttypename :CL_GUI_docking_container

Then you will get

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.

Fill the necessary parameters.

Kindly reward points by clicking the star on the left of reply,if it helps.

0 Kudos

hi, plz check the following code.wht i have to give in the exporting parameter parent in the below dock container o_docking?and to display the values of this sample internal table?urgent plz.thanx in advance

code:

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.

0 Kudos

Hi,

Nothing is required for parent parameter.

DATA:pav1 TYPE REF TO cl_gui_alv_grid.

data : o_docking type ref to cl_gui_docking_container.

<b>data itab type standard table of mara.

*If you are not giving standard table,you should pass the user defined structure in SE11.

</b>PARAMETERS: s_matnr LIKE mara-matnr.

SELECT * FROM mara INTO TABLE

itab WHERE matnr = s_matnr.

call screen 9000.

class lcl_event_receiver definition.

public section.

methods:

endclass.

class lcl_event_receiver implementation.

endclass.

module STATUS_9000 output.

  • Creating docking container

CREATE OBJECT o_docking

EXPORTING

RATIO = '95'.

  • Creating grid

create object pav1 exporting i_parent = o_docking.

  • Placing the ALV output table in the grid

CALL METHOD pav1->set_table_for_first_display

EXPORTING

I_STRUCTURE_NAME = 'MARA'

  • MARA should be in uppercase

CHANGING

it_outtab = itab.

endmodule. " STATUS_9000 OUTPUT

module USER_COMMAND_9000 input.

endmodule. " USER_COMMAND_9000 INPUT

PS:Just copy and paste the program and double click 9000 in the line call screen 9000.Ceate a screen by giving description.In the flow logic of the screen,uncomment PBO and PAI module.Activate flow logic,screen and program.Then execute the program.

Kindly reward points by clikcing the star on the left of reply,if you found it useful.Hope this solves your problem.