Application Development and Automation 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: 
Read only

Double hash key ##

Former Member
0 Likes
1,476

Hello.

when i use the sentence import and there are two lines. the string comes with ## and i want to delete them.

ej: Hello##Bye

The sentence replace doesn't work.

How can i replace them with a blank?

thanks.

7 REPLIES 7
Read only

Former Member
0 Likes
1,070

DATA: str TYPE string VALUE 'Hel##o'.

REPLACE ALL OCCURRENCES OF '#' in str WITH ''.
Write str.


Helo
Read only

Former Member
0 Likes
1,070

The sentence replace doesn't work.

Read only

0 Likes
1,070

Duplicate reply, thread removed

a®

Read only

0 Likes
1,070

Well, when there are two lines, than this hash symbol is most likely a Carriage return Line Feed. In class CL_ABAP_CHAR_UTILITIES there is an attribute called CR_LF. Use this to replace the hash symbols.


REPLACE ALL OCCURENCES OF CL_ABAP_CHAR_UTILITIES=>CR_LF.....

Read only

Former Member
0 Likes
1,070

Hi,

Check this code..The ## might be CRLF

DATA : VAR TYPE CHAR20 VALUE 'Hello##Bye'.

REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>CR_LF IN VAR WITH SPACE.
CONDENSE VAR.

Read only

former_member222860
Active Contributor
0 Likes
1,070

Hi Jose,

Try with TRANSLATE

data: var1 type string value 'Hello##Bye'.

TRANSLATE var1 USING '#  '.  "Give a Space after #

write:/ var1.

Read only

Former Member
0 Likes
1,070

Above threads are correct.

we can remove # in the lines using..

REPLACE ALL OCCURRENCES OF '#' in str WITH ''.

please try again...

if you still dint get the rt ouput please post the sample code.

safel