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 structures

Former Member
0 Likes
837

Hi , I want to define a new TYPE as :

Begin og ty_data.

Include strcuture x,

include strcuture y,

include structyre z,

end of ty_data.

now MANDT is defined in all three dcitionary structures x,y nd z,so it gives error.How can I overcome this,since I need to consider all fields from these three 3 stuctures which counts to arnd 300 fields nd maually hard coding those is not possible.

any way to sole this.

1 ACCEPTED SOLUTION
Read only

vinod_gunaware2
Active Contributor
0 Likes
764

Hi

Use in this way

TYPES: BEGIN OF person,

geschlecht(1) TYPE X.

INCLUDE TYPE name AS pname.

TYPES: alter TYPE I,

gewicht TYPE P,

END OF person.

regards

vinod

5 REPLIES 5
Read only

Former Member
0 Likes
764

HI Rajesh,

copy two of these structures in SE11 to some new structure and delete the MANDT field from those two..

activate it and use those two structures..

regards

satesh

Read only

Former Member
0 Likes
764

Hi,

You can define your internal table like.

DATA: BEGIN OF itab OCCURS 0,
        f1 LIKE struct1,
        f2 LIKE struct2,
        f3 LIKE struct3,
      END OF itab.

This would remove your problem. But you must refer your variables like...

itab-f1-var1

itab-f2-var1

etc...

Regards,

Wenceslaus.

Read only

Former Member
0 Likes
764

Hi rajesh,

1. Simple

2. use like this

DATA : BEGIN OF itab OCCURS 0,

t001 LIKE t001,

mara LIKE mara,

END OF itab.

3. then use fields like this.

itab-t001-mandt

itab-mara-mandt

regards,

amit m.

Read only

hymavathi_oruganti
Active Contributor
0 Likes
764

i think what wenseslaus g suggested is nice

or u can use like this

DATA BEGIN OF ITAB.

INCLUDE STRUCTURE1 AS STRUCT1 RENAMING WITH SUFFIX _STRUCT

INCLUDE STRUCTURE2 AS STRUCT2 RENAMING WITH SUFFIX_STRUCT2 .

INCLUDE STRUCTURE3 AS STRUCT3 RENAMING WITH SUFFIX _STRUCT3.

...

DATA END OF ITAB

Message was edited by: Hymavathi Oruganti

Read only

vinod_gunaware2
Active Contributor
0 Likes
765

Hi

Use in this way

TYPES: BEGIN OF person,

geschlecht(1) TYPE X.

INCLUDE TYPE name AS pname.

TYPES: alter TYPE I,

gewicht TYPE P,

END OF person.

regards

vinod