‎2008 Jul 11 7:34 AM
Hello gurus,
I've isolated my problem in the following simple coding:
REPORT zzz_as27361_conversiontest.
TYPES: BEGIN OF t1,
material TYPE matnr,
plant TYPE werks_d,
valid_from TYPE ck_abdat,
valid_to TYPE ck_bidat,
total_amt TYPE total_amt_head,
curr TYPE currency,
END OF t1.
DATA: z TYPE t1,
s TYPE string.
s = z.On syntax check I get the following error:
"S" and "Z" are not mutually convertible in Unicode systems, since you are trying to convert a structure to a field or vice versa.
Can someone tell me how I can move the value of a (flat) structure into a string in an unicode-enabled system?
Thanks in advance,
Alej
PS: Points will be rewarded for helpful answers!
‎2008 Jul 11 7:46 AM
Hi,
Try doing this way ...
TYPES: BEGIN OF t1,
material TYPE matnr,
plant TYPE werks_d,
valid_from TYPE ck_abdat,
valid_to TYPE ck_bidat,
total_amt TYPE total_amt_head,
curr TYPE currency,
END OF t1.
DATA: z TYPE t1,
s TYPE string,
x(30) type c.
write: z-total_amt to x.
concatenate z-material z-plant z-valid_from z-valid_to x z-curr into s .
Thanks.
Edited by: Cnu on Jul 11, 2008 12:16 PM
‎2008 Jul 11 7:44 AM
hi,
goto attributes and uncheck the "unicode checks active"
may be your problem will solve.
regards,
jagadeesh.
‎2008 Jul 11 7:44 AM
hi,
that does not work by Unicode. You can do something like this:
CONCATENATE z-material z-plant ... INTO s.
hope this helps
ec
‎2008 Jul 11 7:46 AM
Hi,
Try doing this way ...
TYPES: BEGIN OF t1,
material TYPE matnr,
plant TYPE werks_d,
valid_from TYPE ck_abdat,
valid_to TYPE ck_bidat,
total_amt TYPE total_amt_head,
curr TYPE currency,
END OF t1.
DATA: z TYPE t1,
s TYPE string,
x(30) type c.
write: z-total_amt to x.
concatenate z-material z-plant z-valid_from z-valid_to x z-curr into s .
Thanks.
Edited by: Cnu on Jul 11, 2008 12:16 PM
‎2008 Jul 11 8:45 AM
Hello Jagadeesh,
I asked for an answer in a unicode-enabled system. It's not a very smart solution to simply disable the unicode-checks...
Hello Eric and Cnu,
your approach helped me a lot and in the end this is how I solved it.
Best regards,
Alej
‎2008 Jul 11 8:54 AM
Hello Alej
The correct approach would be to use the static method CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C for moving contents of a structured variable into a string.
Regards
Uwe