Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_SALESORDER_SIMULATE rounding off numbers

Former Member
0 Likes
2,739

Hi All,

I am in a situation where in BAPI_SALESORDER_SIMULATE are rounding off a dollar amount for ZWOT

I have 12.34567 but sap rounds it off to 12.35 for the net price before taxes

when simulate an order of 1000 peices i get 12350.00 instead of 12345.67

now when i simulate and order of 10000 peices then the pricing error becomes larger.

Is there a way to control BAPI_SALESORDER_SIMULATE to actually simulate the actual amount instead of rounding off the the number.

So Now my simulation is wrong because if this.

thanks

Ryan

Hi All,

I am in a situation where in BAPI_SALESORDER_SIMULATE are rounding off a dollar amount for ZWOT

I have 12.34567 but sap rounds it off to 12.35 for the net price before taxes

when simulate an order of 1000 peices i get 12350.00 instead of 12345.67

now when i simulate and order of 10000 peices then the pricing error becomes larger.

Is there a way to control BAPI_SALESORDER_SIMULATE to actually simulate the actual amount instead of rounding off the the number.

So Now my simulation is wrong because if this.

thanks

Ryan

11 REPLIES 11
Read only

Former Member
0 Likes
2,289

Ryan,

I am curious.... does it calculate the price correctly if you manually create a sales order for the same item(s) in VA01?

Read only

0 Likes
2,289

Hi John,

In VA01 the calculation is correct because i still get a price of 12345.67

after ordering 10000 peices instead of 12350.00

in simulate i get a rounded number and i multiply by 10000 but somehow SAP is possibly multiplying 1000 by 12.34567 but not 12.35

thanks!

Read only

0 Likes
2,289

Let's clarify this statement:

"in simulate i get a rounded number and i multiply by 10000 but somehow SAP is possibly multiplying 1000 by 12.34567 but not 12.35"

"I multiple by 10000"???

JUST after the BAPI returns... before you multiply anything, is the price correct?

Read only

0 Likes
2,289

Hi John,

Yes i get the net price from simulate, after that i X 10000 for the qunatity.

how ever just before i X the number i already get the rounded of dollar amount 12.35 instead of 12.3456

is there a way to maintain 12.3456 to be returned by simulate?

thanks

Read only

0 Likes
2,289

Ryan,

And this 12.35 value is returned into field COND_VALUE of an internal table of type BAPICOND??

COND_VALUE has a def that supports 28 digits b/4 the decimal place and 9 digits after the decimal (for the fractional piece).

Read only

0 Likes
2,289

Hi John,

I think i solved the issue.

the way i did it is let simulate also take care of the total calculation and retreived that value and it is now working properly.

Here is the code

CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'

EXPORTING

order_header_in = g_order_header_in

IMPORTING

return = wa_bapireturn

TABLES

order_items_in = gtab_order_items_in

order_partners = gtab_order_partners

order_schedule_in = gtab_order_schedules_in

order_items_out = i_bapiitemex

order_condition_ex = t_order_condition_ex.

i was able to get the total net value from order_items_out = i_bapiitemex in the field NET_VALUE1 so not i dont have to worry about calculation after bapi

Thanks for all the help

Points rewarded accordingly

Read only

0 Likes
2,289

I had the same issue, thank you Ryan for your help.

Julien

Edited by: P PROJET ASTRE on Oct 23, 2009 9:33 AM

Read only

Former Member
0 Likes
2,289

Hi,

check the user settings (defaults) in SU01 Tcode.

or use the command SET COUNTRY ' ' in script.

it will print the country specific format.

or

go to t-code: SU3

go to second tab defaults...

change the decimal notation and try...

need ur reward points.

Regards

Ravi

Read only

0 Likes
2,289

Hi Ravi,

the most decimal places is only xxx.xx nothing more

thanks

Read only

0 Likes
2,289

Ravi,

User settings have no relevance in pricing calculations.

Read only

Former Member
0 Likes
2,289

Hi,

Please check table parameter ORDER_CONDITION_EX and field ROUNDOFFDI perhaps it may help.

Regards,

Ferry Lianto