cancel
Showing results for 
Search instead for 
Did you mean: 

Plant data of material lock by user XXX error in BAPI_GOODSMVT_CREATE

former_member15804
Participant
0 Kudos

Hello user ,

I am using BAPI_OUTB_DELIVERY_CHANGE for batch split after that I have used WS_DELIVERY_UPDATE for picking . and then using BAPI_GOODSMVT_CREATE .

but the bapi BAPI_GOODSMVT_CREATE is throwing error - Plant data of material lock by user XXX error .

I am using DEQUEUE_ALL after doing commit work . and there is no lock in SM12 .

can you please help me in this.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

DominikTylczyn
Active Contributor

Hello ak6155

To supplement jorgen_lindqvist41 response.

You shouldn't remove locks unless you have created them.

Make sure to call BAPI_TRANSACTION_COMMIT with WAIT = X after calling BAPIs, if you want synchronous update. I'd advise on BAPI_TRANSACTION_COMMIT instead of pure COMMIT WORK as BAPI_TRANSACTION_COMMIT performs additional activities. I do remember having problems when I used just COMMIT WORK instead of BAPI_TRANSACTION_COMMIT.

WS_DELIVERY_UPDATE function provides two parameters to control the update process:

  • COMMIT - if equals X, commit work is process by the function itself, so you don't need to call it explicietly
  • SYNCHRON - if equals X, update is processed synchronously.

In your case, I'd advise to set them both to X and don't use DEQUEUE_ALL!

Best regards

Dominik Tylczynski

joltdx
Active Contributor

I agree on everything.

joltdx
Active Contributor

Hi!

Well, locks are typically there for a reason, so be sure to remove them only if it is the right thing to do... Sometimes things also happen in the background or are not as quick as we want them to 🙂

Make sure you are you doing COMMIT WORK AND WAIT.

If you need to remove locks after that, and if it is the right thing to do (!)... Are you passing _synchron = 'X' to the DEQUEUE_ALL function module to have it wait until all entries are deleted from the lock table before it returns...

0 Kudos

Hi,

Please refer SAP Note 1985306

Best regards,

Venkata