Application Development 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: 

Pricing Simulation based in a Manual Condition

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

GrahamRobbo
Active Contributor
0 Kudos

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

5 REPLIES 5

GrahamRobbo
Active Contributor
0 Kudos

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

0 Kudos

Hi,

I tried this FM, it runs without any error. But Why can I retrieve the net value?

Thank you very much.

Fabio Purcino

0 Kudos

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

0 Kudos

Thank you so much Graham. Solved the problem

Former Member
0 Kudos

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