cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict end user to change confirmed operations text in a work order

Former Member
0 Kudos

Hi,

I am looking for an option to restrict end user to make operation text changes once operation is confirmed.

We are not able to achieve this functionality by writing the code in user exit IWO10009, since it's being table control once any of the operation is confirmed it's not allowing to change in other (non confirmed) operations text changes of same work order.

I tried to configure user status for operations, and selected "CHANGE" as forbidden for one of the user status, still system is allowing to operation text changes in spite having relevant user status. What does this CHANGE represents?

I have checked on final confirmation config too, did not help!

I understand that the change log for operations displays all the changes related to operation text.

Please let me know your thoughts.

Thanks,

N.Nagaraju

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Nagaraju,

Here is the solution.

Objective:

This code prevents changes in Operation text if the Operation is in confirmed status.

Notes:

  • This prevention error triggers only when such operation is in fully confirmed status
  • This prevention error triggers while Saving the Order.
  • If the confirmation of operation is cancelled (IW45), then the text changes take place.
  • This does not stop you from making text changes in operations of other statuses.
  • This does not stop from adding or deleting operations.

The following code to be used in the include ZXWOCU07 of user-exit IWO10009 .


IF caufvd_imp-iphas <> '0' AND sy-tcode = 'IW32'.

   DATA: vbkz TYPE afvgb-vbkz.

   DATA: i_afvc TYPE STANDARD TABLE OF viauf_afvc,

         wa1 LIKE LINE OF i_afvc.

   SELECT * FROM viauf_afvc INTO TABLE i_afvc WHERE aufnr = caufvd_imp-aufnr.

   DATA: BEGIN OF i_afvg OCCURS 100.

           INCLUDE STRUCTURE afvgd.

   DATA:END OF i_afvg.

   DATA: wa2 LIKE LINE OF i_afvg.

   CALL FUNCTION 'CO_BO_AFVGBT_GET'

     EXPORTING

       aufnr_imp  = caufvd_imp-aufnr

     TABLES

       afvgbt_exp = i_afvg[].

   LOOP AT i_afvc INTO wa1.

     READ TABLE i_afvg INTO wa2 WITH KEY objnr = wa1-objnr.

     IF sy-subrc = 0.

       DATA:i_stat LIKE jstat OCCURS 0 WITH HEADER LINE.

       CALL FUNCTION 'STATUS_READ'

         EXPORTING

           objnr       = wa1-objnr

           only_active = 'X'

         TABLES

           status      = i_stat.

       LOOP AT i_stat.

         IF i_stat-stat = 'I0009'.

           IF wa1-ltxa1 <> wa2-ltxa1.

             MESSAGE: 'You can not make changes in texts of confirmed Operations'

           TYPE 'E' DISPLAY LIKE 'I'.

           ENDIF.

         ENDIF.

       ENDLOOP.

     ENDIF.

   ENDLOOP.

ENDIF.

This triggers the following error pop-up, while saving the Order, in case some text changes are found in any one of the confirmed operations of the Order.

Upon hitting the Enter key the popup goes away and user gets access to correct the changes made and Save the Order.

Believe this is the solution you are looking for.  Implement with support of ABAPer, if you are not one.

Good luck

KJogeswaraRao

Former Member
0 Kudos

Hello Sir,

It has worked, thanks a lot for your inputs and code.

Thanks and regards,

N.Nagaraju

Answers (1)

Answers (1)

MTerence
Active Contributor
0 Kudos

Hi,

Have you gone through below document.

May be Jogeswara can provide more info on the same

Regards

Terence

Former Member
0 Kudos

Hi,

I saw this thread earlier but my requirement is little bit different. I don't want to stop user adding operations and changing text based on order  header, user or system status.

Thanks for your inputs!