2006 Aug 30 1:59 PM
Hi there,
I have an hex variable that I want to move to a Char variable.
DATA: x_var(255) type X,
c_var(255).
MOVE x_var to c_var.
I normally used the command MOVE, but my application needs to be unicode compliant and I receive a warning saying that those "variables are not mutually convertible in a Unicode program".
I have tried the STPU1_HEX_TO_CHAR but it expects a C type variable as input so it does not work
Actually, my c_var variable is the header of a table I have declared as RAW, in case it may give some additional hints
Thanks for your support
2006 Aug 30 2:03 PM
Use the fms:
NLS_STRING_CONVERT_TO_SYS( Hex to char)
and NLS_STRING_CONVERT_FROM_SYS (char to hex)
Hi there,
I have an hex variable that I want to move to a Char variable.
DATA: x_var(255) type X,
c_var(255).
MOVE x_var to c_var.
I normally used the command MOVE, but my application needs to be unicode compliant and I receive a warning saying that those "variables are not mutually convertible in a Unicode program".
I have tried the STPU1_HEX_TO_CHAR but it expects a C type variable as input so it does not work
Actually, my c_var variable is the header of a table I have declared as RAW, in case it may give some additional hints
Thanks for your support
2006 Aug 30 2:02 PM
2006 Aug 30 2:03 PM
Use the fms:
NLS_STRING_CONVERT_TO_SYS( Hex to char)
and NLS_STRING_CONVERT_FROM_SYS (char to hex)
2006 Aug 30 2:35 PM
Thanks for that incredibly quick answer.
That is the function I was looking for
2008 Jan 14 2:52 PM
Hello,
the convertion is ok. But i have a problem.
There is after every converted place a '-symbol:
from:
003100300030004C0041004E004700480020002000200020002000200020000000000032007100350030007800300030005F005100350030005F003000300020
to:
#1#0#0#L#A#N#G#H# # # # # # # ####2#q#5#0#x#0#0#_#Q#5#0#_#0#0#
Is there any possibility, that the string '00' ca be deleted or that '0031' will be declared as a string? not only two places?
Thanx a lot
2007 Oct 18 10:17 AM
Hi,
It depends on how you use the type X variable in your Program.
The FM mentioned by RAVI are perfect.
But before using them you need to take two variables of type STRING and XSTRING and proceed because the specifed FM do not accept field types of X and C as parameters.
Example: DATA: x_var1 type xstring,
c_var1 type string.
x_var1 = x_var.
call function module pass x_var1 and store result in c_var1.
c_var = c_var1.
Thanks.
Hope this helps you.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |