Skip to Content
author's profile photo Former Member
Former Member

Nested structure

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 01:37 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 03, 2006 at 01:38 PM

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

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 01:39 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 01:42 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.