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: 

BAPI_SALESORDER_CREATEFROMDAT2 is not carrying out pricing for variant config materials

former_member184551
Contributor
0 Kudos

Hi Guys

I need to create a BAPI to create sales orders coming in through a web service from an external system, for normal materials all works well, but for variant config materials the pricing is not happening, like the way it does when I manually create an order, I don't want to manually pass the pricing condition in BAPICOND as I want the BAPI to dynamically determine the conditions from the access sequence.

While debugging VA01 I found that the control goes to the 'PRICING' function module twice, ones for the main material , and next for all its config materials, the second time it calls the 'PRICING' fm with pricing type 'O'. Here it selects the price for all the variant materials and loads into an internal table vkomv and displays in VA01 the variant materials that we select while creating the order, but in the case of the BAPI call, the control is going only to the 'PRICING' fm call for the header.

I have passed 'V'  in the application parameter and the variant material in the varcond parameter of the BAPICOND structure.

Any idea what I might be missing ??

Thanks

Sameer

3 REPLIES 3

former_member184551
Contributor
0 Kudos

Solved by reading the following OSS notes

562124 Configuration change via

549563 BAPI: Filling the configuration structures

567348 – Fill configuration via BAPI

0 Kudos

Hi,

I am facing same issue with the updation of pricing for variant conditions. Config data is getting updated with bapi_salesorder_createfromdat2 but pricing isnt carried out . When I open the created sales order in va02 and click on item configuration I can see config details and when i go back, the pricing is getting triggered.

But the pricing should be carried out automatically through BAPI .Please guide .

Any kind of help is really appreciated. I am really struggling with this issue from last few days.

Thank you.

Archana

0 Kudos

Hi ,

Resolved by using OSS note 562124 - Configuration change via BAPI.

Created Z program as per the note and passed exiting sales order. Pricing conditions are getting determined .

In the sample program below FMs have been used:

1.bapi_salesorder_createfromdat2 -for Sales order creation along with Configuration details.

2.bapisdorder_getdetailedlist -get the created sales order details.

3.bapi_salesorder_change - pass config details again in SO change BAPi and commit.

Variant conditions get updated in Sales order.:)

Thank you Sameer for the ref. OSS note.

Regards,

Archana