04-16-2009 8:15 PM
Hello Dear Gurus,
I'm facing the following problem:
I need to simulate the net value of an Sales Order using ABAP code. But the net value is based in 2 manual conditions: FREIGHT and MANUAL PRICE.
I tried the FM BAPI_SALESORDER_SIMULATE. But in this case I'm not able to specify the manual conditions.
So I tried the FM PRICING_GET_CONDITIONS but it didn't return all the conditions.
Thank you in advance.
Fabio Purcino
04-16-2009 11:20 PM
Use BAPI_SALESORDER_CREATEFROMDAT2.
You can specify pricing conditions and setting the TESTRUN flag will ensure it does not save the sales order.
Cheers
Graham Robbo
04-16-2009 11:20 PM
Use BAPI_SALESORDER_CREATEFROMDAT2.
You can specify pricing conditions and setting the TESTRUN flag will ensure it does not save the sales order.
Cheers
Graham Robbo
04-17-2009 8:23 PM
Hi,
I tried this FM, it runs without any error. But Why can I retrieve the net value?
Thank you very much.
Fabio Purcino
04-23-2009 7:07 AM
Hi Fabio,
just checked some old code I built at a customer of mine and I think I found what you need.
BAPI_SALESORDER_CREATEFROMDAT2 is essentially just a wrapper around function module SD_SALESDOCUMENT_CREATE.
This function module (SD_SALESDOCUMENT_CREATE) allows you to insert manual condition records into SALES_CONDITIONS_IN and it returns the condition records for the order in CONDITIONS_EX.
Cheers
Graham Robbo
04-24-2009 1:21 PM
12-29-2009 7:47 AM
Hi,
how did you solve your problem?
I also need pricing with manual conditions. If I call SD_SALESDOCUMENT_CREATE with all the parameters I used to call BAPI_SALESORDER_SIMULATE I don't get a netprice / netvalue in the items return table.
header: doc_type, sales_org, distr_chan, division
logic_switch-pricing: 'B' or 'C'
partners: sold to and ship to party
item: itm_number, material, target_qty, target_qu, sales_unit
The only difference using the BAPI is that I hafe to fill different quantity fields.
What could be missing?
thanks,
Christian