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

Deleting lock entries thru' Program

Former Member
0 Likes
429

Hi All,

I am having the below scenario,

From a Ztcode --> VL02N --> BADI --> BAPI (Goods mvnt - 101) ,

at this point BAPI is throwing an Error message " MATNR is locked by user" ..

so before calling the BAPI, i used the below code to unlock..

DATA : LV_MATNR TYPE MARC-MATNR,
         LV_WERKS TYPE MARC-WERKS.

  LV_MATNR = P_GIT_LIPS_MATNR.
  LV_WERKS = P_GIT_LIPS_WERKS.

  CALL FUNCTION 'DEQUEUE_EMMARCE'
   EXPORTING
     MODE_MARC       = 'E'
     MANDT           = SY-MANDT
     MATNR           = LV_MATNR
     WERKS           = LV_WERKS
*     X_MATNR         = ' '
*     X_WERKS         = ' '
     _SCOPE          = '3'
*     _SYNCHRON       = ' '
*     _COLLECT        = ' '
.

but still the BAPI is giving the same error message...

kindly suggest..

With Rgds,

S.Bharani

Hi All,

I am having the below scenario,

From a Ztcode --> VL02N --> BADI --> BAPI (Goods mvnt - 101) ,

at this point BAPI is throwing an Error message " MATNR is locked by user" ..

so before calling the BAPI, i used the below code to unlock..

DATA : LV_MATNR TYPE MARC-MATNR,
         LV_WERKS TYPE MARC-WERKS.

  LV_MATNR = P_GIT_LIPS_MATNR.
  LV_WERKS = P_GIT_LIPS_WERKS.

  CALL FUNCTION 'DEQUEUE_EMMARCE'
   EXPORTING
     MODE_MARC       = 'E'
     MANDT           = SY-MANDT
     MATNR           = LV_MATNR
     WERKS           = LV_WERKS
*     X_MATNR         = ' '
*     X_WERKS         = ' '
     _SCOPE          = '3'
*     _SYNCHRON       = ' '
*     _COLLECT        = ' '
.

but still the BAPI is giving the same error message...

kindly suggest..

With Rgds,

S.Bharani

1 REPLY 1
Read only

MarcinPciak
Active Contributor
0 Likes
389

Try tcode SM12 for releasing locks from a table.

Regards

Marcin