Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Replacing ',,' by space

Hi All,

I have a variable in that the value is "3,,,,,,,,,,Test".

Now the user wants to replace the ",," by space.

Its urgent.

Can anyone give me a solution.

Points will be rewarded immediately.

Regards,

Nikhil Moghe

Tags:
Former Member
Former Member replied

Nikihl,

Do like this

data: text(50) type c value 'a,,,,,b,,,,',
      len type i,
      ind type i,
      pos type i.

len = strlen( text ).

do len times.
ind = sy-index.
pos = sy-tabix.
if text+ind(pos) = ','.
replace ',' with space into text.
endif.
enddo.
condense text no-gaps.
write text.

Regards,

Satish

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question