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 Internal table

Former Member
0 Likes
5,974

Hi friends,

First i would like to thank u all for ur wonderful contributions...

can i know wat is deep Internal table and provide me some eg for retriving data from deep IT ?

thanks in advance....

Regards..

balaji

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,227

Hi,

Check this 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.

Thanks,

Naren

7 REPLIES 7
Read only

Former Member
0 Likes
3,227

Hi

Please check this link for reading a deep structure.

Hope this will help you.

Reward AllHelpfull Answers......

Read only

Former Member
0 Likes
3,228

Hi,

Check this 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.

Thanks,

Naren

Read only

Former Member
0 Likes
3,227

HI,

structures containing internal tables as components or

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

Regards

Sudheer

Read only

0 Likes
2,156

awesome!

Read only

Former Member
0 Likes
3,227

Hi

There is no concept like Deep Internal table

May be you are talking of internal table with Nested Loops inside an Internal table.

We should avoid such nested loops as they consume lot of time

LOOP at itab.

.......................

loop at itab1.

...........................

loop at itab2.

............................

endloop.

endloop.

endloop.

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
3,227

Hi Balaji ,

Deep internal tables are basically internal tables where the each record of the internal table has a feild which is it self an internal table.

An example will be the internal tables which we use when we want to assign color to columns of an ALV based on some criteria , here in the internal table we have a feild of type LVC_T_SCOL , which itself is an internal table.

For more info please see the link

http://help.sap.com/saphelp_nw04/helpdata/en/7f/e477e5fba211d2b48f006094192fe3/frameset.htm

Hope this helps.

Regards

Arun

  • Assign points if reply is helpful

Read only

Former Member
0 Likes
3,227

hi balaji,

deep internal tables means a internal table without header line is nested in another internal table. this process is called nesting of internal tables n tables are caleed deep internal table.

ex:

loop at itab into wa1. [ where itab1 and itab2 are tables with out header lines n wa1 n wa2 are explicit work areas ]

read table itab2 into wa2.

write:/20 wa2-'fldname'

..........

............

endloop.

if helpful reward some points.

with regards,

suresh.