hI
structures containing internal tables as components or
Internal table containing Structure as components are called Deep Internal table.
A nested structure 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.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm
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.
Hi
DATA: <TABLE> TYPE SHP_SERNR_UPDATE_T,
<WORK AREA> TYPE SHP_SERNR_UPDATE_S.
So you can read the table by LOOP or READ TABLE statament
LOOP AT <TABLE> INTO <WOR AREA>.
ENDLOOP.
READ TABLE <TABLE> INTO <WORK AREA>.
If there's a table in the structure, you need to declare a new work area like that table:
DATA: <WORK AREA 2> TYPE ............ LOOP AT <TABLE> INTO <WOR AREA>. LOOP AT <WORK AREA>-ITAB INTO <WORK AREA 2>. ENDLOOP. ENDLOOP.
Max
Add a comment