Solved

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

Posted on 2004-03-26
7
2,073 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I showed you how to use console view (HERE (http://www.experts-exchange.com/articles/18379/Getting-Started-and-Using-the-Salesforce-com-Console.html)) -– but how do you set it up on the admin side of Salesforce? Note that you have to have Admin leve…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

773 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