2007 Jun 04 2:12 PM
Hi
I am developing a new report (Customized one) with some additional fields for display by copying stadn WE05 code. I need to remove the Tree Dispaly on the left hand side.
Can some one help me on how to accomplish this?
Thanks a lot in advance
Ramesh
2007 Jun 04 2:59 PM
Hello Ramesh
The tree is created in routine INIT_TREE (screen '0100' -> module PBO -> routine INIT_TREE). At the end of the module PBO you will see the following coding (6.20):
if vh_tree is initial.
perform init_tree.
endif.
endif.
endmodule.[/code]
If vh_tree is initial then the program calls the routine in include RSEIDOC_F01 which we should not modify.
However, if you fill the reference variable vh_tree before the PBO module is called then the standard routine will not be passed. To achieve this I did the following:
(1) Copy report ZUS_RSEIDOC2 -> ZRSEIDOC2 without coping any include.
(2) Create vh_tree instance prior to calling screen '0100'
READ TABLE credat INDEX 1.
READ TABLE cretim INDEX 1.
PERFORM authority_check_rseidoc2_disp.
PERFORM select_edidc.
READ TABLE int_edidc INDEX 1.
IF sy-subrc EQ 0.
DESCRIBE TABLE int_edidc LINES number.
IF number GT 1. " eine Liste soll ausgegeben werden
i_edidc[] = int_edidc[].
PERFORM fill_alv_list.
gs_variant-report = sy-repid.
x_save = 'A'.
CREATE OBJECT vh_event.
PERFORM init_tree_dummy. " $ADDED$
CALL SCREEN 100.
ELSE.
...[/code]
(3) Create a new dummy screen '0200' (without any flow logic or screen elements)
(4) Copy routine INIT_TREE -> INIT_TREE_DUMMY and inactivate obsolete coding
Note that the docking container is linked to the new dummy screen '0200' and no longer to the main screen '0100' !!!
*
INIT_TREE_DUMMY *
*----
*
FORM init_tree_dummy.
DATA: hierarchy_header TYPE treev_hhdr.
DATA: events TYPE cntl_simple_events,
event TYPE cntl_simple_event.
DATA: node_table TYPE treev_ntab,
item_table TYPE item_table_type.
DATA: repid LIKE sy-repid,
dynnr LIKE sy-dynnr.
in i_edidc stehen alle selektierten IDocs
repid = sy-repid.
dynnr = sy-dynnr. " DELETED
dynnr = '0200'. "$ADDED$
int_node: direct, mestyp, status
create docking container - auf dem Dynpro ist kein Container mehr
CREATE OBJECT docking_control
EXPORTING repid = repid
dynnr = dynnr
side = docking_control->dock_at_left
extension = 255
extension = 245
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
hierarchy_header-heading = text-025. "IDoc-Anzeige
hierarchy_header-width = 31.
hierarchy_header-width = 32.
create a tree control
CREATE OBJECT vh_tree
EXPORTING
parent = docking_control
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = ' '
hierarchy_column_name = 'Spalte1'
hierarchy_header = hierarchy_header
EXCEPTIONS
cntl_system_error = 1
create_error = 2
failed = 3
illegal_node_selection_mode = 4
illegal_column_name = 5
lifetime_error = 6. "#EC NOTEXT
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
temporär - vielleicht hilft das weiter - hat weiter geholfen - so
*war
überhaupt etwas sichtbar
CALL METHOD vh_tree->set_alignment
EXPORTING
alignment = 15.
**
**
definieren der Ereignisse
event-eventid = cl_gui_column_tree=>eventid_selection_changed.
event-appl_event = 'X'. " process PAI if event occurs
APPEND event TO events.
**
registrieren lassen der Ereignisse, auf die ich reagieren will
CALL METHOD vh_tree->set_registered_events
EXPORTING
events = events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
assign event handlers
SET HANDLER vh_event->handle_selection_changed FOR vh_tree.
**
spalte hinzu fügen
CALL METHOD vh_tree->add_column
EXPORTING
name = 'Spalte2'
width = 10
header_text = 'Spalte2'
header_text = text-026 " Anzahl
EXCEPTIONS
column_exists = 1
illegal_column_name = 2
too_many_columns = 3
illegal_alignment = 4
different_column_types = 5
cntl_system_error = 6
failed = 7
predecessor_column_not_found = 8. "#EC
*NOTEXT
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
PERFORM fill_node_table USING node_table item_table.
**
CALL METHOD vh_tree->add_nodes_and_items
EXPORTING
node_table = node_table
item_table = item_table
item_table_structure_name = 'MTREEITM'
EXCEPTIONS
failed = 1
cntl_system_error = 3
error_in_tables = 4
dp_error = 5
table_structure_name_not_found = 6.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
CALL METHOD vh_tree->expand_node
EXPORTING
node_key = 'IDoc' "'EC NOTEXT
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
CALL METHOD vh_tree->expand_node
EXPORTING
node_key = 'OutIDoc' "'EC NOTEXT
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
CALL METHOD vh_tree->expand_node
EXPORTING
node_key = 'InbIDoc' "'EC NOTEXT
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "init_tree_dummy[/code]
Regards
Uwe
2007 Jun 04 2:59 PM
Hello Ramesh
The tree is created in routine INIT_TREE (screen '0100' -> module PBO -> routine INIT_TREE). At the end of the module PBO you will see the following coding (6.20):
if vh_tree is initial.
perform init_tree.
endif.
endif.
endmodule.[/code]
If vh_tree is initial then the program calls the routine in include RSEIDOC_F01 which we should not modify.
However, if you fill the reference variable vh_tree before the PBO module is called then the standard routine will not be passed. To achieve this I did the following:
(1) Copy report ZUS_RSEIDOC2 -> ZRSEIDOC2 without coping any include.
(2) Create vh_tree instance prior to calling screen '0100'
READ TABLE credat INDEX 1.
READ TABLE cretim INDEX 1.
PERFORM authority_check_rseidoc2_disp.
PERFORM select_edidc.
READ TABLE int_edidc INDEX 1.
IF sy-subrc EQ 0.
DESCRIBE TABLE int_edidc LINES number.
IF number GT 1. " eine Liste soll ausgegeben werden
i_edidc[] = int_edidc[].
PERFORM fill_alv_list.
gs_variant-report = sy-repid.
x_save = 'A'.
CREATE OBJECT vh_event.
PERFORM init_tree_dummy. " $ADDED$
CALL SCREEN 100.
ELSE.
...[/code]
(3) Create a new dummy screen '0200' (without any flow logic or screen elements)
(4) Copy routine INIT_TREE -> INIT_TREE_DUMMY and inactivate obsolete coding
Note that the docking container is linked to the new dummy screen '0200' and no longer to the main screen '0100' !!!
*
INIT_TREE_DUMMY *
*----
*
FORM init_tree_dummy.
DATA: hierarchy_header TYPE treev_hhdr.
DATA: events TYPE cntl_simple_events,
event TYPE cntl_simple_event.
DATA: node_table TYPE treev_ntab,
item_table TYPE item_table_type.
DATA: repid LIKE sy-repid,
dynnr LIKE sy-dynnr.
in i_edidc stehen alle selektierten IDocs
repid = sy-repid.
dynnr = sy-dynnr. " DELETED
dynnr = '0200'. "$ADDED$
int_node: direct, mestyp, status
create docking container - auf dem Dynpro ist kein Container mehr
CREATE OBJECT docking_control
EXPORTING repid = repid
dynnr = dynnr
side = docking_control->dock_at_left
extension = 255
extension = 245
EXCEPTIONS
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
hierarchy_header-heading = text-025. "IDoc-Anzeige
hierarchy_header-width = 31.
hierarchy_header-width = 32.
create a tree control
CREATE OBJECT vh_tree
EXPORTING
parent = docking_control
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = ' '
hierarchy_column_name = 'Spalte1'
hierarchy_header = hierarchy_header
EXCEPTIONS
cntl_system_error = 1
create_error = 2
failed = 3
illegal_node_selection_mode = 4
illegal_column_name = 5
lifetime_error = 6. "#EC NOTEXT
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
temporär - vielleicht hilft das weiter - hat weiter geholfen - so
*war
überhaupt etwas sichtbar
CALL METHOD vh_tree->set_alignment
EXPORTING
alignment = 15.
**
**
definieren der Ereignisse
event-eventid = cl_gui_column_tree=>eventid_selection_changed.
event-appl_event = 'X'. " process PAI if event occurs
APPEND event TO events.
**
registrieren lassen der Ereignisse, auf die ich reagieren will
CALL METHOD vh_tree->set_registered_events
EXPORTING
events = events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
assign event handlers
SET HANDLER vh_event->handle_selection_changed FOR vh_tree.
**
spalte hinzu fügen
CALL METHOD vh_tree->add_column
EXPORTING
name = 'Spalte2'
width = 10
header_text = 'Spalte2'
header_text = text-026 " Anzahl
EXCEPTIONS
column_exists = 1
illegal_column_name = 2
too_many_columns = 3
illegal_alignment = 4
different_column_types = 5
cntl_system_error = 6
failed = 7
predecessor_column_not_found = 8. "#EC
*NOTEXT
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
PERFORM fill_node_table USING node_table item_table.
**
CALL METHOD vh_tree->add_nodes_and_items
EXPORTING
node_table = node_table
item_table = item_table
item_table_structure_name = 'MTREEITM'
EXCEPTIONS
failed = 1
cntl_system_error = 3
error_in_tables = 4
dp_error = 5
table_structure_name_not_found = 6.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
CALL METHOD vh_tree->expand_node
EXPORTING
node_key = 'IDoc' "'EC NOTEXT
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
CALL METHOD vh_tree->expand_node
EXPORTING
node_key = 'OutIDoc' "'EC NOTEXT
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**
CALL METHOD vh_tree->expand_node
EXPORTING
node_key = 'InbIDoc' "'EC NOTEXT
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'A' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "init_tree_dummy[/code]
Regards
Uwe
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |