cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict SPECIFIC Users to change field ITOB-KOSTL (Cost Center) in IE02

Former Member
0 Kudos

Hi Experts

Would just like to request your assistance on this. We have a new requirement wherein our Plant Maintenance work centers/users should be restricted in changing the value of the field ITOB-KOSTL (Cost Center) in the Transaction Code IE02 (Change Equipment). The main goal is to have specific users be restricted in changing this field. If you access transaction code IE02, under "Organization" tab, you can see that the Cost Center field may be changed/edit by the user. What we want to achieve is that for certain users, when they access IE02, this field will be grayed out. Will this be possible?

Appreciate your help.

Thank you and best regards

Natz

Accepted Solutions (1)

Accepted Solutions (1)

jogeswararao_kavala
Active Contributor
0 Kudos

Hello Nathaniel,

In case you are unable to do this through other methods the following is a hassle-free method of doing it through the user-exit IEQM0003. I have just tested your requirement and got this error when unauthorized user changed the KOSTL field and tried to Save the Equipment.

The code (to be put in the include ZXEQMU02 of the user-exit IEQM0003):

DATA: lv_kostl TYPE iloa-kostl,
       lv_uname TYPE sy-uname.
CLEAR: lv_kostl, lv_uname.

SELECT SINGLE uname FROM ztable into lv_uname WHERE uname = sy-uname.
IF lv_uname <> sy-uname.
   SELECT SINGLE kostl FROM v_equi INTO lv_kostl WHERE equnr = data_equi-equnr.
   IF data_iloa-kostl <> lv_kostl.
     MESSAGE: 'You are not authorized to change the Cost Center'TYPE 'E' DISPLAY LIKE 'I'.
   ENDIF.
ENDIF.

So question is how the system identifies the user is authorized or not ? The naswer is you need to maintain a Ztable for authorized users. It can be a single field z table (having only UserId) or two field table having userID and name. The same ztable I referred as ztable in the above code. The code first checks whether the current user is listed in the Ztable or not (line 4). If not (line5) then it retrieves the previous value of KOSTL (line6) and compares this with current value of KOSTL (data_iloa-kostl). If these 2 values are different, then it throws the error pop-up. If the user is listed in the ztabe (at line4) , then the code does not enter the next lines and the changes take place.

Though I have tested this, you can fine tune the code if so needed by your ABAPer.

Good luck

KJogeswaraRao

Former Member
0 Kudos

Hi Jogeswara

     Thank you very much for your assistance. Will consult this with our ABAP and update you once done.

Best Regards

Natz

Former Member
0 Kudos

Hi Jogeswara

     Could you help us here please. Our ABAP has already implemented the codes you have provided above however the program fails to call the User exit IEQM0003. Are there suppose to be additional requirements that needs to be met in order to use this User Exit?

jogeswararao_kavala
Active Contributor
0 Kudos

Yes,

- A project with name like ZPMEQUI to be created in 210 server with tcode CMOD and then IEQM0003 to be assigned to it in the Enhancements button. Activate it. Test it and Transport it. Then the user-exit would start functioning.

I did not touch upon this because, this is a pre-requisite for any user-exit implementation, ABAPers know normally.

peter_atkin
Active Contributor
0 Kudos

Natz,

Get your ABAPer to put a hard-coded break-point command at the top of user-exit IEQM0003.

Then re-test.

PeteA

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check Authorization object I_KOSTL and Field name KOSTL, assign this to required users for authority.

Regards

Vivek

rakesh_mane
Active Contributor
0 Kudos

Hello

Please check with SAP Security team and find authorization object (such as I_KOSTL)


assign this object to user id


Br

Rakesh

MTerence
Active Contributor
0 Kudos

Hi Nathaniel,

1. Check Transaction Variant SHD0 for specific users, there you can assign users with this variant.

2. Check any Save Exit for Equipment, you can check with your Abaper how to fix it.

Regards

Terence

Former Member
0 Kudos

Hi Maria

     Thank you for your suggestion. In my understanding, by using SHD0, we are to create a new transaction code for the customization that we would like to apply. This is the case we want to avoid. Is there a way to assign specific users that will restrict them in changing ITOB-KOSTL field in the standard transaction IE02?

Thank you and best regards

Natz

MTerence
Active Contributor
0 Kudos

Hi Nathaniel,

I guess Jogeswara suggestion of coding is the best option

Regards

Terence