‎2008 Apr 29 9:45 AM
Hi All,
I have a quantity field in table having data type as dec and length as 13 and decimal places as 5.
But when i enter 255 in table,it automatically changes to .255 but it should be 255.
Thanks and Regards,
Amanpreet Sehgal
‎2008 Apr 29 9:50 AM
‎2008 Apr 29 9:55 AM
I can try this out but if any other person tests it,he may not know that he has to enter 255.00
I have a table vbap.I tried to copy the datatype for quantity from this table.But still the same problem exists.Whatever data I enter it takes it in the decimal form.
If I enter 5555555,it will take it as 5555.555
Thanks and Regards,
Aman
‎2008 Apr 29 10:12 AM
Hi,
I tried it as 255.00 but it automatically changed to .255
Please help me with some other alternative.
Thanks and Regards,
Aman
‎2008 Apr 29 10:15 AM
‎2008 Apr 29 10:17 AM
‎2008 Apr 29 10:19 AM
I tried to change the datatype to quan but it still does not works.
Please help me with my query.
Thanks and Regards,
Aman
‎2008 Apr 29 10:25 AM
hi
check this one
For calculations in business applications, use packed numbers. The program attribute Fixed point arithmetic affects calculations using packed numbers.
If the program attribute Fixed point arithmetic is not set, type P fields are interpreted as integers without decimal places. The decimal places that you specify in the DECIMALS addition of the TYPES or DATA statement only affect how the field is formatted in the WRITE statement.
DATA: PACK TYPE P DECIMALS 2.
PACK = '12345'.
WRITE PACK.
If the program attribute Fixed point arithmetic is not set, the output is as follows:
123.45
If the program attribute Fixed point arithmetic is set, the output is as follows:
12,345.00
If the Fixed point arithmetic attribute is set, the decimal places are also taken into account in arithmetic operations. Calculations with packed numbers in ABAP use the same arithmetic as a pocket calculator. Intermediate results are calculated using up to 31 digits (before and after the decimal point). You should therefore always set the Fixed point arithmetic attribute when you use type P fields.
DATA: PACK TYPE P.
PACK = 1 / 3 * 3.
WRITE PACK.
If you have not set the Fixed point arithmetic attribute, the result is 0, since the calculation is performed using integer accuracy, and the result is therefore rounded internally to 0.
If the program attribute Fixed point arithmetic is set, the result is 1 because the result of the division is stored internally as 0.333333333333333333333333333333 with an accuracy of up to 31 digits.