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: 

Values to be deleted after comma

former_member581827
Participant
0 Kudos
268

Hi All,

I am getting values like 123,4567889 in a field and i want to display 123,456 only.

i,e after comma only 3 digits. The data type of field is FLTP.

Appreciate your replies.

Regards,

Chandra

2 REPLIES 2

Former Member
0 Kudos
145

text = 123,4567889 .

SEARCH text FOR ',' ABBREVIATED.

text = text sy-pos+(3).

The first two SEARCH-statements have the same effect. They find the first blank in text and set sy-fdpos to the value 4. The third SEARCH-statement finds the word "Beethoven" in the search area (beginning from position 6 of text ), sets sy-fdpos to the value 5, i.e., the offset of the place of finding in the search area and changes the content of text to "Roll over BEETHOVEN" .

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.

Former Member
0 Kudos
145

Hi Chandra,

you should difine the data type of P

like this FLTP type P(3),

i thais this will workout.

<b>reward is usefull</b>