‎2008 Jun 04 8:38 AM
Hi,
i have 2 tables (itab1,itab2 same almost same structures ) and i wont to move the data from
itab1 to itab2 but in itab2 i miss one Colman (i don't need this Colman data) there is a way to move it except move for every field and append .
‎2008 Jun 04 8:57 AM
Hi
Move: transfer the data from a structure to another one in according to the length of original structure;
Move-corresponding: transfer the data from a structure to another one in according to the name of the fields, so in your case:
data: begin of t_cash, "cash transactions
D1(08), "Post Date
D2(40), "Employee Name
D3(40), "Employee Vendor Id
end of t_cash.
data: begin of t_card, "card transactions
D1(08), "Post Date
D2(40), "Employee Name
D4(25), "Merchant Name
end of t_card.
If you use MOVE, u shoudl consider T_CARD is shorter than T_CASH: the last field D4 is long 25 CHAR, but the last field D3 is long 40 char. So u'll loose the last 15 digit of T_CASH
MOVE T_CASH TO T_CARD.
is like
T_CARD = T_CASH(73).
If you use MOVE-CORRESPONDING, u'll transfer only the information of the field D1 and D2:
MOVE-CORRESPONDING T_CASH TO T_CARD.
is like
T_CARD-D1 = T_CASH-D1.
T_CARD-D2 = T_CASH-D2.
Now the problem is ECC 6.00 is unicode release, so the statament MOVE-CORRESPONDING can't be used if the original and destination variable have a different structure.
‎2008 Jun 04 8:50 AM
‎2008 Jun 04 8:57 AM
Hi
Move: transfer the data from a structure to another one in according to the length of original structure;
Move-corresponding: transfer the data from a structure to another one in according to the name of the fields, so in your case:
data: begin of t_cash, "cash transactions
D1(08), "Post Date
D2(40), "Employee Name
D3(40), "Employee Vendor Id
end of t_cash.
data: begin of t_card, "card transactions
D1(08), "Post Date
D2(40), "Employee Name
D4(25), "Merchant Name
end of t_card.
If you use MOVE, u shoudl consider T_CARD is shorter than T_CASH: the last field D4 is long 25 CHAR, but the last field D3 is long 40 char. So u'll loose the last 15 digit of T_CASH
MOVE T_CASH TO T_CARD.
is like
T_CARD = T_CASH(73).
If you use MOVE-CORRESPONDING, u'll transfer only the information of the field D1 and D2:
MOVE-CORRESPONDING T_CASH TO T_CARD.
is like
T_CARD-D1 = T_CASH-D1.
T_CARD-D2 = T_CASH-D2.
Now the problem is ECC 6.00 is unicode release, so the statament MOVE-CORRESPONDING can't be used if the original and destination variable have a different structure.
‎2008 Jun 04 9:07 AM