Q
Problem solve Get help with specific problems with your technologies, process and projects.

Problem with a sales order locking

When the sales order is created from IDoc, events get triggered for both scenarios. Before completing ORDERREPLEN, ORDERGATE is coming and checking for same sales order and finding it locked and all the forecast checks for customer are failed.

I have a locking problem with a sales order when the event created is triggered for Business Object BUS2032, for two cases.

In event linkage setting, there are two scenarios for which we had made entries. The first one is for order replenishment...

logic and second one is order gate (customer forecasting) logic.

Tcdoe: SWLD Utlities->Events->Linkage
Object Event Reciever FM
BUS2032 Created ORDERREPLEN
BUS2032 Created ORDERGATE 

For both FM, we are using BAPI for updating the sales order which is 'BAPI_SALESORDER_CHANGE.

The problem is that when the sales order is created from IDoc, events get triggered for both scenarios. Before completing ORDERREPLEN, ORDERGATE is coming and checking for same sales order and finding it locked and all the forecast checks for customer are failed.

NOTE: As per client standard, I can't use WAIT command in FM, so I need to check with you. Is there any other way to handle the locking issue?

I also wonder if there is a way so that we can say which FM will process first when we put serialization in event Linkage/Workflow for the same business object.

You have a few options:

1. Consider whether it is correct for both events to trigger. You can always use a Check Function Module to prevent a particular event from being raised. Of course this all depends on whether you can detect this condition. Perhaps there is some indicator on the business object (or table which you could add) which indicates that this was processed from the IDoc.

2. Even if a lock does occur, why does your workflow fail? Enqueue errors should be modeled as temporary exceptions on the methods. Thus, when they are raised, the workflow will automatically retry the step after waiting 5 minutes (or what ever your system setting is). Usually this try, retry approach takes care of locking issues.

3. You could always deliver one of the events to the event queue. This will delay the delivery of this event and thus resolve your locking issue.

This was last published in April 2005

Dig Deeper on SAP workflow development

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close