Skip to Content
Former Member
Mar 01, 2011 at 09:34 PM

How to define a generic structured type (deep structure) w/o LIKE



I have been trying to define a generic structured type that would include a component (field) of type "table type".

Look at my type [ty_compatibilite]. It is the structured type that needs to have a component called "mobile" which needs to be an internal table. I have tried to create a genereic table type called tt_mobile (based on ty_mobile) but that did not work. I have not been able to avoid using the LIKE command to make it work.

Any suggestions on how I could define my component "mobile" without using a "LIKE"... ?

Here is my code:

TYPES: BEGIN OF ty_mobile,
          ref_mob_sfr    TYPE zmobil,
          ref_mrq_sfr    TYPE zmarq,
          type_compat    TYPE zsea_comp_type,
       END OF ty_mobile.

TYPES: tt_mobile TYPE STANDARD TABLE OF ty_mobile.

DATA: lit_mobiles TYPE STANDARD TABLE OF ty_mobile.

TYPES : BEGIN OF ty_compatibilite,
          cod_ean        TYPE ean11,
          lib_art        TYPE maktx,
          compat_all_mrq TYPE zsea_comp_gen,
*          mobile        TYPE tt_mobile,
          mobile         LIKE lit_mobiles,
        END OF ty_compatibilite.

TYPES : tt_compatibilite   TYPE STANDARD TABLE OF ty_compatibilite.