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

Include structure in TYPES declaration

Former Member
140,044

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
Read only

Former Member
59,132

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

6 REPLIES 6
Read only

ThomasZloch
Active Contributor
59,132

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

Read only

Former Member
59,133

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

Read only

uwe_schieferstein
Active Contributor
59,132

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

Read only

0 Likes
59,132

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.

Read only

kpdtox
Newcomer
0 Likes
47,361

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. 

 

Read only

David_mT
Explorer
30,444

The right syntax is 

    TYPESBEGIN OF tt_hpath_custo,
             zrate TYPE zsd_satis-zrate.   "WITH a POINT
             INCLUDE TYPE vbpavb.
    TYPESEND OF tt_hpath_custo.