cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Order - Specify Pricing Type at Item Level when using BAPI_SALESORDER_CREATEFROMDAT2

afordham
Participant
0 Kudos

Hi,

We are creating Sales Orders using the BAPI_SALESORDER_CREATEFROMDAT2 function module. The LOGIC_SWITCH-PRICING field allows us to specify a Pricing Type that applies to the whole document.

Is it possible to then change the Pricing Type that is used for specific items? We have looked at the USEREXIT_PRICING_RULE subroutine in RV61AFZA, but this only gets called once per order and seems to be for specifying how custom Pricing Types work, rather than assigning a Pricing Type to an item. We have also looked at the USEREXIT_CHANGE_PRICING_RULE in MV61AFZA, but this is only called when the billing document is created, which is too late for us.

Has anyone come across a way of using item-level Pricing Types with this BAPI? Our only other option seems to be to post multiple Sales Orders (one for each group of items that share a Pricing Type) and then try to recombine the required items onto a single invoice at the billing stage, but this is a last resort.

Many thanks in advance!

Andrew

Accepted Solutions (0)

Answers (1)

Answers (1)

maximiliano_isoba
Contributor
0 Kudos

Hi Andrew,

I think it would be useful to know the business requirement since other options and new ideas could be proposed.

For example:
Pricing type is set in the copy control customization and it is assigned at an item level. You can:

A. Create a new item category,

B. Allow it to be manually entered in the document type you are working with,

C. Set the desired pricing type in the copy control and

D. Pass the item category as a parameter to the BAPI.

Regards,

Max Isoba.

afordham
Participant
0 Kudos

Hi Max,

Our issue is that you can only specify a single Pricing type for an entire Sales Order if you're posting using the BAPI. The Item Categories we are using already have their own Pricing type config, but this only works when you are creating the Sales Order using the SAPGui (VA01, etc.) and not when using the BAPI.

Copy control doesn't work when posting using the BAPI, unfortunately. You can specify that an item references a preceding document (e.g. a Contract Item), but you have to populate all the Sales Order item values manually; the BAPI won't automatically copy anything across from the referenced item.

Regards,

Andrew