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: 

REPLACE '#' WITH ' '

Former Member
0 Kudos
320

Hi Experts,

i hope you can help me. I have to upload an excel sheet by FM 'TEXT_CONVERT_XLS_TO_SAP'. The result that i get contains a string that could implement line breaks. This line breaks are each identified by '#'.

Before the string is displayed the '#' has to be replaced. I have tempted it with

REPLACE '#' WITH ' ' but i get no positiv result.

Can anyone assist me to resolve this problem?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
178

It depends on what you wanna do with it. Those '#' are special characters to indicates new line or tab. You need to use the abap objects CL_ABAP_CHAR_UTILITIES to fix this issue.

Sample codes:

  • This code will split up the

REPLACE CL_ABAP_CHAR_UTILITIES=>NEWLINE IN myString WITH SPACE.

5 REPLIES 5

Former Member
0 Kudos
178

hi Florian,

do this way ..


replace all occurrences of 
  cl_abap_char_utilities=>CR_LF in str with space.

or


replace all occurrences of cl_abap_char_utilities=>HORIZONTAL_TAB
in str with space.

REgards,

Santosh

Former Member
0 Kudos
178

data temp_fill_string(50) type c value 'sfg###sjndks###fifis'.

translate temp_fill_string using '# '.

write temp_fill_string .

Message was edited by:

sunil kumar

Former Member
0 Kudos
178

Hi,

Replace # with CL_ABAP_CHAR_UTILITIES=>NEWLINE in the text, this will give the next text in the new line

Regards

Sudheer

Former Member
0 Kudos
179

It depends on what you wanna do with it. Those '#' are special characters to indicates new line or tab. You need to use the abap objects CL_ABAP_CHAR_UTILITIES to fix this issue.

Sample codes:

  • This code will split up the

REPLACE CL_ABAP_CHAR_UTILITIES=>NEWLINE IN myString WITH SPACE.

0 Kudos
178

Hi all,

thanks a lot. I've resolve the problem with Thungs answer. The replace statement by santosh does not work. I get the correct result from

REPLACE CL_ABAP_CHAR_UTILITIES=>NEWLINE IN myString WITH SPACE.

Thanks.