Skip to Content
0
Sep 27, 2012 at 12:19 PM

Problem with GET_DEFINITION for Tree GUIBB

22 Views

Hi all,

I'm testing this functionality and I'm doing something wrong in mentioned method, but I don't know what. As a result on configuration page of tree component I'm getting info 'The table does not contain any data' after pressing '+Column' button.

I've tried to find any example in internet, without success. I would appreciate any help (working example or pointing out error in my code)

Dictionary structure:

PARENT_ID NUMC 5 ROW_ID NUMC 5 TEXT CHAR 40 EXPANDED CHAR 1 IS_LEAF CHAR 1 CHILD_LOADED CHAR 1 IMAGE_SRC CHAR 40

Code:

method IF_FPM_GUIBB_TREE~GET_DEFINITION.
DATA: lt_component_tab TYPE abap_component_tab,
ls_component_tab LIKE LINE OF lt_component_tab,
ls_field_description TYPE FPMGB_S_TREEFIELD_DESCR,
lo_structdescr TYPE REF TO cl_abap_structdescr.

lo_structdescr ?= cl_abap_typedescr=>describe_by_name( 'ZFPM_GUIBB_STRUCTUR' ).
eo_field_catalog = cl_abap_tabledescr=>create( lo_structdescr ).

lt_component_tab = lo_structdescr->get_components( ).

ls_field_description-visibility = cl_wd_uielement=>e_visible-visible.
ls_field_description-read_only = abap_false.

LOOP AT lt_component_tab INTO ls_component_tab.
ls_field_description-name = ls_component_tab-name.

CASE ls_component_tab-name.
WHEN 'PARENT_ID'.
ls_field_description-column_type = '01'.
ls_field_description-text = 'PARENT_ID'.

WHEN 'ROW_ID'.
ls_field_description-column_type = '02'.
ls_field_description-text = 'ROW_ID'.

WHEN 'TEXT'.
ls_field_description-column_type = '03'.
ls_field_description-text = 'TEXT'.

WHEN 'EXPANDED'.
ls_field_description-column_type = '04'.
ls_field_description-text = 'EXPANDED'.

WHEN 'IS_LEAF'.
ls_field_description-column_type = '05'.
ls_field_description-text = 'IS_LEAF'.

WHEN 'CHILD_LOADED'.
ls_field_description-column_type = '06'.
ls_field_description-text = 'CHILD_LOADED'.

WHEN 'IMAGE_SRC'.
ls_field_description-column_type = '07'.
ls_field_description-text = 'IMAGE_SRC'.
ENDCASE.
APPEND ls_field_description TO et_field_description.
ENDLOOP.
endmethod.

Best Regards

Marcin Choleczuk