Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

movedate between tables

Former Member
0 Likes
549

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 .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
517

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.

3 REPLIES 3
Read only

Sm1tje
Active Contributor
0 Likes
517

use MOVE-CORRESPONDING.

Read only

Former Member
0 Likes
518

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.

Read only

Former Member
0 Likes
517

use

move-corresponding itab2 to itab1.