Skip to Content

Stop users to use Material of other plant

Hi Gurus

My requirement is to restrict user who do not support a specific BU should receive an error message not allowing them to enter in a plant that they do not represent.

If user supports plant 2010 & he uses material of plant 2013 system is allowing to use it thought 2013 falls in different company code

How can I stop it.I don't want to create derived roles plant wise.

Please suggest what will be alternate method to stop user to use material of other plant.



Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on Sep 07, 2016 at 03:40 PM

    ek v

    I'm assuming that your requirement is while filling Components tab in Order.

    First create a Ztable to link User to a Plant. Let's say this table to be ZPM_USR_PLNT. Means this table has two fields UNAME (userId) and WERKS(Plant). Maintain UserId vs Plant data in this table.

    Then put the following code in the include ZXWOCU07 of the user-exit IWO10009.

    DATA: v_werks TYPE werks_d.

    FIELD-SYMBOLS: <fs_resb> TYPE any.

    DATA: BEGIN OF i_resb OCCURS 0.


    DATA:END OF i_resb.

    ASSIGN ('(SAPLCOBC)resb_bt[]') TO <fs_resb>.

    i_resb[] = <fs_resb>.

    SELECT SINGLE werks FROM zpm_usr_plnt INTO v_werks WHERE uname = sy-uname.

    LOOP AT i_resb.

    IF i_resb-werks <> v_werks.

    MESSAGE: 'Not authorized for this material.' TYPE 'E'.



    UNASSIGN <fs_resb>.

    After this whenever a user tries to enter a Material which is not available in the plant to which he belongs (as per Ztable), the system throws this error in the status bar at the time of Order Save.

    I have tested this code, works fine. You can fine tune the code with the help of your ABAPer, if required.

    Good luck


    1.JPG (9.8 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2016 at 07:05 AM


    Try user-exit PPCO0023 (see TCode SMOD).

    This way you make the required checks each time a material is entered, and if they fail, then the material is automatically removed from the Components tab.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2016 at 07:13 AM

    ek v

    PPCO0023 was not recommended consciously due to one issue there. When you trigger error you can not continue for correcting. You have to forcibly come out of the order. This was practically experienced by many and no known solutions are there. Recently Faisal khan sacrificed that exit for a similar requirement and adopted the solution using exit IWO10009.

    Presently I am unable to give you the link.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2016 at 07:23 AM

    ek v

    The link I am talking about, where first I suggested ppco0023 and then we concluded the discussion with a solution using iwo10009.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.