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

Check locked object

Former Member
0 Likes
12,814

Hi All,

How can we check if a particular record is locked or not? I have to display a set of orders and if the user clicks on a particular record another action needs to be performed based on if order is locked or not.

Thnks.

1 ACCEPTED SOLUTION
Read only

sridhar_k1
Active Contributor
0 Likes
7,793

Use FM ENQUEUE_READ to check the order is locked or not.

Regards

Sridhar

10 REPLIES 10
Read only

Manohar2u
Active Contributor
0 Likes
7,793

You can see the list of lock entries from SM12.

you need to find the lock object FM to know whether there are any locks applied.

FM's ENQUEUE_Table name

Regds

Manohar

Read only

Former Member
0 Likes
7,793

hi

The Function Module ENQUEUE_tablename will help you for this.

Check a list of locked records in transaction SM12.

Regards,

Richa

Read only

Former Member
0 Likes
7,793

What order is it..

is it sales order

CALL FUNCTION 'ENQUEUE_EVVBAKE'
 EXPORTING
   MODE_VBAK            = 'E'
   MANDT                = SY-MANDT
   VBELN                = VBAK-VBELN
   X_VBELN              = ' '
   _SCOPE               = '2'
   _WAIT                = ' '
   _COLLECT             = ' '
 EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Regards

vijay

Read only

Former Member
0 Likes
7,793

Hi,

Its a Asset Retirement Order.

Thnks.

Read only

0 Likes
7,793

What table are these in?

Rob

Read only

0 Likes
7,793

Simply do a call transaction for <u>change mode</u> that goes past the initial screen in <u>'N'</u>o display mode. If the transaction's error messages is due to missing BDC info, you are ok, but if it says that the object is locked, then it is locked.

Read only

sridhar_k1
Active Contributor
0 Likes
7,794

Use FM ENQUEUE_READ to check the order is locked or not.

Regards

Sridhar

Read only

0 Likes
7,793

Could you please help me with the parameters that have to be passed into the Enqueue_read function. I need to check if the order is locked or not.

Thnks

Read only

0 Likes
7,793

I would prefer to do a read on the table rather than using the FM Enqueue_read. The reason for not using enqueue_read is you need to know the argument name and its kind of difficult to read the arguments from the table returned by FM.

If you can post the table name, someone will help you in passing the parameters for locking the order.

hith

Sunil Achyut

Read only

0 Likes
7,793

You don't need to know anything with FM "ENQUEUE_READ" since all the parameters it needs are optional.

Just execute it and read the table that returns (from paramter ENQ) in its GNAME field you'll find the tables that are locked.

enjoy.

ayal.