Hello JK S,
Through AuthObject
While using the I_BEGRP AuthObject for your purpose (to represent Equipment Category) perhaps we will have to use the AuthorizGroup (BEGRU) field of Equipment master to represent the Equipment Category (EQTYP). Means whatever we are maintaining in Equipment Category we have to replicate in AuthorizGroup field. If you do not have any issues to sacrifice this field (BEGRU) for this purpose then you have the solution in standard. In my case under a single Equipment category, different AuthorizGroups were used for other purposes. One such example just for knowledge sharing is hereIH01 Structure Customizing beyond I_INGRP AuthObject
Through enhancement
In case you have decided to go the enhancement way (which I always find convenient in the areas where direct Authorization Objects are unavailable. Please check about the referred exit IWO10033. I do not have it in my system (ECC6.0) and I remember after release ECC4.7, this has been replaced by BAdi IWO1_ORDER_BADI. So if you also do not find the exit, you can try this BAdi.
My recommendation if enhancement route is selected
Though the control comes at Order SAVE event, I prefer user-exit IWO10009. This code first checks the Equipment category of the Equipment on which the Order is being created and if it is not the one you allow for Order then it throws an error at Order SAVE.
Suppose your Equipment category is 'M' which is OK for Order, then the code to be put in the include ZXWOCU07 of the exit IWO10009 will be:
DATA: v_eqtyp TYPE equi-equnr.
CLEAR v_eqtyp.
SELECT SINGLE eqtyp FROM equi INTO v_eqtyp WHERE equnr = caufvd_imp-equnr.
IF v_eqtyp IS INITIAL.
MESSAGE: 'Please fill Equipment field' TYPE 'E' DISPLAY LIKE 'I'.
ELSEIF v_eqtyp <> 'M'.
MESSAGE: 'You can not create Order for EquipCtgy other than ''M''.' TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
This throws the following error when the Equipment category is not 'M'.
Lastly
@Sebastian:
Kindly correct me, in case I went wrong somewhere in the first part of my reply (Through AuthObject) and also what I told in the context of exit IWO10033.
@JK S :
- Hope you will not get influenced by the length of a response received (like mine here). Understand the content and then go by your own suitability.
- In case you are going the user-exit way, the task for your ABAPer is very simple. He just puts the above code as suggested. Also it is very simple for him to extend the validity of Order creation for more Equipment Categories by making tiny changes in the code.
Regards & Good luck
KJogeswaraRao