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 a structure in a TYPES declaration

Former Member
0 Kudos

Hii

I have a structure BISEG

i need to declare an internal tabel with that structure BISEG + some additional fields

i did like below please advise if this correct


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


DATA:
   itat TYPE standard tabel of ty_itab

note i don't want to use header line

1 ACCEPTED SOLUTION

Former Member

Hi check this,

TYPES: begin of  ty_itab.
                     INCLUDE STRUCTURE BISEG.
         TYPES: xxxx type xxx,
                     xxxx type xxx,
                     End of  ty_itab.
 
 
DATA:
   itab TYPE standard table of ty_itab.

Regards

9 REPLIES 9

Former Member
0 Kudos

hi,

TYPES: BEGIN OF ty_record.

INCLUDE STRUCTURE pa0008.

TYPES: v_pernr TYPE pa0008-pernr,

v_begda(10),

v_endda(10).

TYPES: END OF ty_record.

Use like this .

Regards,

Arjun.

I355602
Advisor
Advisor
0 Kudos

Hello newbie82 c,

Use:-


DATA : begin of itab. "without header line
          INCLUDE STRUCTURE BISEG. "creates the same structure as of BISEG
DATA : xxxx type xxx, "other fields
       xxxx type xxx,
       end of itab.

This will create an internal table without header line.

Use 'OCCURS 0' after 'begin of itab' if you want to create an internal table with header line.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Former Member

Hi check this,

TYPES: begin of  ty_itab.
                     INCLUDE STRUCTURE BISEG.
         TYPES: xxxx type xxx,
                     xxxx type xxx,
                     End of  ty_itab.
 
 
DATA:
   itab TYPE standard table of ty_itab.

Regards

TYPES: begin of  ty_itab.
       INCLUDE TYPE BISEG.           
TYPES: ABC type ABC,
       End of  ty_itab.
 
 
DATA:

matt
Active Contributor

As siddharthpurohit51087 indicates, the "Best Answer" here is obsolete. INCLUDE TYPE is now preferred.

Former Member
0 Kudos

Hi,

The code is correct, it will create the table without header line.

But I will suggest a small modification

TYPES: begin of ty_itab,

include type BISEG,

XXX TYPE xxx,

End of ty_itab.

DATA:

itat TYPE standard table of ty_itab.

With best regards,

Navneet Chaubey

Edited by: Navneet Chaubey on Dec 18, 2008 5:28 AM

Former Member
0 Kudos

Hi,

try this

create a temp structure with ur additional fields...

types : begin of t_temp,

xxxx type xxx,

xxxx type xxx,

end of t_temp.

then,

TYPES : begin of types ty_itab.

include type BISEG.

include type t_temp.

TYPES : End of types ty_itab.

DATA : itat TYPE standard tabel of ty_itab,

wa like line of itat.

regards,

Mr.A

Former Member
0 Kudos

Hi,

your question is resolved

please close the thread

Thnks

Sahil

Former Member
0 Kudos

Hello All:

Can I reopen this q, I searched but couldn't find a confirmative answer.

Instead of creating a type as below

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.