Declare Types using a custom table
I am creating a new structure in my program in ABAP Editor. The fields of this table will be all the fields in a custom table plus an additional field which is not a part of this table. The table has some 150 fields so I need to include it in my structure. I am using it in this way but its giving error:
TYPES: BEGIN OF t_struct,
INCLUDE TYPE zcustom_table,
zzfield TYPE c,
END OF t_struct.
This structure is getting created but giving an error when I am creating a table of this type as:
DATA : i_tab TYPE STANDARD TABLE OF t_struct WITH HEADER LINE.
Please suggest me how can get rid if this error.
Eric Cartman replied
you have to code like this:
TYPES: BEGIN OF t_struct. INCLUDE STRUCTURE zcustom_table. TYPES : zzfield TYPE c, END OF t_struct. work area: DATA : gw_struct TYPE t_struct. internal table: DATA : gt_struct TYPE STANDARD TABLE of t_struct.
hope this helps