09-26-2007 11:16 PM
Hi,
I have created a custom tcode that has functionality similar to IW32.
I need to implement locking similar to what iw32 implements ( not allowing to open work orders by 2 users at a time.)
Please provide me with sample code, how i can implement the same for my custom tocde.
Is there any possiblity to lock users from opening the work order from iw32 when they have already opened the same in my tcode.
CO_ZF_ORDER_LOCK_MULTI....is this the correct FM to use...
09-26-2007 11:41 PM
Hello Narendra
Function module <b>CO_ZF_ORDER_LOCK_MULTI</b> is the right one for locking. Use similar coding like in routine <b>ORDER_CHANGE</b> (include <b>LCOIHF3G</b>):
...
*--- Sperren (nicht im Anzeigen) --------------------------------------*
if tc10-trtyp <> y_trtyp_anz.
move-corresponding caufvd to ordt_pre.
if caufvd-prueflos is initial.
ordt_pre-kein_prlos = yx.
endif.
append ordt_pre.
call function 'CO_ZF_ORDER_LOCK_MULTI'
exporting
lock_mode = 'S'
tables
enqueue_tab = ordt_pre
not_locked = ord_pre.
describe table ord_pre lines sy-dbcnt.
if not sy-dbcnt is initial.
...
Regards
Uwe
09-27-2007 9:03 PM