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

Problem with creating a Type

Former Member
0 Likes
378

Hi ABAP Experts,

I have a DDIC Strucutue ZSTRU_1 which has the fields as follows.

C0 TYPE C.

C1 TYPE INT4.

Now in a report i want to declare a TYPE which should have the fields of ZSTRU_1 and some extra fields. So my Type should ideally look as follows.

TYPES: BEGIN OF ZSTRU_2,

C0 TYPE C,

C1 TYPE INT4,

C2 TYPE C,

C3 TYPE C,

END OF ZSTRU_2.

So is there any way to include the structure ZSTRU_1 in

ZSTRU_2 programatically.

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
363

Hi,

You can define it like -

TYPES : BEGIN OF ZSTRU_2.

INCLUDE STRUCTURE ZSTRU_1.

TYPES: C2 TYPE C,

C3 TYPE C.

TYPES: END OF ZSTRU_2.

Hope this will help you,

Regards

Amit

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
364

Hi,

You can define it like -

TYPES : BEGIN OF ZSTRU_2.

INCLUDE STRUCTURE ZSTRU_1.

TYPES: C2 TYPE C,

C3 TYPE C.

TYPES: END OF ZSTRU_2.

Hope this will help you,

Regards

Amit

Read only

Former Member
0 Likes
363

Hi Vinayaka,

1. Use this kind of syntax.

Instead of T001, use ZSTRU_1.

DATA : BEGIN OF zstru_2.

INCLUDE STRUCTURE t001.

DATA : f1 TYPE c,

f2 TYPE c,

END OF zstru_2.

Regards,

Amit M.

Read only

Former Member
0 Likes
363

types : BEGIN OF zstru_2.

INCLUDE STRUCTURE zstru_1.

DATA : C0 TYPE C,

C1 TYPE INT4,

C2 TYPE C,

C3 TYPE C,

END OF zstru_2.