Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the position of the deicmal place?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

2 REPLIES 2

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.