‎2009 Jun 09 10:53 AM
Hi All
I have some code in a user exit on save of a delivery (VL02N) that calculates the number of bags/pallets required to furnish that delivery.
I am now adding the same code to a user exit on save a sales order (VA02) to calculate the number of bags/pallets again but when run it is producing differing results.
the code is as follows:
DATA: bag_weight(12) TYPE p DECIMALS 4.
DATA: pallet_weight TYPE marm-umrez.
DATA: bag_denominator TYPE i.
...
bag_weight = pallet_weight / bag_denominator.
Assuming pallet_weight = 1000 and bag_denominator = 40.
On save of a delivery it is calculating bag_weight as 25.0000 (correct):
On save of a sales order it is calculating bag_weight as 0.0025 (incoorect).
All data declaration, code etc is the same. Does anybody have any clue as to why it would give two differing answers, I would not like to have to add a additional multiplication step to correct the result otherwise.
Thanks in advance
David
‎2009 Jun 09 11:18 AM
Hi ,
Would you please check whether Fixed Point Arithmetic is checked or not in the program attributes.
Some times if the Unicode and Fixed Point Arithmetic is not checked , creates prolem .
Regards
Pinaki
‎2009 Jun 09 10:55 AM
‎2009 Jun 09 10:56 AM
Check whether the weight unit field ( GEWEI ) is same or different in sales order and Delivery.
‎2009 Jun 09 10:57 AM
The weight unit (e.g. KG, G, etc) are the same?
Seems a conversion problem to me.
If they are not the same, you can use the FM UNIT_CONVERSION_SIMPLE to convert everything into the same unit.
If you need to have something equal to compare, i suggest you to implement this FM anyway.
‎2009 Jun 09 10:57 AM
David,
Are the interfaces into the User Exit the same?
Cheers,
Neil.
‎2009 Jun 09 11:18 AM
Hi ,
Would you please check whether Fixed Point Arithmetic is checked or not in the program attributes.
Some times if the Unicode and Fixed Point Arithmetic is not checked , creates prolem .
Regards
Pinaki
‎2009 Jun 09 11:35 AM
Hi,
Whenever you are using the Packed numbers, you need to check or set the program attribute fixed point arithmetic only as only this ensure that the decimal point is calculated correctly.
Have a look at the help.sap.com documentation link:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm
Hope this helps.
Thanks,
Samantak.
‎2009 Jun 09 11:42 AM
Hi,
Please check whether the FIXED POINT ARITHMETIC attributes is set for your program in the program attributes.
Regards,
Ankur Parab
‎2009 Jun 09 12:19 PM
Please check the units of the pallet weight while creating the sales order.