‎2008 Apr 25 12:23 PM
Hi,
My requirement is like that i declare one internal table like:
TYPES: BEGIN OF wa_mathead,
matkl TYPE matkl, "Material Group
mvgr1 TYPE mvgr1, "Material Class
matnr TYPE matnr, "Material
end of wa_mathead.
now i want to declare another internal table say itab with some new fields and including wa_mathead structure.
how can i do that.
Amit.
‎2008 Apr 25 12:33 PM
INCLUDE STRUCTURE is not valid in all contexts and should be avoided.
Simply use the type you've defined in the definition of your table:
TYPES: BEGIN OF wa_mathead,
matkl TYPE matkl, "Material Group
mvgr1 TYPE mvgr1, "Material Class
matnr TYPE matnr, "Material
end of wa_mathead.
TYPES: BEGIN OF itab_rec_type,
hdr TYPE wa_mathead,
f1 TYPE blah,
....You'll have to acess the header data of a record of your itab as wa-hdr-matkl.
matt
‎2008 Apr 25 12:25 PM
Hi Jony,
TYPES: BEGIN OF wa_mathead,
matkl TYPE matkl, "Material Group
mvgr1 TYPE mvgr1, "Material Class
matnr TYPE matnr, "Material
end of wa_mathead.
TYPES: BEGIN OF wa_mat1,
additional fields,
*INCLUDE TYPE wa_mathead.*
end of wa_mat1.Regards,
Sunil
‎2008 Apr 25 12:26 PM
HI
Its written as
data: begin of itab occurs 0.
include structure <name>.
field1,
field2,
-
end of itab.
Aditya
‎2008 Apr 25 12:28 PM
Hi,
Refer this link
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/insert_i.htm
Please reward points if useful.
Edited by: nilanjana sinha on Apr 25, 2008 1:30 PM
‎2008 Apr 25 12:28 PM
hi,
do this way ...
TYPES: BEGIN OF new_tab,
matnr_new type matnr.
include structure wa_mathead.
TYPES: end of new_tab.
‎2008 Apr 25 12:28 PM
Probably a little closer to this example.
DATA:
BEGIN OF wk_0500_scr_rec.
INCLUDE STRUCTURE zlmfoll.
DATA:
cont_ty_2 LIKE zlmfoll-cont_ty,
END OF wk_0500_scr_rec.
‎2008 Apr 25 12:33 PM
INCLUDE STRUCTURE is not valid in all contexts and should be avoided.
Simply use the type you've defined in the definition of your table:
TYPES: BEGIN OF wa_mathead,
matkl TYPE matkl, "Material Group
mvgr1 TYPE mvgr1, "Material Class
matnr TYPE matnr, "Material
end of wa_mathead.
TYPES: BEGIN OF itab_rec_type,
hdr TYPE wa_mathead,
f1 TYPE blah,
....You'll have to acess the header data of a record of your itab as wa-hdr-matkl.
matt