cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with GET_DEFINITION for Tree GUIBB

marcin_cholewczuk
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

marcin_cholewczuk
Active Contributor
0 Kudos

Ok, I had to add at least one new column without specified column_type.

former_member187651
Active Participant
0 Kudos

Hello Marcin,

I got the requirement to to display the tree within table with multilevel. I had tried to implement code give in below link, but it seems not to work with multilevel of Parent and child. Means we can only find the level at run time.

http://wiki.sdn.sap.com/wiki/display/profile/2007/09/11/Integration+of+Tree+Structure+in+a+Table+usi...

As I can see you have implemented the tree with multilevel by using Tree GUIBB.

Will you explain the steps you have performed to do so.

Its urgent.

Thanks.

Answers (0)