‎2009 Oct 01 4:44 AM
Hi All,
I am getting unicode error while we are upgrading from 4.6 to ECC 6. 0 in below statement.
data: a(100).
b is a deep structure that has all data type field like C,N,D.
Move a to b..
Thanks
Mohit
‎2009 Oct 01 7:02 AM
‎2009 Oct 01 7:07 AM
Use field symbols.
Field-Symobol <fs> type c.
assign a to <fs> casting.
Move <fs> to b.
Edited by: vijetasap on Oct 1, 2009 8:09 AM
‎2009 Oct 01 7:21 AM
Hi,
have to move field wise then there won't be any error.
in unicode programs inorder to move data directly we should have both the source and target system to be of same structure then only it will work.
Regards,
Nagaraj
‎2009 Oct 01 7:13 AM
You will now have to move the data field by field like this:
b-field1 = a+0(10).
b-field2 = a+10(5).
etc.
‎2009 Oct 01 7:21 AM
Hi Mohit,
Try this way.
Thanks
Venkat.O
MOVE-CORRESPONDING a to b.
‎2009 Oct 01 7:24 AM
>
> Hi Mohit,
> Try this way.
>
> MOVE-CORRESPONDING a to b.
>
> Venkat.O
venkat, this wont work as a is not a structure.
‎2009 Oct 01 7:31 AM
Hi,
Sorry for that .
He can try this way.
Thanks
Venkat.O
REPORT ztest_program.
DATA a(100).
DATA:BEGIN OF b,
a(100),
str1 TYPE string,
num1 TYPE num,
mara TYPE TABLE OF mara,
END OF b.
a = 'Venkat'.
MOVE a to b-a.
WRITE: b-a.
Edited by: Venkat.O on Oct 1, 2009 2:36 AM
‎2009 Oct 01 7:37 AM
>
> >
> > Hi Mohit,
> > Try this way.
> >
> > MOVE-CORRESPONDING a to b.
> >
> > Venkat.O
> venkat, this wont work as a is not a structure.
Then give a a structure....
Or move substrings.
‎2009 Oct 01 7:38 AM
‎2009 Oct 01 7:42 AM
At the time when opening this issued there was only 1 reply. So what are you complaining for?
‎2009 Oct 01 8:19 AM
‎2009 Oct 01 8:28 AM
‎2009 Oct 01 8:37 AM
‎2009 Oct 01 8:42 AM
maybe the following helps:
CALL METHOD cl_abap_container_utilities=>read_container_c
EXPORTING
im_container = a
IMPORTING
ex_value = b.
‎2009 Oct 01 8:58 AM
Hi
I believe u need to transfer the data from A to a structure splitting the string of A and moving field by field, something like this:
DATA: A(100).
DATA: MY_STRUCT TYPE REF TO CL_ABAP_STRUCTDESCR.
data: v_len type i,
v_offset type i.
DATA: BEGIN OF B,
B1(10),
B2 TYPE I,
B3(5),
END OF B.
DATA: W TYPE ABAP_COMPDESCR.
FIELD-SYMBOLS <fs> type any.
a(10) = 'Bye Bye'.
a+10(4) = '10'.
a+14(5) = 'OK'.
MY_STRUCT ?= CL_ABAP_STRUCTDESCR=>DESCRIBE_BY_DATA( B ).
LOOP AT MY_STRUCT->COMPONENTS INTO W.
v_len = w-length.
if w-type_kind = 'C'.
v_len = v_len / CL_ABAP_CHAR_UTILITIES=>CHARSIZE.
endif.
ASSIGN COMPONENT w-name of STRUCTURE b to <fs>.
move a+v_offset(v_len) to <fs>.
v_offset = v_offset + v_len.
ENDLOOP.
write: b-b1, / b-b2, / b-b3.
‎2009 Oct 01 7:22 AM
assign a to the field of b. dont assign directly.
b-f1 = a. or
b-f1 =a+0(10).
b-f2 = a+11(15). etc
by the way, have you enabled unicode check in the program attributes?
‎2009 Oct 01 8:18 AM
Hi,
I don't know in which field's of target structure i have to move source field.so i am not able to move one by one from source to target.
Thanks
Mohit
Edited by: Mohit khandelwal on Oct 1, 2009 9:25 AM
‎2009 Oct 01 8:41 AM
I don't know in which field's of target structure i have to move source field.so i am not able to move one by one from source to target
You did move the data field A to B previous to upgrade, right? So you should know where to move the source data into target field.
For example:
b has 3 fields.
b1 = 10 char.
b2 = 3 char.
b3 = 1 char.
So the first 13 characters of A were moved to the first 3 fields of B. And that's exactly what you have to do know, field by field.
If it has to be a bit more dynamic, you should determine all the fields of structure B at run time, and per field determine the offset and length that has to be move from A to B.
‎2009 Oct 01 8:55 AM
Hi ,
Development in 4.6 was done by some other vendor and also this is not documented anywhere that which field's of target structure get populated from source.
Thanks
Mohit
‎2009 Oct 01 9:29 AM
>
> Hi ,
> Development in 4.6 was done by some other vendor and also this is not documented anywhere that which field's of target structure get populated from source.
> Mohit
Mohit,
jsut double click on B, it will take you to the declaration. check the fields defined under it
‎2009 Oct 01 9:25 AM
Hi.
Use
CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C( exporting im_container = a
importing ex_value = b ).
‎2009 Oct 22 8:31 AM
you can use the function module..
CALL FUNCTION 'PI_BP_MOVE_UNICODE'
EXPORTING
iv_move_from = <sourse structure>
CHANGING
cv_move_to = <tab>.
else you can also use this code.
filed-symbols : <tab1> type c.
assign <tab2> to <tab1> casting.
This should work for you.. if this too does not work then take offset and pass the data.