10-05-2015 7:41 AM
Hello,
I want to add some editable checkbox-items to a cl_gui_column_tree-object.
When I set the editable flag of the item (type MTREEITM) a MESSAGE_TYPE_X dump (Control Framework : Error processing control) is created.
When I do not set the editable flag everything works fine, with the exception of a not editable checkbox.
I compared my coding with demo programm SAPCOLUMN_TREE_CONTROL_DEMO but could not find any significant difference.
Also demo programm SAPCOLUMN_TREE_CONTROL_DEMO is running fine on my client.
This is the relevant part of my coding:
DATA:
gr_container TYPE REF TO cl_gui_custom_container,
gr_tree TYPE REF TO cl_gui_column_tree,
gr_event_rec TYPE REF TO lcl_event_receiver
.
...
CREATE OBJECT gr_container
EXPORTING
container_name = 'DATA_AREA'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc <> 0.
MESSAGE a000(tree_control_msg).
ENDIF.
CREATE OBJECT gr_tree
EXPORTING
parent = gr_container
node_selection_mode = cl_gui_column_tree=>node_sel_mode_single
item_selection = abap_true
hierarchy_header = ls_hierhead
hierarchy_column_name = gc_col_hierarchy
EXCEPTIONS
cntl_system_error = 1
create_error = 2
failed = 3
illegal_node_selection_mode = 4
illegal_column_name = 5
lifetime_error = 6.
IF NOT sy-subrc IS INITIAL.
MESSAGE a000(tree_control_msg).
ENDIF.
...
CALL METHOD gr_tree->add_column
EXPORTING
name = gc_col_kms
width = 11
alignment = cl_gui_column_tree=>align_right
header_text = text-tck
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.
IF NOT sy-subrc IS INITIAL.
MESSAGE a000(tree_control_msg).
ENDIF.
...
DATA:
lt_nodes TYPE treev_ntab,
lt_items TYPE srmitemtab, " linetype is MTREEITM
ls_node LIKE LINE OF lt_nodes,
ls_item LIKE LINE OF lt_items,
.
...
ls_node-relatkey = lv_last_nplnr_node.
lv_node_key = lv_node_key + 1.
ls_node-node_key = lv_node_key.
ls_node-isfolder = abap_false.
ls_node-n_image = icon_material.
ls_node-exp_image = icon_material.
APPEND ls_node TO lt_nodes.
...
CLEAR ls_item-text.
ls_item-class = cl_gui_column_tree=>item_class_checkbox.
ls_item-node_key = ls_node-node_key.
ls_item-item_name = gc_col_kms.
ls_item-editable = 'X'.
APPEND ls_item TO lt_items.
...
CALL METHOD gr_tree->add_nodes_and_items
EXPORTING
node_table = lt_nodes
item_table = lt_items
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 <> 0.
MESSAGE a000(tree_control_msg).
ENDIF.
When I comment out line "ls_item-editable = 'X'." the cl_gui_column_tree-Object is shown and no Dumps occurs.
Message was edited by: Hubert Heitzer
10-14-2015 1:30 PM
Hi, Hubert.
Did you try to clear the whole ls_item before you add checkbox element? Maybe there is some conflict with previous parameters?
10-14-2015 1:30 PM
Hi, Hubert.
Did you try to clear the whole ls_item before you add checkbox element? Maybe there is some conflict with previous parameters?
10-20-2015 2:23 PM
Yes Evgeniy, u are right.
I did not clean the LS_ITEM-EDITABLE flag.
So adding an editable cl_gui_column_tree=>item_class_text lead to the dump.