‎2010 Jul 30 3:01 AM
Hi Guys.. G'Day..
I define a deep structure in DDIC.
The structure is ZLCHAR
KEY
TEXT
CHARACTERISTICS TYPE ZCHAR
|_ ZKEY
|_ ZTEXT
I UNABLE TO POPULATE CHARACTERISTICS STRUCTURE.
HERE IS MY CODE.
DATA: LT_ZCHAR TYPE ZCHAR OCCURS 0 WITH HEADER LINE.
LT_ZLCHAR TYPE ZLCHAR,
WA_ZCHAR TYPE ZCHAR.
LT_ZCHAR-ZKEY = '12346'.
LT_ZCHAR-ZTEXT = 'NO'.
APPEND LLT_ZCHAR.
LT_ZCHAR-ZKEY = '735737'.
LT_ZCHAR-ZTEXT = 'UNIDENTIFIED'.
APPEND LT_ZCHAR.
LT_ZCHAR-ZKEY = '3563463'.
LT_ZCHAR-ZTEXT = 'YES'.
APPEND LT_ZCHAR.
WA_ZCHAR-KEY = '12345'.
WA_ZCHAR-TEXT = 'IF FLAVOURED OR ADDED INGREDIENT'.
WA_ZCHAR-CHARACTERISTICS = LT_ZCHAR.
APPEND WA_ZCHAR TO LT_ZLCHAR.
Even if I try WA_ZCHAR-CHARACTERISTICS [ ] = LT_ZCHAR[ ]
Getting incompatible syntax error.
Any ideas ?
‎2010 Jul 30 4:17 AM
Hello ,
Have you included the structure or you are have structure as a field ?
Coz if you have included it using .include you will have to access its field directly and if
you have Used it as predefined type you will have to Access it in a different way,
Plz do tell what error you are getting ?
Hope this helps
‎2010 Jul 30 4:45 AM
Hi Anup,
I use the structure as a field.
The error is LT_ZCHAR can not be converted to the type of WA_ZCHAR when I use the following statement.
WA_ZCHAR-CHARACTERISTICS [ ] = LT_ZCHAR[ ]
otherwise just the just the header value of LT_ZCHAR is stored in the LT_ZLCHAR.
Cheers
Sam
‎2010 Jul 30 5:07 AM
My be then you have mismatched ..the data type you have used..!
Please check in the types..!
‎2010 Jul 30 5:46 AM
types: begin of ZCHAR,
KEY type I,
TEXT type STRING,
end of ZCHAR.
data: WA_ZCHAR type ZCHAR.
types: begin of ZLCHAR,
L_ZKEY type I,
L_ZTEXT type STRING,
L_ZCHAR type ZCHAR,
end of ZLCHAR.
data: IT_ZLCHAR type standard table of ZLCHAR,
WA_ZLCHAR type ZLCHAR.
WA_ZCHAR-KEY = '1'.
WA_ZCHAR-TEXT = 'no1'.
WA_ZLCHAR-L_ZKEY = '11'.
WA_ZLCHAR-L_ZTEXT = 'no11'.
WA_ZLCHAR-L_ZCHAR = WA_ZCHAR.
append WA_ZLCHAR to IT_ZLCHAR.
loop at IT_ZLCHAR into WA_ZLCHAR.
write : WA_ZLCHAR-L_ZKEY, WA_ZLCHAR-L_ZTEXT, WA_ZLCHAR-L_ZCHAR-KEY, WA_ZLCHAR-L_ZCHAR-TEXT.
endloop.
Edited by: madhuri sonawane on Jul 30, 2010 10:17 AM
‎2010 Aug 02 8:31 AM
Thanks Guys.. its actually an issue in defining the structure in DDIC. The deep structure should be a table type.