2006 Jan 12 2:03 PM
<b>1</b>.i have 5.900000
i want to get 5.90
<b>2.</b> i have 5.00 i want to get only 5
how?
thanks..
2006 Jan 12 2:12 PM
2006 Jan 12 2:14 PM
Hi,
1) define a variable v_1(3) type c. move the value to this variable.
2006 Jan 12 2:15 PM
Hi,
Use either of the two methods :-
1.
DATA : a(5) TYPE c.
a = '5.14500'.
SHIFT a RIGHT DELETING TRAILING '0'.
CONDENSE a NO-GAPS.
WRITE 😕 a.
2.
DATA : a(5) TYPE c,
b(4) TYPE c.
a = '5.10500'.
SHIFT a RIGHT DELETING TRAILING '0'.
CONDENSE a NO-GAPS.
WRITE 😕 a.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = a
IMPORTING
OUTPUT = b
.
WRITE 😕 b.
Best regards,
Prashant
2006 Jan 12 2:16 PM
you can use the write variable decimals 0.
DATA: X TYPE P DECIMALS 3 VALUE '1.267',
Y TYPE F VALUE '125.456E2'.
WRITE: /X DECIMALS 0, "output: 1
/X DECIMALS 2, "output: 1.27
/X DECIMALS 5, "output: 1.26700
2006 Jan 12 2:16 PM
Hi Liat,
Use the option Condense.
For Eg: If u want to print v_field with only two decimals, then write the field like this &V_field(C.2)&
and for 0 decimals use &v_field(C.0)&
This is for scripts.
Thanks,
Vamsi.
2006 Jan 12 2:28 PM
guys
i get the value in alv---itab
the data is change all the time
sorry i didnt mantion.
2006 Jan 12 2:30 PM
at 1. i want always 2 number after the point.
at 2. i want only numbers
2006 Jan 12 4:36 PM
Hi,
1. To get only 2 decimlas transfer to a variable of type p decimals 2.
2. Transfer to a variable of type i.
It has worked i have tried it out.
Cheers,
Deepak
2006 Jan 23 8:58 AM
Hi,
Pls don't forget to reward points and close the question if you find the answers useful.
Eddy