2007 Jul 19 4:48 PM
Hi, Is there any function module which checks the locking of a planned order?
I want to check whether a planned order is already being locked by some other user while I am processing the same. Thanks..
Hi, Is there any function module which checks the locking of a planned order?
I want to check whether a planned order is already being locked by some other user while I am processing the same. Thanks..
2007 Jul 19 4:51 PM
Hi,
go to following link.it will help u:
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=planned%20order&cat=sdn_all
Reward points if helpful.
Regards.
Srikanta Gope
2007 Jul 19 5:00 PM
Check the below code :
Lock the planned order : 'ENQUEUE_EMPLAFE'
Unlock the planned order :'DEQUEUE_EMPLAFE'
data i_plaf like plaf occurs 0 with header line.
select * from plaf into table i_plaf
PLNUM = '0000999923'.
loop at i_plaf.
Lock planned order
CALL FUNCTION 'ENQUEUE_EMPLAFE'
EXPORTING
plnum = i_plaf-plnum
_scope = '3'
EXCEPTIONS
foreign_lock = 2
system_failure = 3.
IF sy-subrc > 0.
message
ENDIF.
clear : w_cm61w.
Get MRP control indicator at plant level
CALL FUNCTION 'MD_READ_PLANT'
EXPORTING
ewerks = i_plaf-plwrk
IMPORTING
icm61w = w_cm61w.
Delete planned order
CALL FUNCTION 'LOESCHEN_PLANAUFTRAG'
EXPORTING
ecm61w = w_cm61w
eplaf = i_plaf
EXCEPTIONS
undefined_interface = 1
OTHERS = 2.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
MOVE: i_plaf-plnum TO i_error-order,
text-012 TO i_error-messg.
i_error-val = 'E'.
APPEND i_error.
CLEAR i_error.
continue.
ENDIF.
Unlock planned order
CALL FUNCTION 'DEQUEUE_EMPLAFE'
EXPORTING
plnum = i_plaf-plnum.
endloop.
Reward Points if helpful.
Thanks
Seshu
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |