Solved

Trying to synchronize objects between SAP and another system (ENQUEUE/DEQUEUE)

Posted on 2004-03-26
7
2,130 Views
Last Modified: 2013-12-08
I know that the non-SAP system can use the ENQUEUE_XYZ lock object function to keep SAP users out of the data while the non-SAP system “owns” the object, but I’m getting stuck when I want to replicate the changes in SAP. I have to DEQUEUE the lock object before I can call the BAPI or run the CALL_TRANSACTION to save the changes from the non-SAP system back into SAP. The problem is that there will be some (admittedly small) amount of time between my DEQUEUE and the BAPI or BDC’s lock. This means that it is possible that someone else could grab the object and make a change during that time, and then my BAPI or BDC would overwrite that change. Am I missing something about ENQUEUE/DEQUEUE here? I was hoping that SAP would realize that the same user that had originally requested the ENQUEUE was the one trying to do the update, but I guess this isn’t working because the BAPI/BDC takes place in its own LUW. Any ideas would be appreciated.
0
Comment
Question by:DeeDeeCee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 1

Expert Comment

by:Teehee99
ID: 10770527
Hi ,
ENQUEUE lock objects are the method SAP uses to lock SAP business objects (tables/fields etc..) . They are seperate to database locks as the databse knows nothing about business objects . So in ABAP ;

1) MANNUALLY Call lock object/ENQUEUE function module for that business object and your user in SAP(all other SAP users are locked out via SAP transactions if enqueue is successful but anybody non-SAP can still update the tables via the db)

2) MANNUALLY Call update for your user in SAP
(creates update request that SAP will then pass to db . If the table entries are not locked at the db level (by non-SAP ) process update . Db locks are only placed once the SQL to update is generated and applied . Released when the SQL finishes .

3) MANNULLY CALL DEQUEUE
call dequeue function module for your user and that business object . If successful lock is released and any other SAP user can try to lock the object

*SO , you must do all your work (call BAPI etc..) between 1) and 3) . The update in 2) can be finished but you can still hold your lock until you have dome other work ...then do 3) Why do you have to dequeue first ?
0
 

Author Comment

by:DeeDeeCee
ID: 10776571
Well, I'm dequeuing first because if I don't, the object is locked when I issue the CALL_TRANSACTION. That's what has me confused....
0
 
LVL 1

Expert Comment

by:Teehee99
ID: 10776713
I don't quite follow why from your description , so please explain your chain of events more clearly if I'm not understanding you correctly ...but can you not :

Call the lock object as SAP user ABC , do your SAP updates etc ... as SAP user ABC ...Keep the lock object (do not dequeue) , do your non-SAP updates via RFC/whatever  ..and when you get a final OK return code finally release with a dequeue .

Doing it this way using custom code and BAPI / function module /RFC calls rather than SAP transactions will allow you to control exactly when you dequeue rather than SAP dequeuing when the SAP transaction/LUW is complete .
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

Author Comment

by:DeeDeeCee
ID: 10777221
That's exactly what I tried. And during the "do your SAP updates" part I call RFC_CALL_TRANSACTION and it doesn't run successfully because the object is locked (by me! argh!). Which seems to defeat the purpose of the whole enqueue/dequeue concept.... If you're saying that what I was trying to do SHOULD have worked, then I don't know what's going on.
0
 
LVL 1

Accepted Solution

by:
Teehee99 earned 500 total points
ID: 10777680
I think I see the problem now ...tell me if I have the chain of events correct .

1) You have manually enqueued once already before the CALL TRANSACTION and left the lock in place .
2) CALL TRANSACTION will do a complete SAP transaction including automatic locking . That auto lock complains that the object is already locked (from 1) ..so you have to dequeue b4 the CALL TRANSACTION .

Yes , that is how SAP locking is supposed to work due to LUW concept as you mentioned . You could create a brand new lock object (EZxxxx) on the same object for 1) but CALL <SAP> TRANSACTION and other SAP transactions would only check for the SAP lock object for 2) as the check is done against the lock object name . If 1) and 2) use the same lock object name then you get the problem you are seeing .So neither way locks the object how you want  .

To guarantee no dequeing b4 you are finished you would need to develop your own program/transaction that did the whole job without calling a new transaction or ABAP statement that starts a new LUW .
0
 

Author Comment

by:DeeDeeCee
ID: 10777728
Yes, you've got it exactly. I was afraid that was going to be the answer. I was just hoping there was some sneaky little trick that I hadn't thought of! Since this needs to be done via CALL TRANSACTION, it looks like there is not a foolproof method of accomplishing this.

Thanks very much for your help.
0
 

Expert Comment

by:weandee
ID: 15097665
Hi

I need to know how you lock the object from NON-SAP.
I created a Lock Object in SE11 and Allow RFC yet, it cannot lock the object. And I dont know where it goes wrong.

Could you guide me in doing RFC- remote-enabled coz im using VB.Net, SAP.Net Connector to connect to SAP.

Your help would be much appreciated.

Thank you.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: You must have administrative privileges in order to create/edit Sharing Rules. Salesforce.com (http://www.salesforce.com) (SFDC) is a cloud-based customer relationship management (CRM) system. It is a database most commonly used by sales an…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question