Application Development 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: 

Lock work orders from custom transaction

Former Member
0 Kudos

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

2 REPLIES 2

uwe_schieferstein
Active Contributor
0 Kudos

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

Former Member
0 Kudos

I was able to implement the logic