Application Development and Automation 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: 
Read only

BAPI and lock

Former Member
0 Likes
903

Hi all,

I need to check for lock before executing a specifi BAPI. How can I carry out that? Thanks in advance.

7 REPLIES 7
Read only

Former Member
0 Likes
844

Use the enqueue function module for that lock object. The function module name will be ENQUEUE_ followed by the LOCK NAME. If the function module returns a sy-subrc value other than 0, then the object is already locked.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

0 Likes
844

How can I determine the lock name or lock name for a specific BAPI?

Read only

0 Likes
844

It would be the SAP document that you are checking the lock for not the BAPI.

Read only

0 Likes
844

Yes, I understand. Example, if I'm calling the BAPI_PO_CHANGE, how can I determine what lock objects that need to be checked?

Read only

0 Likes
844

Hi mil,

1. While executing the bapi, if the purhcase order is locked by somebody,

then the bapi will return that error automatically.

2. We need not check it separately.

regards,

amit m.

Read only

0 Likes
844

I understand that, but I need to know what are the lock object and how can I check for that lock object. My problem is not to know whether the BAPI is locked or not.

Read only

0 Likes
844

Hi again,

1. U can use the FM

<b>MM_ENQUEUE_DOCUMENT</b>

2. This is also used in the standard program. While enqueing,

if there is any error (sy-subrc <> 0), then it means,

that particular purchase order is already locked.

regards,

amit m.