Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table type in type

Former Member
0 Likes
559

Hello all,

Newbie here, this may sound a little to easy:

I need to define a type which contains filed of type table,

I tryed like this:

<i>

begin of ty_feature,

fname(30) type c,

fvalue(30) type c,

end of ty_feature,

ty_features type table of ty_feature,

begin of ty_xmlmat,

matnr type mara-matnr,

maktx type makt-maktx,

classnum(16) type c,

color(4) type c,

<b> features type ty_features,</b>

end of ty_xmlmat.

</i>

The error i get :

<b>"TY_FEATURES" is a generic type. A type reference is possible only for field symbols and FORM parameters.

</b>

Please tell how to define this kind type.

Lots of thanks,

Bogdan

Sorry for my miserable english

5 REPLIES 5
Read only

Former Member
0 Likes
539

Hi

Try this

types : begin of ty_feature,

fname(30) type c,

fvalue(30) type c,

end of ty_feature.

types : ty_features type table of ty_feature.

data :begin of ty_xmlmat,

matnr type mara-matnr,

maktx type makt-maktx,

classnum(16) type c,

color(4) type c,

features type ty_features,

end of ty_xmlmat.

Cheers

Read only

0 Likes
539

Hi Sinha,

thanks for fast answer,

ty_xmlmat must be a type not a data element

Bogdan

Read only

Former Member
0 Likes
539

You don't have to write ty_features type table of ty_feature anymore...

you just have to declare this:

<b>features type ty_feature</b>

Read only

0 Likes
539

Hi Chan

features must be declared as table of ty_feature

thank you

Bogdan

Read only

0 Likes
539

instead of
 ty_features type table of ty_feature,
try
 ty_feature type standard table 
            of ty_feature with default key.

Christian