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

Locking through BAPI

Former Member
0 Likes
616

Hi SDN,

I am updating a strandard Database table through BAPI.I can lock the object (an database entry ) through BAPI.But if i lock the object ,i am not able to update the database table. The BAPI gives an error message as 'Status is set as locked.so can't update'.Is it possible to lock the object and then update and then unlock the object through BAPI?

2 REPLIES 2
Read only

Former Member
0 Likes
388

I suppose you are talking about using ENQUEUE / DEQUEUE function calls when you say locking and unlocking. If you are using these functions to lock the particular table, then you should not get a problem while updating.

CALL ENQUEUE function

Update the table

CALL DEQUEUE function

Read only

Former Member
0 Likes
388

And don't forget to do a BAPI_TRANSACTION_COMMIT function call after the function is called.

If it is a BAPI without explicit COMMIT in it, and when you test it using SE37, no changes will be saved, while calling such a BAPI you should do a COMMIT yourself by calling the above function.