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_SIMULATE not returning pricing errors

Former Member
0 Kudos

Hello All,

I am using BAPI_SALESORDER_SIMULATE to simulate the sales order.

When I try to simulate/create the sales order in VA01 with the same parameters as passed in BAPI , I get a message "Pricing Error : Mandatory Condition ZPR5 is missing".

Suprisingly the same error is NOT captured by BAPI during simulation.

Can anyone suggest the alternative workaround or some other FM which can capture all the BAPI messages which are encoutered.

Thanks in advance.

Regards,

Rinkesh Doshi

14 REPLIES 14

Former Member
0 Kudos

Hello,

try the FM SD_SALESDOCUMENT_CREATE with parameter Testrun = 'X'.

Please read the doku.

Best regards

Gerd

0 Kudos

Hello All,

I already tried simulating sales order with SD_SALESDOCUMENT_CREATE and BAPI_SALESORDER_CREATEFROMDAT2 with Test Run Flag as X in both the cases.

But both of them do not capture the error message related to pricing.

When running it in update mode, the sales order is sucessfully created through BAPI.

Any further help/suggestion would be appreciated.

Regards,

Rinkesh Doshi

Edited by: Rinkesh Doshi on Dec 7, 2011 9:56 AM

Former Member
0 Kudos

HI ,

can you check FM SD_SALES_ITEM_COND_MAINTAIN ,it should be useful for you to simulate pricing related errors.

and make sure you will pass all required details in order to get right access key combinations.

regards

Prabhu

madhu_vadlamani
Active Contributor
0 Kudos

Hi Rinkesh,

I worked on the same bapi for simulate sales order and It is working.Please check the return messages in both return and messagatable.

Regards,

Madhu.

0 Kudos

Hello,

Thanks for the reply.

I tried it with different possible combination of sold to party and material for simulation of sales order and counter checked the data which I am passing in BAPI and in VA01.

But for me in VA01, its still displaying "Mandatory Pricing Condition ZPR5 is missing" as status message, whereas BAPI does not return any error in either the return structure or in message table.

Regards,

Rinkesh Doshi

Edited by: Rinkesh Doshi on Dec 7, 2011 10:26 AM

0 Kudos

Hi,

Can you check in ORDER_INCOMPLETE.Here you can see incomplete log.

Regards,

Madhu.

0 Kudos

Thanks for the reply.

The return structure ORDER_INCOMPLETE returns the fields VBAP-PRSOK with field text as Pricing.

Requirement is to capture the actual pricing error that occurs during the simulation of sales order i.e. Message "Pricing condition ZPR5 is missing" should be captured and displayed in the error log at the end of program.

With just the fieldname in incomplete log, we actually cannot makeout what kind of issue occured during pricing

Thanks.

Regards,

Rinkesh Doshi

0 Kudos

Hi,

The fm or bapi both are giving the messages in the same format.I am not sure that any other fm are available for this.

Regards,

Madhu.

0 Kudos

Hello All,

Any further help on the above mentioned issue ?

I tried using CALL FUNCTION 'MESSAGES_INITIALIZE' before the BAPI and 'MESSAGES_STOP' after the BAPI to capture the messages triggered in BAPI.

However it still does not work . Any workaround / alternative solution for this issue ?

Thanks,

R. Doshi

0 Kudos

Hi Doshi,

Can you try in this way.Activate the exit in sampmv45a and check the pricing.If there is any error then kee one error message,this error message will trigger in bapi return message.I think this will work .

Regards,

Madhu.

0 Kudos

Hi Doshi,

Did you tried this.

Regards,

Madhu.

0 Kudos

Hello Madhu,

Thanks for your reply.

Basically the thing is we need not go and explicitly handle the pricing. The pricing is taken care by the BAPI and this is not the specific message that we are looking at.

Any pricing releated message which occurs during simulation must be captured, so creating an exit wont help.

Let me know if any other inputs.

Thanks,

Rinkesh Doshi

0 Kudos

Hi,

Did you input right format of required quantity (REQ_QTY) in ORDER_ITEMS_IN?

The format must be 00009001 corresponds to 9.001

0 Kudos

Hi, did you solve the problem?

I'm facing the same problem at the moment.