Skip to Content
author's profile photo
Former Member

Lock work orders from custom transaction

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Sep 26, 2007 at 10: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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 27, 2007 at 08:03 PM

    I was able to implement the logic

    Add comment
    10|10000 characters needed characters exceeded