Skip to Content
avatar image
Former Member

Non editable order in certain system status

Dear All,

I need to have check in maintenance order based on system status. If status equal 'iwa05' then order must be non editiable in tcode w32. Badi iwo1_screen_modify does not work correctly. How I can to open order in iw32 like in iw33?

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Dec 26, 2014 at 12:33 PM

    Hello Pavel Lazhbanov,

    You can use the following code in the user-exit IWO10009 (include ZXWOCU07). What it does is: When you are in IW32 and trying to Save an Order with RIPR status (IWA05), it simply does not allow you to Save. It throws the following error. It is as good as IW33.

    Error pop-up

    The code

    DATA : I_STAT LIKE JSTAT OCCURS 0 WITH HEADER LINE.
    
     CALL FUNCTION 'STATUS_READ'
       EXPORTING
         OBJNR       = CAUFVD_IMP-OBJNR
         ONLY_ACTIVE = 'X'
       TABLES
         STATUS      = I_STAT.
    
     IF SY-TCODE = 'IW32'.
     LOOP AT I_STAT.
       IF I_STAT-STAT = 'IWA05'.
        MESSAGE: 'You can not make changes in Order with ''RIPR'' status'
        TYPE 'E' DISPLAY LIKE 'I'.
       ENDIF.
      ENDLOOP.
     ENDIF.
    

    Hope this suits to you.

    KJogeswaraRao


    pop-up.PNG (5.1 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 31, 2014 at 08:38 AM

    A have implemented enhancement  in functiom group COIH :

    enhancement 122  zpm_mvob_stat.    "active version

    data: ls_jest type jest,

           lt_status type standard table of jstat.

    field-symbols : <wa_status> like line of lt_status,

                    <fs_tc10> type any.

    if caufvd-auart = 'INSP' and sy-tcode = 'IW32'.

       call function 'STATUS_READ'

         exporting

    *     CLIENT                 = SY-MANDT

           objnr                  = caufvd-objnr

          only_active            = 'X'

    *   IMPORTING

    *     OBTYP                  =

    *     STSMA                  =

    *     STONR                  =

        tables

          status                 = lt_status

        exceptions

          object_not_found       = 1

          others                 = 2

                 .

       if sy-subrc <> 0.

    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

       endif.

       loop at lt_status assigning <wa_status> where stat = 'IWA05'.

         assign 'TC10' to <fs_tc10>.

         check sy-subrc = 0.

         tc10-trtyp = 'A'. " replace 'V' by 'A'

         message s122(zpm).

       endloop.

    endif.

    endenhancement.

    *$*$-End:   (1 )--------------------------------------------------------------------------------$*$*

    endform.                               " ABLAUF

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 26, 2014 at 02:27 PM

    Pavel Lazhbanov,

    Replace the above code as given under. Above code might give problem at the Save event when RIPR attains for the fisrt time. Code below takes care of that.

    DATA:I_STAT LIKE JSTAT OCCURS 0 WITH HEADER LINE,
          L_OBJNR TYPE J_OBJNR.
    
    SELECT SINGLE OBJNR FROM AUFK INTO L_OBJNR 
    WHERE AUFNR = CAUFVD_IMP-AUFNR.
    
    CALL FUNCTION 'STATUS_READ'
    EXPORTING
         OBJNR       = L_OBJNR
         ONLY_ACTIVE = 'X'
    TABLES
         STATUS      = I_STAT.
    IF SY-TCODE = 'IW32'.
    LOOP AT I_STAT.
    IF I_STAT-STAT = 'IWA05'.
           MESSAGE: 'You can not make changes in Order with ''RIPR'' status'
    TYPE 'E' DISPLAY LIKE 'I'.
         ENDIF.
       ENDLOOP.
     ENDIF.
    

    KJogeswaraRao

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 19, 2015 at 02:15 PM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded