Skip to Content

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

REPLACE : want to replace the string

Hello All,

I need to replace a word(GO) in a sentence with another word(GONE). these words are stores in the variables var1(6) & var2(6) used the keyword REPLACE for this But I am getting some unwanted blank spaces. I used CONDENE keyword then also one blank space remains. I should not get any unwanted blank space. Please help me.

Data : var1(6) type c.

Data : var2(6) type c.

Data : var3(15) type c.

Data : len type i.

var1 = 'GO'.

var2 = 'GONE'.

var3 = 'ABCDGOEFGH'

len = strlen(var1).

REPLACE var1LENGTH len WITH var2 INTO var3.

Then the new sentence is coming like

ABCDGONE EFGH

I used CONDENSE then again it is coming like.

ABCDGONE EFGH

I need the sentence like ABCDGONEEFGH

Regards,

Lijo John

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question