Problem with a sales order locking

Problem with a sales order locking

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.

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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 first published in April 2005

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.