‎2011 Sep 27 2:39 AM
Hi All,
I wanted to replace '#' in my string.
So I have written "REPLACE ALL OCCURRENCES OF '#' IN
c_data WITH ' ".
For some of the records, # is getting replaced but for some of the records # is not getting replaced.
Could you please help me on this.
Edited by: 001krishna on Sep 27, 2011 3:40 AM
‎2011 Sep 27 4:04 AM
Hi,
Try with TRANSLATE statement. Just click on F1 on the translate statement.
TRANSLATE c_data USING '#'''. " are you replacing # with single quote(')?
Thanks & Regards
Bala Krishna
‎2011 Sep 27 5:26 AM
Hi,
Try Using REPLACE ALL OCCURRENCES OF REGEX '#*' IN c_data WITH '' '
OR
REPLACE ALL OCCURRENCES OF Substring '#*' IN c_data WITH '' '.
This shud help.
Regds,
AS
Edited by: abheesawant on Sep 27, 2011 6:26 AM
‎2011 Sep 27 5:41 AM
Hi krishna,
please note that SAP will show # for every character that can not be printed, i.e. control characters as tabs and line feeds are displayed as #.
Check in debugger, switch to hex display to see what you try to replace. You may replace CL_ABAP_CHAR_UTILITIES=>horizontal_tab or other attributes of CL_ABAP_CHAR_UTILITIES.
Regards
Clemens
‎2011 Sep 27 5:43 AM
Hi Kishna, the REPLACE command will only replace 'real' characters with ASCII code '23'. Next to these 'real' charecters there might be some non diplayable characters in c_data whose ASCII code is not displayable. These will also be displyed as #. You can check it in the debugger by changing to hex mode. What is the ASCII code of the # characters that are not getting replaced ?
Regards Jack