2008 Mar 25 8:48 AM
hi guru,
i have one value in my output in alv report.
that is fgrand total = 99.8765888% (variable declared in string)
i want to restrict the lenth upto 2 decimals
ex. 99.87%
how to do it ????
give me solution.
2008 Mar 25 11:00 AM
Hi,
Add DECIMALS_OUT in the field catalog.
Regards,
Sankar.
2008 Mar 25 8:52 AM
Hi
declare one more varible of type p with decilmals 2
data : v_dec type p with decilmals 2
v_dec = fgrand.
otherwise use Floor or round
regards
Shiva
2008 Mar 25 8:58 AM
Hi,
u can do that with command for string 'REPLACE' .
regards,
paliwal
2008 Mar 25 9:46 AM
DATA:
total TYPE string VALUE '99.8765888%'.
REPLACE total+5(5) WITH ' ' into total.
CONDENSE total NO-GAPS.
write: total.
you will get the output as 99.87%
If ur string has length as ur example or of same pattern of it will work.
regards,
priya.
2008 Mar 25 10:49 AM
Hi subhasis,
if you want to restrict and round off the number as well you can use the Function module "ROUND".
Regards,
Goutham.
2008 Mar 25 11:00 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |