cancel
Showing results for 
Search instead for 
Did you mean: 

Non editable order in certain system status

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks. I have do it. and it work. But can i make all fields grey as in iw33?

jogeswararao_kavala
Active Contributor
0 Kudos

This requirement might be possible in ABAP route only but with an ABAPer of high skills. There might be an alternative method to achieve this effect with Status Profile (OIBS) and related Authorization Objects. But here too IW32 turning into IW33 like greyed-out, I doubt the possibility.

Former Member
0 Kudos

Using OIBS we can configure user status, but not system status.

Thank you

jogeswararao_kavala
Active Contributor
0 Kudos

My mistake, Ignore that point.

Answers (3)

Answers (3)

karthik_snair
Participant
0 Kudos

This message was moderated.

Former Member
0 Kudos

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

jogeswararao_kavala
Active Contributor
0 Kudos

Hello  Pavel,

Thank you for sharing your Solution. I tried this and working OK. There is an observation: If you have an Integrated Notification for this Order type, then the Notification fields in Order can not be greyed out with this method. Above mentioned user-exit could be made use in such case. Just a view.

Regards

KJogeswaraRao

Former Member
0 Kudos

I have implemented this user-exit too

Thanks

jogeswararao_kavala
Active Contributor
0 Kudos

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