cancel
Showing results for 
Search instead for 
Did you mean: 

user status on PM order

Former Member
0 Kudos

Hi Experts

Is there any way to block the change on PM order via user status.

Requirement is, when a user status is set to block the change in PM order, user should not allow to do any change in PM order unless the user status is set to allow for change.

Regards

Saidasan

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Saidasan,

In my opinion user-exit solution works well for such requirements. IWO10009 is the user-exit here. In your specific case the following code in include ZXWOCU07 would fulfill your requirement.


Assuming your user status is WCNP which should stop changes in Order, then the code is:


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 = 'E0001'.
       MESSAGE: 'You can not make changes in Order with ''WCNP'' status'
     TYPE 'E' DISPLAY LIKE 'I'.
     ENDIF.
   ENDLOOP.
ENDIF.

Note: 'E0001 ' value used in the code above, is the code for WCNP status in table TJ30T.

This code throws the following pop-up where user tries to change the Order which has WCNP user status set. If the userstatus is changed then the changes can take place.

Good luck

KJogeswaraRao

Answers (2)

Answers (2)

MTerence
Active Contributor
0 Kudos

Hi Sai,

This does not occur using user status, you need to try using user exit. Refer below thread and suggestion provided by Jogeswara

Regards

Terence

former_member200662
Active Participant
0 Kudos

Hi Saidasan

When you define the User Statuses in OIBS, double click on the user status after defining.

You can see the Business transactions. Click on create icon, you will have business process applicable.

You can block the business transaction as required there.

Regards

Pavan