This website is not affiliated with, sponsored by, or approved by SAP AG.

delete space

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

delete space

Postby picsou » Tue Jun 03, 2014 7:27 am

hello,
I need your help :
I have this string :
1234 ; 456 ; 4444 ;this is a text ; ; ; ;

And I need to have this :
1234;456;4444;this is a text;;;;


I have tried lots of keywords, but never I have the good results.

Someone have an idea please ?

Best regards.
picsou
 
Posts: 183
Joined: Wed Aug 20, 2003 3:51 am
Location: France / Alsace

Re: delete space

Postby Gothmog » Tue Jun 03, 2014 7:49 am

Since you want to keep the spaces in "this is a text", you can't use CONDENSE ... NO-GAPS.
How about using REPLACE?
Use it to replace ` ;` and then `; ` by ';'.
Note that you want to use `; `, not '; ', in order for SAP to consider the trailing space.

Or, you could SPLIT you string at ';' into a table, condense the resulting substrings (to get rid of leading, trailing and duplicated spaces), and then concatenate the substrings separated by ';'.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home


Return to ABAP

Who is online

Users browsing this forum: No registered users and 5 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.