2007 Nov 29 4:41 AM
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
2007 Nov 29 4:49 AM
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.
2007 Nov 29 4:49 AM
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>