cancel
Showing results for 
Search instead for 
Did you mean: 

Block a plant for one user

Former Member
0 Kudos

Hi,

Can any one suggest,how to block a particular plant for one user.

He should not allowed to use any material from that plant in VA01 or VA02.

Thanks,

Prabhu.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi

I have done with the user exit MV45AFZZ.Thank you for your post.

Thanks,

Prabhu.

former_member220617
Contributor
0 Kudos

Dear prabhu ,

thank you for your reply .

Regards,

C.B Reddy.

former_member220617
Contributor
0 Kudos

Dear prabhu,

As per you scenario,you have to go for custom logic which you have create in MV45AFZZ-USEREXIT_MOVE_FIELD_TO_VBAP, for va01 and va31. The
user id has to maintain in dynamic table as per the below screen shot and you
have to restrict at change level also. For va02 and va33 you have to write the
logic in MV45AFZZ-USEREXIT_READ_DOCUMENT.

Logic –

If SY-TCODE = 'VA01' OR SY-TCODE = 'VA02' OR SY-TCODE = 'VA31' OR SY-TCODE = 'VA32'.
IF VBAP-WERKS <> ' '.

   
DATA: IT_ZSD_PLANT_AUTH TYPE ZSD_PLANT_AUTH,

          WA_DYN_VAL
TYPE ZSD_TBL_DYN_VAL.

   
CLEAR: IT_ZSD_PLANT_AUTH.
   
SELECT SINGLE * FROM ZSD_PLANT_AUTH CLIENT SPECIFIED INTO IT_ZSD_PLANT_AUTH

                            
WHERE  MANDT = SY-MANDT AND

                                    AUSER
= SY-UNAME AND

                                    APLANT
= VBAP-WERKS AND

                                    ZORDER_C
= 'X'.

   
IF SY-SUBRC <> 0.

     
MESSAGE E000(8I) WITH 'You are not authorized to create/change/display orders for this plant : ' VBAP-WERKS.

Regards,

C.B Reddy.

former_member183424
Active Contributor
0 Kudos

There are no standard authorization object to restrict plant in VA01.

You have 2 following options.

1. Consult with your BASIS consultant, he will create a custom authorization object for plant in VA01.

2. By using the exit MV45AFZZ, consult with your ABAP team for more details.

former_member187652
Contributor
0 Kudos

Hi Prabhu,

on top of my head, user can be restricted to certain sales org, and plant need to be assigned to sales org and distribution channels.

so based on business background, is it possible to maintain the restriction at sales org level and maintain the sales org-plant assignment accordingly?

naveen_kaluti
Active Participant
0 Kudos

HI Shichang,

Just a thought, a sales area could be selling from several plants and if the user is blocked for a sales area, then he wont be able to sell from other plants as well right? so it makes sense just to block him for a single plant.

Hope it makes sense.

Regards

Naveen K.

Former Member
0 Kudos

Hi Shichang,

But My requirement is to block a particular user.

Thanks,

Prabhu.

former_member187652
Contributor
0 Kudos

that's correct Naveen. that's why I was asking Prabhu for the business process background. normally access to products/materials are not granted per plant, but per sales org. let's say in Prabhu's case, if for example, sales person A in sales area 1 should not sell anything from plant b since plant b is handled by another group of person from sales area 2, then authorization to sales area 1 is assigned to A. since plant b is not assigned to sales area 1, he will not be able to process any sales from plant b.

former_member187652
Contributor
0 Kudos

Prabhu, if it is only one user, then you need to think more. what if the user changes his position in the organization and will need the access again? what if another person i.e. a new hire needs to be blocked for certain plants?

most likely you can try create a customized table with sap userid-plant combination. in mv45afzz userexit include a logic checking on the table and issue error messages if found blocking criteria.

bsivasankarreddy_reddy
Active Contributor
0 Kudos

hi

you not allow only VA01,VA02 ,

but those user any transaction for that plant , it means vl01n. vl02n, any reports level also not allow

ask to basis team , he will restrict the plant for specific user

bsivasankarreddy_reddy
Active Contributor
0 Kudos

Hi

Write below logic

for specific your only IN VA01,VA02

MV45AFZB

USEREXIT_CHECK_VBAP

if sy-uname = 'SDCONS'.

   IF vbap-werks NE ''.

     IF xvbap-werks NE ''.

       IF ( sy-tcode = 'VA01' OR sy-tcode = 'VA02' ).

         IF  ( vbak-vkorg = '1000' OR vbak-vkorg = '1100' ) .

           IF vbap-werks = '1100'.

             MESSAGE You not authorized plant 1100'   TYPE 'E'.

           ENDIF.

         ELSE.

         ENDIF.

        ENDIF.

      ENDIF.

     ENDIF.

     ENDIF.


regards

sankar


Former Member
0 Kudos

Hi Prabhu,

Please check the option of implementing a custom logic to determine the plant in the user exit USEREXIT_SOURCE_DETERMINATION in the program MV45AFZB.  You can explore it more on this user exit and the available options.

Best Regards,

Satya

Former Member
0 Kudos

Hi Satya,

Thank you for your post.I will try with your suggestion.

Thanks,

Prabhu.

Former Member
0 Kudos

Sure, check and let us know.

Best Regards,

Satya

former_member184701
Active Contributor
0 Kudos

in SU01 for that user go to 'Parameters' tab and set up parameter id

WRK with parameter value you do allow for this user.

all others plants will be restricted.

naveen_kaluti
Active Participant
0 Kudos

Hello PPIO,

I just had a go at the solution provided by you, but unfortunately I was unsuccessful , could you please let us know if there is some other setting that has to be done along with parameter addition.

Thanks for your time.

Regards

Naveen K.