Skip to Content
avatar image
Former Member

Handling object locking in R/3 from WD through RFC

Hi all,

We implements application which uses R/3 backend to store and retrieve data, and to make application logic at that level in ABAP. We are experiencing problems how to solve locking of tables in such a scenario. We are accessing R/3 through Adaptive RFC from Webdynpro application.

We tried function for locking 'ENQUEUE_E_TABLEE', but it seems that lock expires with the end of RFC function.

Can anyone point me to some material or better simple tutorial with this issue ? How can I properly solve the problem of accessing common resource (in this case table or RFC function) ?

Thanks for any help,

Best Regards,

Miroslav Koskar

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 26, 2006 at 08:50 PM

    Hi there,

    You said that the lock expired at the end of RFC session. Why would you need the lock to exist after end of processing of the RFC function anyway? I think that you have to handle the processing steps concerned within the enqueue and dequeue functions inside the RFC function itself.

    Does it make sense?

    LM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Miroslav,

      The blog reference which Raj had given in his reply is a very useful one. Did you try implementing the solution mentioned in the blog?

      I think these are the steps you need to follow to implement it. Anybody please correct me if I am wrong.

      -Create a RFC function in SAP exclusively for calling the locking function. Similarly, one function for unlocking as well.

      -Import this RFC as an adaptive RFC model, using your own custom controller, having only one model class(I am suggesting this as per the blog snippet which says that you have to reserve the connection by not grouping it with any other model objects. Please correct me again, if thats not the case).

      -In your WD application, before the user enters in form editing for customer order, call this Adaptive RFC function, by explicitly mentioning APPLICATION_SCOPE in the constructor.

      eg:ZBapi_lock_order_input in = new ZBapi_lock_order_input(WDModelScopeType.APPLICATION_SCOPE);

      -Go to SM12 in R/3 and check whether lock is created for the key.

      -After user saves/exits the order, call the adaptive RFC function for unlocking.

      I have not tried it, so please let me know if this solves the problem.

      Cheers,

      LM