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

unicode error

0 Likes
715

How to move one structure to other in unicode enabled program.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
682

hi,

here is the sample code to move data between structures.

data: begin of STRUC1,

F0(1) type x,

F1(10) type c,

F2(20) type c,

F3 type i,

F4 type p,

end of STRUC1,

begin of STRUC2,

C0(1) type c,

C1(10) type c,

C2(20) type c,

C3 type i,

C4 type f,

end of STRUC2,

begin of STRUC3,

G0(1) type c,

G1(10) type c,

G2(20) type c,

end of STRUC3.

STRUC11(35) = STRUC21(35). <---- Unicode error !!

STRUC3 = STRUC2.

INCLUDE STRUCTURE does not work here:

types: begin of PART1,

F1(10) type c,

F2(20) type c,

F3 type i,

end of PART1,

begin of PART2,

C1(10) type c,

C2(20) type c,

C3 type i,

end of PART2.

data: begin of STRUC1,

F0(1) type x.

include type PART1 as PART.

data: F4 type p,

end of struc1.

data: begin of STRUC2,

C0(1) type c.

include type PART2 as PART.

data: C4 type f,

end of STRUC2,

begin of STRUC3,

G0(1) type c,

G1(10) type c,

G2(20) type c,

end of STRUC3.

STRUC1-PART = STRUC2-PART.

STRUC3 = STRUC2. <---- new Unicode error !!

Due to the insertion of include PART2 in STRUC2, there is a

new alignment gap between STRUC2-C0 and STRUC2-C1

After Unicode enabling:

Please use MOVE-CORRESPONDING if the fieldnames do match,

otherwise move single fields

data: begin of STRUC1,

F0(1) type x,

F1(10) type c,

F2(20) type c,

F3 type i,

F4 type p,

end of STRUC1,

begin of STRUC2,

C0(1) type c,

C1(10) type c,

C2(20) type c,

C3 type i,

C4 type f,

end of STRUC2,

begin of STRUC3,

G0(1) type c,

G1(10) type c,

G2(20) type c,

end of STRUC3.

STRUC1-F1 = STRUC2-C1.

STRUC1-F2 = STRUC2-C2.

STRUC1-F3 = STRUC2-C3.

STRUC3 = STRUC2.

reward if useful

5 REPLIES 5
Read only

Former Member
0 Likes
682

Hi,

we should use move-corresponding or move it field by field if the structure are not compatible.Else, u can directly use MOVE statements.

Regards,

Ramya

Read only

Former Member
0 Likes
682

Hi,

you can transport it on the same way the in normal system over STMS or other transport tool.

You need to change the attributes to UNICODE CHECK after transport.

That should be all.

Read only

Former Member
0 Likes
682

Hi

If both the strucrures are same, you can do as follows

DATA: WA_MARA TYPE MARA,

WA_MARA1 TYPE MARA.

MOVE WA_MARA TO WA_MARA1.

Please award points.

Read only

Former Member
0 Likes
682
Read only

Former Member
0 Likes
683

hi,

here is the sample code to move data between structures.

data: begin of STRUC1,

F0(1) type x,

F1(10) type c,

F2(20) type c,

F3 type i,

F4 type p,

end of STRUC1,

begin of STRUC2,

C0(1) type c,

C1(10) type c,

C2(20) type c,

C3 type i,

C4 type f,

end of STRUC2,

begin of STRUC3,

G0(1) type c,

G1(10) type c,

G2(20) type c,

end of STRUC3.

STRUC11(35) = STRUC21(35). <---- Unicode error !!

STRUC3 = STRUC2.

INCLUDE STRUCTURE does not work here:

types: begin of PART1,

F1(10) type c,

F2(20) type c,

F3 type i,

end of PART1,

begin of PART2,

C1(10) type c,

C2(20) type c,

C3 type i,

end of PART2.

data: begin of STRUC1,

F0(1) type x.

include type PART1 as PART.

data: F4 type p,

end of struc1.

data: begin of STRUC2,

C0(1) type c.

include type PART2 as PART.

data: C4 type f,

end of STRUC2,

begin of STRUC3,

G0(1) type c,

G1(10) type c,

G2(20) type c,

end of STRUC3.

STRUC1-PART = STRUC2-PART.

STRUC3 = STRUC2. <---- new Unicode error !!

Due to the insertion of include PART2 in STRUC2, there is a

new alignment gap between STRUC2-C0 and STRUC2-C1

After Unicode enabling:

Please use MOVE-CORRESPONDING if the fieldnames do match,

otherwise move single fields

data: begin of STRUC1,

F0(1) type x,

F1(10) type c,

F2(20) type c,

F3 type i,

F4 type p,

end of STRUC1,

begin of STRUC2,

C0(1) type c,

C1(10) type c,

C2(20) type c,

C3 type i,

C4 type f,

end of STRUC2,

begin of STRUC3,

G0(1) type c,

G1(10) type c,

G2(20) type c,

end of STRUC3.

STRUC1-F1 = STRUC2-C1.

STRUC1-F2 = STRUC2-C2.

STRUC1-F3 = STRUC2-C3.

STRUC3 = STRUC2.

reward if useful