Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert ## - character ?

gerd_hotz
Contributor
0 Kudos
167

Hello experts,

I'm reading the text of an incoming emai with method pdf_table = document->get_body_part_content( 1 )

where pdf_table is type bcss_dbpc with CONT_TEXT-Line of type SO_TEXT255 char.

But when I now have a look into this pdf_table I see a lot of this #### - characters.

How I can convert this character into space character ?

Thanks for help,

G.

1 ACCEPTED SOLUTION

rainer_hbenthal
Active Contributor
0 Kudos
113

Hash characters are a substitute for characters which cant be displayed. In most cases this happens when you have a code page issue. Your SAP System is running under a different code page then the imported document

8 REPLIES 8

Former Member
0 Kudos
113

Use the "REPLACE" command.

0 Kudos
113

Hello,

REPLACE ALL OCCURENCES OF '#' IN pdf_table3 WITH space

does not solve the problem: . I still get this # characters.

Any other idea ?

BR

G

0 Kudos
113

Hi Gerd,

"#" is also a wild-card character for any not printable sign. You have not to replace "#" but the original values. Check them in debugger!

Regards,

Klaus

rainer_hbenthal
Active Contributor
0 Kudos
114

Hash characters are a substitute for characters which cant be displayed. In most cases this happens when you have a code page issue. Your SAP System is running under a different code page then the imported document

0 Kudos
113

Hello again,

this # - characters seems to be control chracters from line break in the email.

I've changed code settings in my gui, but this didn't help. (we also use unicode).

But the problem is still there.

How to change this # - control characters ?

Any ideas ?

Thanks G

0 Kudos
113

Hi Gerd,

you can try to remove those values by using the attributes of class CL_ABAP_CHAR_UTILITIES.

e.g.

CONSTANTS: xc_vtab type c value cl_abap_char_utilities~vertical_tab.

REPLACE ALL OCCURRENCES of xc_vtab in my_field WITH SPACE.

Regards,

Klaus

0 Kudos
113

Hello again,

problem solved:

REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf IN pdf_table3 WITH space.

Now the #-characters are eliminated !

Thanks Gerd

0 Kudos
113

you need to use the replace command. Your try using it couldnt work because the # is not really in your varaibale, the # is only shown cause the character cant be displayed but their originally value ist still there,

try


replace all occurences of cl_abap_char_utilities=>newline in so_text255 with ''.