cancel
Showing results for 
Search instead for 
Did you mean: 

restriction on components withdrawals in PM order for specific users

Former Member
0 Kudos

How do you restrict certain users from withdrawing materials using PM orders.

Either the material tab should not be visible or they should not be allowed to enter any items in the components tab

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Praneet,

Put this code in the include ZXWOCU07 of User Exit IWO10009.


DATA: L_COUNT TYPE I,
       L_LINES TYPE I.

FIELD-SYMBOLS: <FS_RESB> TYPE ANY.

DATA: BEGIN OF I_RESB OCCURS 100.
         INCLUDE STRUCTURE RESB.
DATA:END OF I_RESB.

ASSIGN ('(SAPLCOBC)resb_bt[]') TO <FS_RESB>.
I_RESB[] = <FS_RESB>.

SELECT COUNT( * ) INTO L_COUNT FROM RESB
WHERE AUFNR = CAUFVD_IMP-AUFNR.

DESCRIBE TABLE I_RESB LINES L_LINES.

IF ( SY-UNAME = 'TEST_USER1'  OR SY-UNAME = 'TEST_USER2'  )

AND L_LINES <> L_COUNT.
   MESSAGE  ' Sorry! Component additions are not authroized.'

TYPE 'E' DISPLAY LIKE 'I'.
ENDIF

With this code:

When Users, namely  TEST_USER1 and TEST_USER2  will add lines in components during Create or Change (IW31 or IW32) and Click Save they get this error. Hope you understood that you need to put your UserIds in place of the UserIds mentioned above.

The same logic can be extended to prevent changes in the existing component lines by these persons. (Your ABAPer will easily be able to do these with the above inputs)

Hope this satisfies your requirement.

Best of Luck

Jogeswara Rao K

Former Member
0 Kudos

Thank you sir..

Will definitely check out

Answers (1)

Answers (1)

peter_atkin
Active Contributor
0 Kudos

Praneet Sadekar,

I'm a little confused with your question:


How do you restrict certain users from withdrawing materials using PM orders.

Do you mean withdrawing stock items against a work order? And/or do you mean adding components to the work order??

PeteA

Former Member
0 Kudos

The components tab should be freezed for the user so that he cant add, delete or modify any line item in the Work order components tab.

The basic requirement is that the rights needs to be given for only confirmation of operations, for orders based on the Preventive maintenance checklist for a particular equipment

peter_atkin
Active Contributor
0 Kudos

Praneet Sadekar,

We are currently using user-exit CNEX0037 to inhibit users adding materials to the work order Components tab. With this user-exit you don't have to wait till the order SAVE event to make the check (as with IWO10009 above).

We have included a new authorisation object in this development to allow Super Users to add materials if required. A popup is issued if the user is not authorised, and the material is automatically removed from the Components tab.

PeteA