10-19-2007 10:46 AM
Hi,
I have a String '-234.45'. I need to determine it decimal place.
I have try:
SEARCH '-234.45' FOR '.'.
but the sy-fdpos is 0.
How to get the decimal place? Is there other way to get it?
Please advise.
Regards,
Rayden
10-19-2007 10:52 AM
hi,
you can try split function.
split var1 at '.' into var1, var2.
this means if it gets split decimal is present.
therefore,
if sy-subrc = 0.
strlen( var1 ) + 1. will give you place of decimal point.
10-19-2007 10:52 AM
hi,
you can try split function.
split var1 at '.' into var1, var2.
this means if it gets split decimal is present.
therefore,
if sy-subrc = 0.
strlen( var1 ) + 1. will give you place of decimal point.
10-19-2007 10:53 AM
Hi,
see , if this will help you out.
DATA: text TYPE string VALUE `Roll over Beethoven`,
pos TYPE i.
SEARCH text FOR '. .'.
SEARCH text FOR ` `.
IF sy-subrc = 0.
pos = sy-fdpos + 2.
SEARCH text FOR 'bth' STARTING AT pos
ABBREVIATED AND MARK.
ENDIF.
cheers,
Hetal.