‎2016 Oct 04 1:36 PM
Hi Gurus,
I am running a function module, where the program is not running replace command,
it simply passes through the line of code but does not replace the value.
replace all occurrences of '#' in ex_w_budg_doc_in-orc-km with '0'.
Can you help me.
Thanks.
‎2016 Oct 04 1:50 PM
Are you sure there is a "#" in your value?
The character "#" is also used as a replacement character for non printable characters (like LINEFEED, TABSTOP, etc.).
Where are you looking at your value? Debugger text view? What you see there might not be equal to what is actually there, because you cannot see non printable characters. Instead of them you see the character "#".
‎2016 Oct 04 2:10 PM
Hi Andre,
the program executes and ends with dump. In debug mode
the value displayed is the character '#' but it seems that
the hexadecimal value is another.
‎2016 Oct 04 2:19 PM
Hi
Where are your string from?
I mean you need to investigate about your source in order to understand what # really is, you can find main (not printable) chararter in class CL_ABAP_CHAR_UTILITIES
Max
‎2016 Oct 04 2:39 PM
And as I call the class within the program, moving ex_w_budg_doc_in-orc-km ?
I tried to model but failed.
Can you show me?
Thanks !
‎2016 Oct 04 2:53 PM
Just check what UTF-16 character your hexadecimal value refers to.
‎2016 Oct 04 2:59 PM
Hi Andre,
I can identify with the condition IF NOT CO '0123456789',
but I can not replace the special character with '0'.
‎2016 Oct 04 3:15 PM
If you have a Unicode System, you can do the following.
You can look at the hexadecimal value in debugger.
Take the hexadecimal value of your non printable character from there.
With this value you look at the unicode table (use Google for it). And you will get the exact character that this hex value represents.
Please not that your system codepage is always UTF-16 but has a specific byte order (BE or LE) depending on your plattform.
So maybe you have to swap the bytes before looking into the unicode table.