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

Planned Order Check

Former Member
0 Likes
677

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..

2 REPLIES 2
Read only

Former Member
0 Likes
604

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

Read only

Former Member
0 Likes
604

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