cancel
Showing results for 
Search instead for 
Did you mean: 

Nested Structure

Former Member
0 Kudos

I would like to know how to use nested structure in a ABAP program.

Thanks in Advance!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I do not understand if you want to create a nested Structure in the Txx se11 or if you want to implement and know how you have to write the code to gete the data of this stuctures.

if you need to get access to nested sctuctures you can do in that way:

DATA: it_mara like mara occurs 0 with header line.(Data declaration)

then in the code.

to get acess to the data of the field you can do:

it_mara.data --> that's the way to get reference about the field.

If you have also more nested fields or nested structure is with the same logic.

Please , let me know and i can reply for your issue.

Former Member
0 Kudos

Could u pls send any sample code to understand nested structure better?

Thanks!

Former Member
0 Kudos

Hi

pls give your mail-id, i shall send you the sample code.

best regards,

Thangesh

Former Member
0 Kudos

rohinisdocs@yahoo.com

Thanks !

Former Member
0 Kudos

rohinisdocs@yahoo.com

Thanks!

Former Member
0 Kudos

Hi

kindly check yur mail-id.

I have sent a sample code.

best regards,

Thangesh

Answers (1)

Answers (1)

Former Member
0 Kudos

A <b>nested structure</b> is a structure that contains one or more other structures as components.

Flat structures contain only elementary data types with a fixed length

(no internal tables, reference types, or strings).

The term deep structure can apply regardless of whether the structure is nested or not.

Nested structures are flat so long as none of the above types is contained in any nesting level.

Any structure that contains at least one internal table, reference type, or string as a component

(regardless of nesting) is a deep structure.

Accordingly, internal tables, references, and strings are also known as deep data types.

The technical difference between deep structures and all others is as follows:

When you create a deep structure, the system creates a pointer in memory that points to the

real field contents or other administrative information.

When you create a flat data type, the actual field contents are stored with the type in memory.

Since the field contents are not stored with the field descriptions in the case of deep structures,

assignments, offset and length specifications and other operations are handled differently from flat structures.

Kindly check the following link for more information on Nested structures:

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/frameset.htm

<b>Examples:</b>

DATA: BEGIN OF itab.
        include structure vbak.   
DATA: END OF itab.

DATA: BEGIN OF itab OCCURS 0,
        itab1 LIKE mara,
        itab2 LIKE vbak,
      END OF itab.

Kindly reward points if it helps!

best regards,

Thangesh