‎2009 Apr 07 10:13 AM
Hi,
I have a string which contains 43.555.
I would like to find the number occurred after a ".".
Let me know which function to use.
‎2009 Apr 07 10:16 AM
search '.' in YOUR_STRING.
the position of your dot is beeing published in sy-fdpos, if found.
Strlen( YOUR_STRING ) gives you the length of your string.
length of string - position of dot = number of characters after dot.
‎2009 Apr 07 10:16 AM
search '.' in YOUR_STRING.
the position of your dot is beeing published in sy-fdpos, if found.
Strlen( YOUR_STRING ) gives you the length of your string.
length of string - position of dot = number of characters after dot.
‎2009 Apr 07 10:16 AM
u can try to do:
split text at '.' into text1 text2.
not sure if it woks with numbers tho.
‎2009 Apr 07 10:20 AM
Hi,
Try this.
Data : temp type string.
move num to temp. "num will hold 45.9999
split temp at '.' into str1 str2.
regards,
mallika
‎2009 Apr 07 10:18 AM
Use split at dot, it wud be diveded into left and right strings then search the right number for ur pattern or number whatever u want
‎2009 Apr 07 10:28 AM
Hi,
Please use the following code:
DATA test type string.
DATA: num1 type string, num2 type string.
test = '43555'.
SPLIT test at '.' INTO num1 num2.
IF num2 is NOT INITIAL.
write: num2+0(1). -
> This will give you the number after '.' 5
ENDIF.
OR
inside IF.. ENDIF
write: num2. -
> This will give the numbers after '.'. 555
Best Regards,
Suresh
‎2009 Apr 07 10:20 AM
Check this code.
REPORT zsample.
DATA: s TYPE string,
off TYPE i,
w type c.
s = '43.555'.
FIND '.' IN s MATCH OFFSET off.
off = off + 1.
w = s+off(1).
write: w.
‎2009 Apr 07 10:23 AM
hi Krish,
You can do like this..
split text at '.' into t1 t2.
and then you can find the length of t2.
Regards,
Nitin