cancel
Showing results for 
Search instead for 
Did you mean: 

Junk Character while using REPLACE ALL OCCURRENCES OF (Spell Check)

Former Member
0 Kudos

Hi All,

I am passing one table_string to PDF from form spell check functionality.

Which contains

a

test is being done

now after the spell check complete i got this data back as

a#test is being done#

where # is the new line character.

now the point is the hexa_decimal value of this string which is

61000A00740065007300740020006900730020006200650069006E006700200064006F006E0065000A00

Where 0A00 is the Hexadecimal valur for #.

but in actual its hexadecimal value is 2300

and now whenever i use REPLACE ALL OCCURRENCES OF '#' in the above string, sy-subrc is 4(which means the substring to be replaced is not found).

i also tried as below

DATA: c_hex(2) TYPE x VALUE '0A00'.

DATA: lv_tmp(1) TYPE c.

TRY.

CALL METHOD cl_abap_conv_in_ce=>uccp

EXPORTING

uccp = c_hex

RECEIVING

char = lv_tmp.

CATCH cx_sy_conversion_codepage.

CATCH cx_parameter_invalid_type.

CATCH cx_sy_codepage_converter_init.

ENDTRY.

REPLACE ALL OCCURRENCES OF lv_tmp IN lv_cnmat WITH '^'.

But again its not working

plz help.

Thanks & Regards,

Arvind

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

i have done it.

thanks to all for ur reply.

Former Member
0 Kudos

Hi Arvind,

can you update how you solved it in the end?

We are facing the same problem

Former Member
0 Kudos

Hi Macro,

there are three types of # in SAP i have come across. each one is having different haxadecimal value.

which are

cl_abap_char_utilities=>new_line

cl_abap_char_utilities=>cr_lf

and normal #

see what is the hexadecimal value u r getting and than use the appropriate character.

Thanks

Arvind

former_member199125
Active Contributor
0 Kudos

Hi Aravind,

I think the problem is with 0A00, are you sure value of # is 0A00?

And I didn't understand santosh reply, where he ask you to try cl_abap_char_utiliities=>cl_rf .

IF he is right try also cl_abap_char_utilities=>new_line.

Regards

Srinivas

Former Member
0 Kudos

Try cl_abap_char_utilities=>cr_lf instead of '#', see if this works.

Former Member
0 Kudos

Hi Santosh,

I have already tried this.

its hexa_decimal value is '0D00' which can not replace '0A00'.

any other way??

Thanks & Regards,

Arvind