Skip to Content
0
Former Member
Feb 19, 2014 at 04:43 AM

ALV tree in docking container

124 Views

i am trying to call a docking container (on hotspot click of ALV.-> Reuse_alv_grid_display).

And a alv tree is to be displayed in docking container.

I have wrote the entire code and there is no error is thrown by the system, but docking container displayed.

I am posting entire code .Please let me know where i am mistaken.

check r_ucomm eq '&IC1'."when user double click on any cell of ALV.

CASE rs_selfield-SEL_TAB_FIELD.

WHEN 'I_MKPF-WERKS'.

perform create_dock.

perform create_alv_tree.

* WHEN .

* WHEN OTHERS.

ENDCASE.

FORM CREATE_DOCK ."docking container is created

check obj1 is initial.

CREATE OBJECT OBJ1

EXPORTING

* PARENT =

REPID = sy-repid

DYNNR = sy-dynnr

SIDE = obj1->DOCK_AT_bottom

EXTENSION = 500

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.

ENDFORM.

FORM CREATE_ALV_TREE . "alv Tree

create object tree

exporting

parent = obj1

node_selection_mode = cl_gui_column_tree=>node_sel_mode_single

item_selection = 'X'

no_html_header = 'X'

no_toolbar = ''

exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

illegal_node_selection_mode = 5

failed = 6

illegal_column_name = 7.

if sy-subrc <> 0.

message x208(00) with 'ERROR'. "#EC NOTEXT

endif.

data l_hierarchy_header type treev_hhdr.

perform build_hierarchy_header changing l_hierarchy_header.

IF gt_fieldcatalog[] is initial.

perform buildfield_cat using 'TRNTYP' 'TRNTYP' .

perform buildfield_cat using 'EXDAT' 'Excise Doc' .

perform buildfield_cat using 'WERKS' 'Excise Doc' .

perform buildfield_cat using 'EXNUM' 'Excise Doc' .

perform buildfield_cat using 'EXYEAR' 'Excise Doc' .

perform buildfield_cat using 'MATNR' 'Excise Doc' .

perform buildfield_cat using 'RITEM1' 'Excise Doc' .

perform buildfield_cat using 'RITEM2' 'Excise Doc' .

perform buildfield_cat using 'MAKTX' 'Excise Doc' .

perform buildfield_cat using 'REMOVAL' 'Excise Doc' .

perform buildfield_cat using 'MEINS' 'Excise Doc' .

perform buildfield_cat using 'EXBAS' 'Excise Doc' .

perform buildfield_cat using 'EXBED' 'Excise Doc' .

endif.

call method tree->set_table_for_first_display

EXPORTING

* i_structure_name = 'SFLIGHT'

is_hierarchy_header = l_hierarchy_header

CHANGING

it_outtab = t_J_1IEXCDTL[] "table must be empty !

it_fieldcatalog = gt_fieldcatalog.

perform create_hierarchy.

call method tree->frontend_update.

FORM CREATE_HIERARCHY .

sort IJ_1IEXCDTL by chapid matnr.

LOOP AT IJ_1IEXCDTL into WJ_1IEXCDTL.

on change of WJ_1IEXCDTL-chapid.

perform add_carrid_line using WJ_1IEXCDTL

''

changing l_carrid_key.

endon.

on change of WJ_1IEXCDTL-matnr.

perform add_complete_line using WJ_1IEXCDTL"last complete line.

l_carrid_key

changing l_last_key.

endon.

ENDLOOP.

endform.

form add_carrid_line using WJ_1IEXCDTL1 type J_1IEXCDTL

p_relat_key type lvc_nkey

changing p_node_key type lvc_nkey.

data: l_node_text type lvc_value.

l_node_text = WJ_1IEXCDTL1-chapid.

call method tree->add_node

EXPORTING

i_relat_node_key = p_relat_key

i_relationship = cl_gui_column_tree=>relat_last_child

i_node_text = l_node_text

is_outtab_line = WJ_1IEXCDTL

IMPORTING

e_new_node_key = p_node_key.

endform. "add_carrid_line

form add_complete_line using WJ_1IEXCDTL2 type J_1IEXCDTL

p_relat_key type lvc_nkey

changing p_node_key type lvc_nkey.

data: l_node_text type lvc_value.

write WJ_1IEXCDTL2-matnr to l_node_text .

call method tree->add_node

EXPORTING

i_relat_node_key = p_relat_key

i_relationship = cl_gui_column_tree=>relat_last_child

is_outtab_line = WJ_1IEXCDTL2

i_node_text = l_node_text

IMPORTING

e_new_node_key = p_node_key.

endform. "add_complete_line