Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Declare Types using a custom table

Hi,

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.

Thanks,

Abhishek

Former Member
replied

hi,

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

ec

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question