cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Replace character space with u00A0 in string

Former Member
0 Likes
1,146

I created a Content Management System for a client. This way they can dynamically change webtext for clients. The only problem is that the text is stored in 255 length field (longer is not possible in the database). If the last character is a space character then only 254 characters are stored. The next time you retrieve the all lines the last word of the line and the first word of the next line are concatenated without space.

I tried replace all occurrences of ' ' in string with ' '. But then I got a short dump! Trying to catch the last character checking if it is a space also doesn't work.

Does anybody has a solution.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Just used

while sy-subrc eq 0.

replace space with ' ' into input_string.

endwhile.

Former Member
0 Likes

Is that your solution? Seems like it should be ?

Former Member
0 Likes

Give this topic a look.

Ulli_Hoffmann
Contributor
0 Likes

or maybe that one:

with regards from the human search engines.

Former Member
0 Likes

I am using methods and controller. For example if I use the code from function SSM_REPLACE_SPACE_BY_CHAR in a method then it does not work. The character space is a very rare character. Within methods using <b>if wa_string = space</b> of if wa_string cs space does not work.