<?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: Authority Check in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148021#M991845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ankesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code checks if the user has the needed authorizations for object 'M_MSEG_WMB'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 12:05:33 GMT</pubDate>
    <dc:creator>peter_ruiz2</dc:creator>
    <dc:date>2008-07-23T12:05:33Z</dc:date>
    <item>
      <title>Authority Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148020#M991844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  new plant / do the authority check / save result in buffer table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    AUTHORITY-CHECK OBJECT 'M_MSEG_WMB'&lt;/P&gt;&lt;P&gt;                    ID 'ACTVT' FIELD actvt03&lt;/P&gt;&lt;P&gt;                    ID 'WERKS' FIELD  L_F_WERKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what does this code mean and how we implement authority check.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 12:00:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148020#M991844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T12:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148021#M991845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ankesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this code checks if the user has the needed authorizations for object 'M_MSEG_WMB'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 12:05:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148021#M991845</guid>
      <dc:creator>peter_ruiz2</dc:creator>
      <dc:date>2008-07-23T12:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148022#M991846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code is used to check authorization for plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check following links for info......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://members.tripod.com/sap_abap/authorit.htm" target="test_blank"&gt;http://members.tripod.com/sap_abap/authorit.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdb.info/authority-check-abap-keyword-a-day/" target="test_blank"&gt;http://www.sapdb.info/authority-check-abap-keyword-a-day/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Nil on Jul 23, 2008 5:40 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 12:05:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148022#M991846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T12:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148023#M991847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi check this simple example with syntax..&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT auth_obj [FOR USER user] &lt;/P&gt;&lt;P&gt;                        ID id1 {FIELD val1}|DUMMY &lt;/P&gt;&lt;P&gt;                       [ID id2 {FIELD val2}|DUMMY] &lt;/P&gt;&lt;P&gt;                       [ID id10 {FIELD val10}|DUMMY]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; AUTHORITY-CHECK OBJECT 'S_CARRID' &lt;/P&gt;&lt;P&gt;    ID 'CARRID' FIELD carr &lt;/P&gt;&lt;P&gt;    ID 'ACTVT'  FIELD '03'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 12:07:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148023#M991847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T12:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148024#M991848</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;this is for Company code. if the user doesnt have the authorization for the specified company code then the SUBRC after the AUTHORITY-CHECK OBJECT 'V_AKKP_ART' will be 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM AUTHORITY_CHECK .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : LT_VIAUFKS TYPE TI_VIAUFKS1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS : &amp;lt;FL_VIAUFKS&amp;gt; TYPE TY_VIAUFKS1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT BUKRS FROM T001&lt;/P&gt;&lt;P&gt;               INTO TABLE LT_VIAUFKS&lt;/P&gt;&lt;P&gt;               WHERE BUKRS IN S_BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    LOOP AT LT_VIAUFKS ASSIGNING &amp;lt;FL_VIAUFKS&amp;gt;.&lt;/P&gt;&lt;P&gt;      AUTHORITY-CHECK OBJECT 'V_AKKP_ART'&lt;/P&gt;&lt;P&gt;               ID 'AKKTP' DUMMY&lt;/P&gt;&lt;P&gt;               ID 'AKKRT' DUMMY&lt;/P&gt;&lt;P&gt;               ID 'BUKRS' FIELD &amp;lt;FL_VIAUFKS&amp;gt;-BUKRS&lt;/P&gt;&lt;P&gt;               ID 'ACTVT' FIELD '03'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        MESSAGE E999 WITH TEXT-026 &amp;lt;FL_VIAUFKS&amp;gt;-BUKRS.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    MESSAGE E999 WITH TEXT-015 TEXT-024.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajasekhar Reddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 12:08:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148024#M991848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T12:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148025#M991849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;check this code,&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basic form&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;u2026&lt;/P&gt;&lt;P&gt;ID name10 FIELD f10.&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;object Field which contains the name of the object for which the authorization is to be checked.&lt;/P&gt;&lt;P&gt;name1 u2026 Fields which contain the names of the name10 authorization fields defined in the object.&lt;/P&gt;&lt;P&gt;f1 u2026 Fields which contain the values for which the f10 authorization is to be checked.&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 ID s 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 SY-SUBRC = 0, the user has the required authorization and may continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return code is modified to suit the different error scenarios. The return code values have the following meaning:&lt;/P&gt;&lt;P&gt;4 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 Too many parameters (fields, values). Maximum allowed is 10.&lt;/P&gt;&lt;P&gt;12 Specified object not maintained in the user master record.&lt;/P&gt;&lt;P&gt;16 No profile entered in the user master record.&lt;/P&gt;&lt;P&gt;24 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 Incorrect structure for user master record.&lt;/P&gt;&lt;P&gt;32 Incorrect structure for user master record.&lt;/P&gt;&lt;P&gt;36 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 possibly 24, inform the person responsible for the program. If the return code value is 4, 12, 15 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, since 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;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 u2018unauthorizedu2019.&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;AUTHORITY-CHECK OBJECT u2018M_EINF_WRKu2019&lt;/P&gt;&lt;P&gt;ID u2018WERKSu2019 FIELD u20180002u2032&lt;/P&gt;&lt;P&gt;ID u2018ACTVTu2019 FIELD u201802u2032.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT u2018M_EINF_WRKu2019&lt;/P&gt;&lt;P&gt;ID u2018WERKSu2019 DUMMY&lt;/P&gt;&lt;P&gt;ID u2018ACTVTu2019 FIELD u201801u2032:&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 u2018M_EINF_WRKu2019&lt;/P&gt;&lt;P&gt;ID u2018WERKSu2019 FIELD u20180005u2032&lt;/P&gt;&lt;P&gt;ID u2018ACTVTu2019 FIELD u201804u2032.&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, 23 Jul 2008 12:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/4148025#M991849</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T12:09:53Z</dc:date>
    </item>
  </channel>
</rss>

