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

Deep Structure

Former Member
0 Likes
521

Hi All,

I want to store Header data and item details in the internal table and in deep structure.

Can you please give me an example code for deep structure.

How to append values in deep structure.

Ashok...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
492

structures containing internal tables as components or

Internal table containing Structure as components are called Deep Internal table.

Please check this link for reading a deep structure.

Example:

TYPES: BEGIN OF TYPE_DEEP,

MATNR TYPE MATNR,

T_MARC TYPE MARC OCCURS 0,

END OF TYPE_DEEP.

DATA: T_DEEP TYPE STANDARD TABLE OF TYPE_DEEP.

DATA: WA_DEEP TYPE TYPE_DEEP.

DATA: T_MARC TYPE TABLE OF MARC.

DATA: S_MARC TYPE MARC.

Populating data.

WA_DEEP-MATNR = 'TEST'.

S_MARC-MATNR = 'TEST'.

S_MARC-WERKS = '9090'.

APPEND S_MARC TO T_MARC.

Append second level internal table.

WA_DEEP-T_MARC] = T_MARC[.

Append.

APPEND WA_DEEP TO T_DEEP.

Process the internal table.

LOOP AT T_DEEP INTO WA_DEEP.

WRITE: / WA_DEEP-MATNR.

PROCESS the second level internal table.

LOOP AT WA_DEEP-T_MARC INTO S_MARC.

WRITE: S_MARC-WERKS.

ENDLOOP.

ENDLOOP.

See the information of Structure in the below link also...

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm

Hope it will solve your problem..

3 REPLIES 3
Read only

Former Member
0 Likes
493

structures containing internal tables as components or

Internal table containing Structure as components are called Deep Internal table.

Please check this link for reading a deep structure.

Example:

TYPES: BEGIN OF TYPE_DEEP,

MATNR TYPE MATNR,

T_MARC TYPE MARC OCCURS 0,

END OF TYPE_DEEP.

DATA: T_DEEP TYPE STANDARD TABLE OF TYPE_DEEP.

DATA: WA_DEEP TYPE TYPE_DEEP.

DATA: T_MARC TYPE TABLE OF MARC.

DATA: S_MARC TYPE MARC.

Populating data.

WA_DEEP-MATNR = 'TEST'.

S_MARC-MATNR = 'TEST'.

S_MARC-WERKS = '9090'.

APPEND S_MARC TO T_MARC.

Append second level internal table.

WA_DEEP-T_MARC] = T_MARC[.

Append.

APPEND WA_DEEP TO T_DEEP.

Process the internal table.

LOOP AT T_DEEP INTO WA_DEEP.

WRITE: / WA_DEEP-MATNR.

PROCESS the second level internal table.

LOOP AT WA_DEEP-T_MARC INTO S_MARC.

WRITE: S_MARC-WERKS.

ENDLOOP.

ENDLOOP.

See the information of Structure in the below link also...

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm

Hope it will solve your problem..

Read only

Former Member
0 Likes
492

You will get more information on this from the site,

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm

Jayant Sahu.