‎2007 Jan 17 9:04 AM
Hi all,
I was trying to use the table type which i have created in se11. but when i tried to use it, it is giving me error as
"z_kna1 must be a flat structure, you cannot use internnal tables, strings, references, or structures as components"
can you please explain this
‎2007 Jan 17 9:22 AM
Hi Ranjith,
<b>Flatstructures contain only elementary data types of fixed length (no internal tables, reference types, or strings).</b> The term flat structure can apply regardless of whether the structure is nested or not. Nested structures are flat so long as none of the specified 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 known accordingly as a deep structure.
Only in the case of flat structures is the data content of the structure actually within the memory of the structure itself, while deep structures contain pointers to the data at the position of the deepest components. 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.
Check whether u r maintaining this
‎2007 Jan 17 9:24 AM
‎2007 Jan 17 9:39 AM
hi,
I created a table type with structure KNA1.I presume you are using the same structure. following is a executable code
DATA:z_kna TYPE ztt,
wa LIKE LINE OF z_kna.
SELECT * FROM kna1 INTO TABLE z_kna UP TO 5 ROWS.
CHECK sy-subrc = 0.
LOOP AT z_kna INTO wa.
WRITE wa-kunnr.
ENDLOOP.
Also check if your Table type structure contains any of internnal tables, strings, references, or structures.
Regards,
Sourabh.
‎2007 Jan 17 9:43 AM
Hi Ranjith,
I guess you wrote the following code:
DATA var1 LIKE Z_kna1.
Instead of using 'LIKE' please change it with 'TYPE', the code will be like this:
DATA var1 TYPE Z_kna1.
Regards,
Hendy