<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Authorization within a report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390756#M814180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to insert a check for a authorization object of company code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now the problem is to understand if you can use a standard object (for example FI object) or you need to create a new one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can use a std one you don't need to change the profile, if you can't do it, u need to change the profile in order to insert the new object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway in your program u have to insert the check of the object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
         ID 'BUKRS' FIELD P_BUKRS
         ID 'ACTVT' FIELD '03'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example I've used F_BKPF_BUK (it is the FI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Feb 2008 15:36:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-13T15:36:32Z</dc:date>
    <item>
      <title>Authorization within a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390755#M814179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a report, and that transaction is assigned to different roles, which are assigned to different users.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I limit which company code can be view per user? I am not sure how the authorization objects work when it comes to reporting. In PFCG I have trouble finding any objects relating to this report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone point me in the right direction please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Allie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2008 15:20:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390755#M814179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-13T15:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization within a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390756#M814180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to insert a check for a authorization object of company code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now the problem is to understand if you can use a standard object (for example FI object) or you need to create a new one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can use a std one you don't need to change the profile, if you can't do it, u need to change the profile in order to insert the new object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway in your program u have to insert the check of the object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
         ID 'BUKRS' FIELD P_BUKRS
         ID 'ACTVT' FIELD '03'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example I've used F_BKPF_BUK (it is the FI)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2008 15:36:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390756#M814180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-13T15:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization within a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390757#M814181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can run an authorisation trace for the transaction using ST01 which will tell you all the all the authorisation objects called for that transaction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2008 15:58:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390757#M814181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-13T15:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization within a report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390758#M814182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;usually authorization is not added on for one field in a table. if the user is not authorized to view the total field, then check the authority at the beginnning of the program. If the authority fails do not display the total field, else display the total field. There is no need to add authority check inside the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT object&lt;/P&gt;&lt;P&gt;ID name1 FIELD f1&lt;/P&gt;&lt;P&gt;ID name2 FIELD f2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;ID name10 FIELD f10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Explanation of IDs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;object&lt;/P&gt;&lt;P&gt;Field which contains the name of the object for which the authorization is to be checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name1 ...&lt;/P&gt;&lt;P&gt;Fields which contain the names of the&lt;/P&gt;&lt;P&gt;name10&lt;/P&gt;&lt;P&gt;authorization fields defined in the object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f1 ...&lt;/P&gt;&lt;P&gt;Fields which contain the values for which the&lt;/P&gt;&lt;P&gt;f10&lt;/P&gt;&lt;P&gt;authorization is to be checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK checks for one object whether the user has an authorization that contains all values of f (see SAP authorization concept).&lt;/P&gt;&lt;P&gt;You must specify all authorizations for an object and a also a value for each ID (or DUMMY).&lt;/P&gt;&lt;P&gt;The system checks the values for the IDs by AND-ing them together, i.e. all values must be part of an authorization assigned to the user.&lt;/P&gt;&lt;P&gt;If a user has several authorizations for an object, the values are OR-ed together. This means that if the CHECK finds all the specified values in one authorization, the user can proceed. Only if none of the authorizations for a user contains all the required values is the user rejected.&lt;/P&gt;&lt;P&gt;If the return code value in SY-SUBRC is 0, the user has the required authorization and may continue.&lt;/P&gt;&lt;P&gt;The return code value changes according to the different error scenarios. The return code values have the following meaning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;User has no authorization in the SAP System for such an action. If necessary, change the user master record.&lt;/P&gt;&lt;P&gt;8&lt;/P&gt;&lt;P&gt;Too many parameters (fields, values). Maximum allowed is 10.&lt;/P&gt;&lt;P&gt;12&lt;/P&gt;&lt;P&gt;Specified object not maintained in the user master record.&lt;/P&gt;&lt;P&gt;16&lt;/P&gt;&lt;P&gt;No profile entered in the user master record.&lt;/P&gt;&lt;P&gt;24&lt;/P&gt;&lt;P&gt;The field names of the check call do not match those of an authorization. Either the authorization or the call is incorrect.&lt;/P&gt;&lt;P&gt;28&lt;/P&gt;&lt;P&gt;Incorrect structure for user master record.&lt;/P&gt;&lt;P&gt;32&lt;/P&gt;&lt;P&gt;Incorrect structure for user master record.&lt;/P&gt;&lt;P&gt;36&lt;/P&gt;&lt;P&gt;Incorrect structure for user master record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the return code value is 8 or 24, inform the person responsible for the program. If the return code value is 4, 12, 16 or 24, consult your system administrator if you think you should have the relevant authorization. In the case of errors 28 to 36, contact SAP because authorizations have probably been destroyed.&lt;/P&gt;&lt;P&gt;Individual authorizations are assigned to users in their respective user profiles, i.e. they are grouped together in profiles which are stored in the user master record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;Instead of ID name FIELD f, you can also write ID name DUMMY. This means that no check is performed for the field concerned.&lt;/P&gt;&lt;P&gt;The check can only be performed on CHAR fields. All other field types result in 'unauthorized'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Check whether the user is authorized for a particular plant. In this case, the following authorization object applies:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table OBJ: Definition of authorization object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_EINF_WRK&lt;/P&gt;&lt;P&gt;ACTVT&lt;/P&gt;&lt;P&gt;WERKS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, M_EINF_WRK is the object name, whilst ACTVT and WERKS are authorization fields. For example, a user with the authorizations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_EINF_WRK_BERECH1&lt;/P&gt;&lt;P&gt;ACTVT 01-03&lt;/P&gt;&lt;P&gt;WERKS 0001-0003 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can display and change plants within the Purchasing and Materials Management areas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Such a user would thus pass the checks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT 'M_EINF_WRK'&lt;/P&gt;&lt;P&gt;ID 'WERKS' FIELD '0002'&lt;/P&gt;&lt;P&gt;ID 'ACTVT' FIELD '02'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT 'M_EINF_WRK'&lt;/P&gt;&lt;P&gt;ID 'WERKS' DUMMY&lt;/P&gt;&lt;P&gt;ID 'ACTVT' FIELD '01':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but would fail the check&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT 'M_EINF_WRK'&lt;/P&gt;&lt;P&gt;ID 'WERKS' FIELD '0005'&lt;/P&gt;&lt;P&gt;ID 'ACTVT' FIELD '04'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To suppress unnecessary authorization checks or to carry out checks before the user has entered all the values, use DUMMY - as in this example. You can confirm the authorization later with another AUTHORITY-CHECK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2008 16:21:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-within-a-report/m-p/3390758#M814182</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-02-13T16:21:43Z</dc:date>
    </item>
  </channel>
</rss>

