Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with locks

Former Member
0 Kudos

Hi all.

I have problem with locks. I am using in loop BAPI:

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'

EXPORTING

post_wrong_entries = lv_post

testrun = lv_testrun

IMPORTING

return = ls_bapiret1

TABLES

timetickets = lt_bapi_pp_timeticket

goodsmovements = lt_bapi2017_gm_item_create

link_conf_goodsmov = lt_bapi_link_conf_goodsmov

detail_return = lt_bapi_coru_return.

But as a result of material movements with are triggered with that BAPI i often have mistake: Plant data for Material xxxx are blocked yb user yyyy (confirmation is ok but errors are shown for material movements in COGI transaction). It happens for posted material and for its ingrediens too.

TO avoid i have tried:

- enqueue and dequeue for :

FUNCTION 'DEQUEUE_EMMARCE'.

FUNCTION 'DEQUEUE_EMRKPF'.

FUNCTION 'DEQUEUE_ESORDER'.

- commit work and wait.

-'BAPI_TRANSACTION_COMMIT'

-'Dequeue_all' after bapi commit.

- set update task local

What more can i do ?? I am comletly exhausted of fimdimg a way to fix it.

(wait for x second of course work fine but it isnt a solution i want to use, i'd prefer lock managing based solution)

Any help will be appriciated.

BR< Jacek

Message was edited by: Jacek Slowikowski

Message was edited by: Jacek Slowikowski

Message was edited by: Jacek Slowikowski

1 ACCEPTED SOLUTION

sridhar_k1
Active Contributor
0 Kudos

SAP provided decoupling of goods movements from confirmations to avoid scenarios like this. Refer to the following SAP library documentation:

<a href="http://help.sap.com/saphelp_erp2004/helpdata/en/b1/c04d42439a11d189410000e829fbbd/frameset.htm">Decoupling Processes Carried out During Confirmation</a>

If the functionality is implemented, the BAPI posts the confirmations and stores the goods movemts to be processed by a background job later.

Regards

Sridhar

5 REPLIES 5

Former Member
0 Kudos

put a wait before the function module i think it wil lsolve the issue

Harish

Former Member
0 Kudos

Hi,

Use FM RZL_SLEEP .

Regards

Amole

LucianoBentiveg
Active Contributor
0 Kudos

Run program in debug mode, after BAPI call, go to SM12 to see locked objects, then add those 'DEQUEUE'.

Regards.

sridhar_k1
Active Contributor
0 Kudos

SAP provided decoupling of goods movements from confirmations to avoid scenarios like this. Refer to the following SAP library documentation:

<a href="http://help.sap.com/saphelp_erp2004/helpdata/en/b1/c04d42439a11d189410000e829fbbd/frameset.htm">Decoupling Processes Carried out During Confirmation</a>

If the functionality is implemented, the BAPI posts the confirmations and stores the goods movemts to be processed by a background job later.

Regards

Sridhar

sridhar_k1
Active Contributor
0 Kudos

I see that u've tried SET UPDATE TASK LOCAL. local update deactivates immediately after commit work.

if ur bapi call is in a loop, set update task local should be called before the bapi call every time.

Regards

Sridhar