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

how to replace # with space

Former Member
0 Likes
1,296

hi,

my requirement is reading the content of the mail using the function module so_object_get_content. and that data we will update in the log.

where as while using this fm we are getting # in that content and these # are replacing with junk character (i.e box ) in the log.

what we have to do in order to remove those #'s from that content.

6 REPLIES 6
Read only

Former Member
0 Likes
931

Hi!

For reaplacing the relevant text within a string you can use this:

REPLACE ALL OCCURRENCES OF '#' IN gv_text WITH space.

Regards

Tamá

Read only

varma_narayana
Active Contributor
0 Likes
931

Hi..

You can use .

Translate <str> using '# '. "To replace # with Space in all occurreneces

Condense <str> no gaps. "To remoce Spaces if u want

<b>reward if Helpful</b>

Read only

Former Member
0 Likes
931

hi

good

replace '#' with ' ' into maktx.

thanks

mrutyun^

Read only

Former Member
0 Likes
931

try with this

REPLACE ALL OCCURRENCES of CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB IN V_STR WITH SPACE.

or

REPLACE ALL OCCURRENCES of CL_ABAP_CHAR_UTILITIES=>CR_LF IN V_STR WITH SPACE.

which ever works in your system

Read only

Former Member
0 Likes
931

hii,

try like this using REPLACE keyword with other options as

REPLACE ALL OCCURRENCES OF '#' IN ITAB[internal table] WITH space.

or

REPLACE '#' WITH ' ' into iITAB.

if helpful reward some points.

with regards,

Suresh Aluri.

Read only

Clemenss
Active Contributor
0 Likes
931

Hi raghu,

  1. is the external representation of non-displayable characters - internal (switch to hex display in debugger) it may be something else.

You have to use a WRITE TO statement first to convert any non-displayable character to # hashmark symbol.

So you have to go thru all line like this:


data: 
  lv_offset type syfdpos,
  c type c.
do strlen( line ) times.
  lv_offset  = sy-index - 1.
  write line+lv_offset(1) to c.
  if c = '#'.
    line+lv_offset(1) = space. 
  endif.
enddo.

Regards,

Clemens