Sei sulla pagina 1di 7

Authorization Check on Sales Documents

Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it.
Therefore the appropriate authorization is required before a user can carry out certain actions in the
system. When you log on to the R/3 system, the system checks in the user master record to see which
transactions you are authorized to use. An authorization check is implemented for every sensitive
transaction.
If you wish to protect a transaction that you have programmed yourself, then you must implement an
authorization check.

Business Requirement
You get a requirement to put some authorization check on SD documents display/change transactions
based on some field which is not available in standard authorization objects. How would you do that?
Solutions that come to your mind
First thing you get in your mind is to use some user-exit for this but that is not going to help you in
display transactions. You can't do that using SD user-exits available for sale order, delivery order and
billing document. Usually we implement checks in MV45AFZZ for sale order, MV50AFZ1 for delivery
order and RV60AFZZ for invoice. There are also many other enhancements available but these are three
most commonly used.
Problem with these enhancements and user-exits is that these are helpful in VA02, VL02N and VF02 but
for display transactions these are not triggered and can't help you out. If you use authority check logic in
these exits system doesn't check that in display transactions. So what do we do here?
Proposed Solution
There are certain enhancements which system calls on display transactions. These are not that easy to
find but since we have worked on it and found these so I thought I should share here so that anyone else
facing such requirement can get benefit of it.
For VA03

Go to VA03 > System > Status and copy program name from here and see the screen number. For VA03
program name is SAPMV45A and screen number is 102.Now go to SE80 and enter program name in
program and double click on screen 102. Here you'll see following module. Double click on that and add
the authority check coding or any other code as per below screen.

Here you can see my message that I have written for testing. You can add authority check code or any
other function/BAPI or check that you want to trigger on VA03. For adding this its good that you take
help from your ABAPER because it requires an implicit enhancement implementation and if you don't
know how to do it ask your ABAPER.

After adding this you'll get this message every time you open VA03 > give sale order number and press
enter.

For VL03N
Go to VL03N transaction code and see the program and screen number like we did in previous step.
Go to SE80 and repeat the same and double click on following module.

Here click on following perform.

Here add your logic in below section by implementing an implicit enhancement.

Following is the message which you'll see everytime you open a delivery order.

For VF03
Repeat the same steps for VF03 and copy program name SAPMV60A and note the screen number 101.
Double click on following module.

Here click on following perform.

Add your code in below section after implementing an implicit enhancement.

Following is the message that I have added here and you'll see this every time you open an invoice in
VF03.

This is it. Simple and easy way to trigger anything on start transaction of any SD document display
transaction code. We did this only for these three transaction codes. If there is requirement for other
transactions we can find triggering point for those as well.

Potrebbero piacerti anche