ā2014 Jan 29 9:54 AM
Hi all
data: DATUMSTRING type string.
data vonstring type string.
data bisstring type string.
BREAK-POINT.
DATUMSTRING = '1.1.14ā31.3.14'.
data: delim(1) value '-'.
split DATUMSTRING at delim into vonstring bisstring.
result:
| VONSTRING | 1.1.14ā31.3.14 |
Why does is not get splitted at the minus?
Thx, Ragards
Mario
ā2014 Jan 29 10:56 AM
Hi,
In DATUMSTRING = '1.1.14ā31.3.14' , you have put two minuses i.e it's not working. Replace '--' with '-'.
Regards,
DPM
ā2014 Jan 29 10:11 AM
Hello,
Am getting this results on my side.
REPORT z_test_ybi_lol.
DATA: datumstring TYPE string.
DATA vonstring TYPE string.
DATA bisstring TYPE string.
BREAK-POINT.
datumstring = '1.1.14-31.3.14'.
DATA: delim(1) VALUE '-'.
SPLIT datumstring AT delim INTO vonstring bisstring.
WRITE / : 'datumstring:', datumstring,
'vonstring:', vonstring,
'bisstring:', bisstring.
Explanation is that you are splitting this string 'datumstring' into two differents variables (vonstring bisstring) upon the delimiter -.
Thanks and kind regards,
Yovish.
ā2014 Jan 29 10:18 AM
Hi Yovish,
when I try it in "normal" ABAP then it work.
When I try it in a method, it does not work.
Could that be?
Regards Mario
ā2014 Jan 29 10:28 AM
Hi Mario
What do you see in debugging for method..? What is the difference in method?
Please paste your sample code.
Nabheet
ā2014 Jan 29 10:17 AM
ā2014 Jan 29 10:18 AM
Hi Mario,
Mario Müller wrote:
DATUMSTRING = '1.1.14ā31.3.14'.
data: delim(1) value '-'.
result:
| VONSTRING | 1.1.14ā31.3.14 |
I have executed your code and surprised when it doesnt work but later found that there is difference between
the - (hypen) and the symbol mentioned between the datumstring. Both are not same. I removed the symbol in the datumstring and replaced the hyphen and the code splits the record.
Code:
REPORT ZTEZT.
data: DATUMSTRING type string.
data vonstring type string.
data bisstring type string.
BREAK-POINT.
DATUMSTRING = '1.1.14-31.3.14'.
data: delim(1) value '-'.
split DATUMSTRING at delim into vonstring bisstring.
write:/ vonstring, bisstring.
Declare the symbol "-" as same in the datunstring variable and it works.
With Regards,
Giriesh M
ā2014 Jan 29 10:19 AM
Hi Mario,
I executed your code its getting splitted.
See in debugging: the below is before split.
After split:
So output is : 1.1.14
ā2014 Jan 29 10:25 AM
Could you try it in a method?
It seems not to work in ABAP OO.
Regards
Mario
ā2014 Jan 29 10:28 AM
Hi Mario,
Have you checked my previous post.
With Regards,
Giriesh M
ā2014 Jan 29 10:29 AM
ā2014 Jan 29 10:51 AM
Hi netweaver,
could you pls.send your coding.
I do not see any differences between yours and mine.
Regards
Mario
ā2014 Jan 29 10:27 AM
hi Mario,
Please look this ...
REPORT ZSAMPLE123456.
DATA: datumstring TYPE string.
DATA vonstring TYPE string.
DATA bisstring TYPE string.
data : char_von type char8,
char_bi type char8.
datumstring = '1.1.14-31.3.14'.
DATA: delim(1) VALUE '-'.
SPLIT datumstring AT delim INTO vonstring bisstring.
char_von = datumstring+0(6).
char_bi = datumstring+7(7).
WRITE / : 'datumstring:', datumstring,
'vonstring:', vonstring,
'bisstring:', bisstring,
'char_von :', char_von,
'char_bi :', char_bi.
Thanks,
Vijay
ā2014 Jan 29 10:56 AM
Hi,
In DATUMSTRING = '1.1.14ā31.3.14' , you have put two minuses i.e it's not working. Replace '--' with '-'.
Regards,
DPM
ā2014 Jan 29 11:10 AM
Hi all,
this is sensationell!!!!
I copied 1.1.14ā31.3.14 from an excel sheet.
than I replaced - with - manually.
In hex mode:
Nr 1 is excel
Nr 2 is manually changed:
Took me 3 hours!
Thank you all
Regards
Mario