<?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 Object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045897#M721027</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;  Refer this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  sub_check_auth_iwerk                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This form checks authorization for plant.                           *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM sub_check_auth_iwerk .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--Constant for t code, no tcode hence value = '&lt;/STRONG&gt;' (all)&lt;/P&gt;&lt;P&gt;  CONSTANTS: lc_tcd LIKE tstc-tcode VALUE '*'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Table for all the plants in selection screen. This&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; table will be used for authority check.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: BEGIN OF li_plant OCCURS 0,&lt;/P&gt;&lt;P&gt;          iwerk LIKE t001w-werks,&lt;/P&gt;&lt;P&gt;        END OF li_plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Select query to pick plant from table t001w&lt;/P&gt;&lt;P&gt;  SELECT werks                                "Plant&lt;/P&gt;&lt;P&gt;         INTO TABLE li_plant&lt;/P&gt;&lt;P&gt;         FROM t001w&lt;/P&gt;&lt;P&gt;         WHERE werks IN s_iwerk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT li_plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AUTHORITY-CHECK OBJECT 'I_SWERK'&lt;/P&gt;&lt;P&gt;             ID 'TCD'   FIELD lc_tcd&lt;/P&gt;&lt;P&gt;             ID 'SWERK' FIELD li_plant-iwerk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Check SUBRC&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;*--No Authorization for Plant&lt;/P&gt;&lt;P&gt;      MESSAGE e016 WITH li_plant-iwerk.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.                   "loop at li_plant&lt;/P&gt;&lt;P&gt;ENDFORM.                     "sub_check_auth_iwerk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagrds,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Nov 2007 06:51:41 GMT</pubDate>
    <dc:creator>former_member386202</dc:creator>
    <dc:date>2007-11-14T06:51:41Z</dc:date>
    <item>
      <title>Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045896#M721026</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;Can anyone guide me with the steps of creating an Authority Object and doing authority checks in ABAP programs as well as in Dictionary tables and Transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anindita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 06:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045896#M721026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T06:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045897#M721027</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;  Refer this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  sub_check_auth_iwerk                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; This form checks authorization for plant.                           *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM sub_check_auth_iwerk .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;--Constant for t code, no tcode hence value = '&lt;/STRONG&gt;' (all)&lt;/P&gt;&lt;P&gt;  CONSTANTS: lc_tcd LIKE tstc-tcode VALUE '*'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Table for all the plants in selection screen. This&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; table will be used for authority check.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  DATA: BEGIN OF li_plant OCCURS 0,&lt;/P&gt;&lt;P&gt;          iwerk LIKE t001w-werks,&lt;/P&gt;&lt;P&gt;        END OF li_plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Select query to pick plant from table t001w&lt;/P&gt;&lt;P&gt;  SELECT werks                                "Plant&lt;/P&gt;&lt;P&gt;         INTO TABLE li_plant&lt;/P&gt;&lt;P&gt;         FROM t001w&lt;/P&gt;&lt;P&gt;         WHERE werks IN s_iwerk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT li_plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    AUTHORITY-CHECK OBJECT 'I_SWERK'&lt;/P&gt;&lt;P&gt;             ID 'TCD'   FIELD lc_tcd&lt;/P&gt;&lt;P&gt;             ID 'SWERK' FIELD li_plant-iwerk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Check SUBRC&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;*--No Authorization for Plant&lt;/P&gt;&lt;P&gt;      MESSAGE e016 WITH li_plant-iwerk.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.                   "loop at li_plant&lt;/P&gt;&lt;P&gt;ENDFORM.                     "sub_check_auth_iwerk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagrds,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 06:51:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045897#M721027</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2007-11-14T06:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045898#M721028</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;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/52/67167f439b11d1896f0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/52/67167f439b11d1896f0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/ef/4aba3b3bf00152e10000000a114084/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/ef/4aba3b3bf00152e10000000a114084/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the following extract on Authorisation objects -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using SU21 u can create Authorisation Object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Details to give an authorisation for ABAP PROGRAMS are as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The smallest unit against which the check should be run is the authorization &lt;/P&gt;&lt;P&gt;field. &lt;/P&gt;&lt;P&gt;The ABAP command AUTHORITY-CHECK is used for performing authorizaton checks in programs. Before accessing the database the user should carry out an &lt;/P&gt;&lt;P&gt;authorization check which is implemented in the ABAP program. The &lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK statement first checks if the user has the authorization &lt;/P&gt;&lt;P&gt;containing all the required values. Then the code value in the system field &lt;/P&gt;&lt;P&gt;SY-SUBRC is checked. If the required value is available for each &lt;/P&gt;&lt;P&gt;authorization field, the check is successful (SY-SUBRC = 0). If the value is &lt;/P&gt;&lt;P&gt;not 0, then the check is unsuccessful, which means that the user does not &lt;/P&gt;&lt;P&gt;possess the required authorization and an error message will be displayed. &lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK sets SY-SUBRC to 4, 8, 12, 16, 24, 28, 32 or 36 depending on &lt;/P&gt;&lt;P&gt;the cause of the authorization failure, e.g. return code 4 means that the &lt;/P&gt;&lt;P&gt;user does not have the required authorization; SY-SUBRC = 8 means that the &lt;/P&gt;&lt;P&gt;check could not successfully be carried out since not all fields of the &lt;/P&gt;&lt;P&gt;object were specified. The field SUBRC is in the APAB Dictionary SYST. To &lt;/P&gt;&lt;P&gt;address the system field in an ABAP program, the form SY-&amp;lt;fieldname&amp;gt; is &lt;/P&gt;&lt;P&gt;used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ABAP syntax of the AUTHORITY-CHECK statement is: &lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT '&amp;lt;object&amp;gt;' (which created by you in SU21) &lt;/P&gt;&lt;P&gt;ID '&amp;lt;name1&amp;gt;' FIELD &amp;lt;f1&amp;gt; (fields given in Authorisation object) &lt;/P&gt;&lt;P&gt;??????????? &lt;/P&gt;&lt;P&gt;ID '&amp;lt;name10&amp;gt;' FIELD &amp;lt;f10&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where &amp;lt;object&amp;gt; is the name of the authorization object that has to be &lt;/P&gt;&lt;P&gt;checked, &amp;lt;name1&amp;gt;,..., &amp;lt;name10&amp;gt; are the authorization fields in the object, &lt;/P&gt;&lt;P&gt;and &amp;lt;f1&amp;gt;,... ,&amp;lt;f10&amp;gt; are the values for which the authorization is to be &lt;/P&gt;&lt;P&gt;checked. If after the field name is entered DUMMY, the check for a &lt;/P&gt;&lt;P&gt;particular field will not be carried out. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it serves your purpose&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/52/67167f439b11d1896f0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/52/67167f439b11d1896f0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/ef/4aba3b3bf00152e10000000a114084/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/ef/4aba3b3bf00152e10000000a114084/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 06:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045898#M721028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T06:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045899#M721029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through this link hope this would help you to give the idea about authorization object,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbacbe35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbacbe35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.guidancetech.com/people/holland/sap/abap/" target="test_blank"&gt;http://www.guidancetech.com/people/holland/sap/abap/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 07:00:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-object/m-p/3045899#M721029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T07:00:11Z</dc:date>
    </item>
  </channel>
</rss>

