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 comment
10|10000 characters needed characters exceeded

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 comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi vamshi,

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

      Regards,

      Santosh

  • 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 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 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 comment
    10|10000 characters needed characters exceeded