07-07-2006 3:56 PM
Hi,
i am getting KBETR values and displaying them in a type p decimals 5 field . Before display these values are being rounded off .....cos of which while displaying the type p field shows value 130.05000 instead of 130.4999...... how do i solve this
thanks
SIndhu
07-07-2006 3:58 PM
Hi Sindhu,
Take a character variable of KBETR length and pass KBETR value into this and display character variable instead of moving to a type p variable.
Thanks,
Vinay
07-07-2006 3:59 PM
Hello,
Before displaing move the value of the variable to char variable.
If useful reward points.
Regards,
Vasanth
07-07-2006 4:00 PM
07-07-2006 4:40 PM
Hi All,
This is how KBETR is defined.
Domain WERTV6 Value field PL6 with
Data Type CURR Currency field, stored as DEC
<b>Length 11 Decimal Places 2</b>
Thus it gets rounded to 130.50 and is stored in that way even when value assigned to it is 130.4999.
Consider this code.
REPORT zarun_2.
DATA: kbetr_in TYPE kbetr ,
kbetr_out TYPE p DECIMALS 5,
exrate TYPE exrate.
kbetr_in = '130.4999' .
WRITE: / 'After Assigning to KBETR :', kbetr_in.
exrate = '130.4999' .
WRITE:/ 'After Assigning to EXRATE :', exrate.
kbetr_out = kbetr_in.
WRITE:/ 'After Assigning to TYPE P DEC 5(KBETR) :', kbetr_out.
kbetr_out = exrate.
WRITE:/ 'After Assigning to TYPE P DEC 5(EXRATE) :', kbetr_out.
<b>This is the output</b>
After Assigning to KBETR : 130.50
After Assigning to EXRATE : 130.49990
After Assigning to TYPE P DEC 5(KBETR) : 130.50000
After Assigning to TYPE P DEC 5(KBETR) : 130.49990
Regards,
Arun Sambargi.
Message was edited by: Arun Sambargi