on 2021 Jan 22 7:40 PM
Hi ,
In the User Exits i have to perform division but the value to not populating correct.
DATA : LV_RESULT TYPE P DECIMAL 2.
LV_RESULT = VBAP-KZWI1 / VBAP-KWMENG
VBAP-KZWI1 has the data type CURR with decimal 2
VBAP-KWMENG has the data type QUAN with decimal 3
so let say VBAP-KZWI1 = '200' & VBAP-KWMENG = '20'
then result i expect is to 10 but the value i get in the result is 0.01
please suggest me
Request clarification before answering.
Hi sandra,
i'm doing code in the user-exit MV45AFZB if we externalize the code then we need to enable fixed-point artihmetic of Main program.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrea,
my code is in the User-exit not able to do fixed-point arithmetic.
Below code in the program with out enabling fixed-point.
in the result i want 5.06
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This looks like a pricing formula and those normally run with fixed-point arithmetic enabled.
In this situation, your basic unit is 1/100 and you should multiply accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Disabled or enabled? (ABAP documentation says that it's enabled in new programs, and disabling it is now impossible)
When it's disabled (the OP case), 200.00 / 20.000 will give 1 because the decimal point is ignored (20000 / 20000), and 1 will be stored 0.01 because the decimal point is ignored too (1).
The most easy solution is to externalize the code in a new program where fixed-point arithmetic is enabled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.