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

Nested structure

Former Member
0 Likes
508

Can any one of you clarify this:

TYPES: BEGIN OF STRUCT1.

COLI TYPE I,

BEGIN OF STRUCT OF STRUCT2,

COL1 TYPE I,

COL2 TYPE I,

END OF STRUCT 2,

END OF STRUCT1.

TYPES MYTYPE TYPE STRUCT1-STRUCT2-COL2.

Please clarify why the last TYPES statement is used and how it works?

5 REPLIES 5
Read only

Former Member
0 Likes
465

hi,

the second types statement is used to define your own object type( which refers to <b>col2</b> field of the <b>struct2</b> which is defined in <b>struct1</b>).

.

Regards

Ashok P

Message was edited by: Ashok Parupalli

Read only

0 Likes
465

hi vamshi,

That type statement is for defining as many structures as you want of the same type declared above...

Regards,

Santosh

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
465

In this case you are defining MYTYPE like the COL2 field of the STRUCT2 which is defined in STRUCT1.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
465

Hi Vamsi,

Strange declaration in my opinion :).

I think the last statement only declare a type MYTYPE that is only a type I (the type of STRUCT1-STRUCT2-COL2)

Regards,

Sylvain

Read only

Former Member
0 Likes
465

hi,

TYPES MYTYPE TYPE STRUCT1-STRUCT2-COL2.

or

TYPES MYTYPE TYPE i.

both are same.

here you are defining one data type MYTYPE OF type Integer.

first one is defining using with the existing datatype STRUCT1

and the second is directly defining with basic datatype I

regards

srikanth