‎2008 Apr 18 9:33 AM
How to move one structure to other in unicode enabled program.
‎2008 Apr 18 9:46 AM
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
‎2008 Apr 18 9:40 AM
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
‎2008 Apr 18 9:41 AM
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.
‎2008 Apr 18 9:41 AM
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.
‎2008 Apr 18 9:44 AM
Hi,
Check the following link:
http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/frameset.htm
Regards,
Bhaskar
‎2008 Apr 18 9:46 AM
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