‎2008 Dec 10 8:48 PM
Hi Experts,
I hv a string and its value is= 'ABCDEF space1 space 2 space3 space4 GHIJKL'.......I mean, there r 4 spaces, I need to hv only 1 space between these..........these number of spaces are varies and the lenghth of string also varies........so, how can I get it? like 'ABCDEF space1 GHIJKL'
thanq
‎2008 Dec 12 3:07 AM
Hi,
Please try the method below.
data: s1 type string,
str1 type string,
str2 type string,
. str3 type string.
s1 = 'ABCD EFGHIJ'.
split s1 at space into str1 str2.
condense str2 no-gaps.
concatenate str1 space str2 into str3.
This way, the output will always be 'ABCD EFGHIJ' irrespective of the number of spaces between the two.
Thanks!
Sandeep
PS: please mark all helpful answers
‎2008 Dec 10 8:53 PM
‎2008 Dec 10 9:00 PM
Either way:
REPORT.
data:text TYPE string VALUE 'abcd efgh'.
CONDENSE text NO-GAPS.
CONCATENATE text+0(4) ' ' text+4(4) INTO text RESPECTING BLANKS.
WRITE text.
‎2008 Dec 11 9:52 PM
thanq
but, as i mentioned in my posting that, the SPACES are variable, they may b start from 3 CHAR or 4th or 5th!!
anyways thaq
‎2008 Dec 11 10:40 PM
hi,
i hv issue to see the complete page of SDN webpage.........I mean, am getting a width of 25.5 CM only, so, if i want to write reply, i need to go all the bottom to get scroll extreme right and then, move top, then, clicking the REPLY button..........but, in this course, am loosing my response/reply box!!
So, all u guys r gettign the same width(if so, why SAP did it like incomfortable, I guess this is a application of a net weaver) or some thing wrong with my laptop/browser-explorer(if so, How to correct myself) ??
thanq
‎2008 Dec 11 10:47 PM
‎2008 Dec 12 1:38 AM
‎2008 Dec 12 3:07 AM
Hi,
Please try the method below.
data: s1 type string,
str1 type string,
str2 type string,
. str3 type string.
s1 = 'ABCD EFGHIJ'.
split s1 at space into str1 str2.
condense str2 no-gaps.
concatenate str1 space str2 into str3.
This way, the output will always be 'ABCD EFGHIJ' irrespective of the number of spaces between the two.
Thanks!
Sandeep
PS: please mark all helpful answers