Application Development 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: 

Include structure in TYPES declaration

Former Member
93,847

Hello All:

Many forum posts have discussed similar topics, but I couldn't exactly find one answering my requirement. Apologies if I have missed out reading some.

Instead of creating a type as below (as suggested in few forum posts)

TYPES begin of types ty_itab
                     include type BISEG
                     xxxx type xxx
                     xxxx type xxx
            End of types ty_itab

I need to create the type with include structure after the additonal fields.

TYPES begin of types ty_itab
                     <fld1> type <ty1>
                     <fld2> type <ty2>
                     include type <struc>
            End of types ty_itab

Can someone give the right syntax?

Please help,

Fred.

1 ACCEPTED SOLUTION

Former Member
12,935

As I remember is this way.


TYPES: begin of types ty_itab,
                     <fld1> type <ty1>,
                     <fld2> type <ty2>.
                     include type <struc>.
TYPES:            End of types ty_itab

5 REPLIES 5

ThomasZloch
Active Contributor
12,935

Try

TYPES: begin of ty_itab,
                      <fld1> type <ty1>,
                      <fld2> type <ty2>.
                      include structure <struc>.   (or: include type <struc_type>.)
TYPES: End of ty_itab.

Thomas

Former Member
12,936

As I remember is this way.


TYPES: begin of types ty_itab,
                     <fld1> type <ty1>,
                     <fld2> type <ty2>.
                     include type <struc>.
TYPES:            End of types ty_itab

uwe_schieferstein
Active Contributor
12,935

Hello Fred

If you are using the extended syntax you should not encounter any problems:


TYPES: begin of types ty_itab.
TYPES:                     <fld1> type <ty1>.
TYPES:                     <fld2> type <ty2>.
                     include type <struc>.
TYPES: End of types ty_itab

Regards

Uwe

0 Kudos
12,935

Thank you Thomas, Ramiro, Uwe for your great help. Any one of your suggestions could be used for my requirement.

Fred.

Nb: Did not intend to be partial with selective 'solved' and 'helpful answer'; that was the best way I could.

kpdtox
Discoverer
0 Kudos
1,164

What worked for me:

 

TYPES: BEGIN OF TY_MAIN.   
  INCLUDE STRUCTURE SFLIGHT.  
TYPES : CARRNAME TYPE SCARR-CARRNAME,  
    COUNTRYFR TYPE SPFLI-COUNTRYFR,  
    COUNTRYTO TYPE SPFLI-COUNTRYTO,  
END OF TY_MAIN.