on 07-12-2016 9:43 AM
Dear Experts,
I have a case, where maintenance order user status are set using z tcode and can be set using iw32. but some users do not follow the designed process and bypass the process by changing user status through iw32.
Now can i restrict change of user status through iw32. what are the possible ways to handle it?? if i restrict iw32, users would not be able to do their other tasks. Please help...
pawan
Responding to your initial query.
Solution
User-exit: IWO10009
Put the following code int he include of the exit (ZXWOCU07).
DATA: itab TYPE TABLE OF jcds,
wa TYPE jcds,
v_stat TYPE tj30t-txt04.
SELECT * FROM jcds INTO TABLE itab WHERE objnr = caufvd_imp-objnr AND cdtcode = 'IW32' AND inact = ''.
SORT itab BY chgnr DESCENDING.
DELETE ADJACENT DUPLICATES FROM itab COMPARING objnr.
LOOP AT itab INTO wa.
CLEAR: v_stat.
SELECT SINGLE txt04 FROM tj30t INTO v_stat WHERE estat = wa-stat AND stsma = 'PM_ORD1'.
IF v_stat <> caufvd_imp-asttx+0(4).
MESSAGE: 'User status change is not permitted from ''IW32''.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
ENDLOOP.
This throws the following error whenever the user status is attempted to be changed using IW32.
NOTE:
IF caufvd_imp-auart = 'PM02'.
<above code here >
ENDIF.
Good luck
KJogeswaraRao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pawan,
There are two ways on doing this
1. Authorization
You need to discuss with Basis / Security team to built up authorization.
Based on the limitation you provide, different roles can be created to control the process to access User Status. These roles will be assigned to specific user.
2. User Exit
You need to contact your abap team and provide your requirement to control the usage of User Status. They will create programs to do it.
In case if you are a end user, contact your Functional Consultant.
Regards
Terence
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Maria,
Thanks for the reply
OPTION 1: it does not look feasible as user does the same process using designed ztcode and should not allowed to iw32. if i restrict it using role, other authorisation to set user status also failed in z code as it is calling standard bapi to change the status.
OPTION 2: It seems feasible but everyone including superusers could not do it using iw32 if i do it this way.
So i am still confused??
Hi Pawan,
Will the user access both IW32 and Ztcode ? If not, then you need to have separate roles for IW32 and Ztcode with user status.
In one of our client, we have hard code a role in the program like changing basic start date of the work order. So the user with the specific role can change the basic start date, else system will display an error. This was done using role and user exit.
With the solution Jogeswara provided, if we are able to restrict with one status, then for sure we can have multiple user status. You need to discuss with your abaper, abaper will be able to resolve your issue.
Regards
Terence
User | Count |
---|---|
96 | |
7 | |
6 | |
6 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.