‎2008 May 13 2:55 PM
hi guys,
I would like to create a type including an internal table whithin.
The type declaration might be something like :
BEGIN OF ty_trad,
key TYPE textpool-key,
line TYPE TABLE OF i,
lg TYPE i,
val_fr TYPE string,
val_cs TYPE string,
END OF ty_trad.
This syntax causes a compilation error. I know this is possible in other languages and i would be surprised it is not in ABAP... Is it ?
Thanks a lot !
--Yohann
‎2008 May 13 3:12 PM
You just have to use the full syntax for describing the table:
TYPES: BEGIN OF ty_trad,
key TYPE textpool-key,
line TYPE STANDARD TABLE OF i WITH NON-UNIQUE KEY table_line,
lg TYPE i,
val_fr TYPE string,
val_cs TYPE string,
END OF ty_trad.matt
‎2008 May 13 3:02 PM
Hello,
Yes, it's possible to do this in ABAP, too.
Try this:
TY_LINE TYPE TABLE OF I,
BEGIN OF ty_trad,
key TYPE textpool-key,
line TYPE TY_LINE
lg TYPE i,
val_fr TYPE string,
val_cs TYPE string,
END OF ty_trad.
Regards,
‎2008 May 13 3:12 PM
Hi,
the syntax you gave me generate the following compilation error :
"TY_LINE" is a generic type. A type reference is possible only for field symbols and formal parameters . . . . . . . . . ."
Regards,
--Yohann
Edited by: Yohann Camp on May 13, 2008 4:12 PM
‎2008 May 13 3:12 PM
You just have to use the full syntax for describing the table:
TYPES: BEGIN OF ty_trad,
key TYPE textpool-key,
line TYPE STANDARD TABLE OF i WITH NON-UNIQUE KEY table_line,
lg TYPE i,
val_fr TYPE string,
val_cs TYPE string,
END OF ty_trad.matt
‎2008 May 13 3:20 PM
Hi Yohann,
try this....
DATA:TY_LINE TYPE TABLE OF I.
TYPES:BEGIN OF ty_trad,
key TYPE textpool-key,
line LIKE TY_LINE,
lg TYPE i,
val_fr TYPE string,
val_cs TYPE string,
END OF ty_trad.
Reward if useful.
Thanks & Regards,
Khan.