‎2010 Jan 19 8:03 AM
Hi All,
We are upgrading system from non-unicode to unicode.
While passing a string to a structure ( MOVE RECEIVERS-RECEIVER TO RECEIVER_OBJECT, where
RECEIVERS_RECEIVER = string
RECEIVER_OBJECT = structure )
following error is thrown :
"RECEIVER_OBJECT" and "RECEIVERS-RECEIVER" are not mutually convertible in a unicode program.
To resolve this error, I've used :
CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C
EXPORTING
IM_VALUE = RECEIVERS-RECEIVER
IMPORTING
EX_CONTAINER = RECEIVER_OBJECT
EXCEPTIONS
ILLEGAL_PARAMETER_TYPE = 1
others = 2
But I observed the problem of inccorect values for numeric fields. For example suppose the string contains the value 'abc1234' and we use CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C to transfer this string to a structure suppose, S1 with 2 fields namely field1(3) type c and field2 type i. then field1 gets the correct value i.e. 'abc' but field2 gets incorrect value and not '1234'. Can anyone provide the resolution? Prompt reply will be highly appreciated.
Thanks.
‎2010 Jan 20 7:53 AM
hi
Instead of directly passing a string in container use character type object of same length as structure and then fill your structure with the container you have used , it will solve yoour issue.
thanks
sunny
‎2010 Jan 20 8:15 AM
There is no error in this method. The 'problem' is caused by the fact that you are combining character type and Type I in your parameter which has generic type CSEQEUNCE.
It is advised that you 'copy' your data component by component in Unicode.