‎2007 Jul 11 11:47 AM
Hi all,
i have two internal tables.
one table have Mandt key extra comparing to other internal table.
and both have remaining all the fields same.
Now i want to insert all the fields from the internal table which dont have mandt key to another internal table which have mandt key.
i dont want to use loop.
how can i insert the fields.???
Regards,
CSR.
‎2007 Jul 12 3:42 AM
Example let say your internal tables has following structure:
ITAB1.
FLD01
FLD02
FLD03
ITAB2.
FLD01
FLD02
FLD03
EXTRA_FIELD. "This should be the last field in your internal table.
"in both internal table all identical fields(name, type) fields
"should be in the same order and position.
Moving one table contents to another.
ITAB2[] = ITAB1[].
Your contents will be copied as desired by you.
Regards,
A.Singh
‎2007 Jul 11 12:26 PM
see the below code which is inserting data from work area to internal table .
DATA: BEGIN OF connection,
cityfrom TYPE spfli-cityfrom,
cityto TYPE spfli-cityto,
distid TYPE spfli-distid,
distance TYPE spfli-distance,
END OF connection.
DATA connection_tab LIKE SORTED TABLE OF connection
WITH UNIQUE KEY cityfrom cityto
distid distance.
SELECT cityfrom cityto distid distance
FROM spfli
INTO connection.
INSERT connection INTO TABLE connection_tab.
ENDSELECT. reward points if it is usefull....
Girish
‎2007 Jul 12 3:42 AM
Example let say your internal tables has following structure:
ITAB1.
FLD01
FLD02
FLD03
ITAB2.
FLD01
FLD02
FLD03
EXTRA_FIELD. "This should be the last field in your internal table.
"in both internal table all identical fields(name, type) fields
"should be in the same order and position.
Moving one table contents to another.
ITAB2[] = ITAB1[].
Your contents will be copied as desired by you.
Regards,
A.Singh
‎2007 Jul 12 4:04 AM
Hi,
Try this. The mandt field should be listed atlast in the internal table.
data : begin of ty1 occurs 0,
b ,
mandt(3) ,
end of ty1.
data : begin of ty2 occurs 0,
b ,
end of ty2.
ty2-b = 'B'.
append ty2.
ty2-b = 'C'.
append ty2.
ty1[] = ty2[].
ty1-a = '300'.
modify ty1 transporting a where not b is initial.
loop at ty1.
write : / ty1.
endloop.
‎2007 Jul 12 5:22 AM
‎2011 Jul 06 11:11 AM