<?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: Authorizations in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462847#M832131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: user TYPE sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;  user = sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DEFINE check_authority.&lt;/P&gt;&lt;P&gt;    if user ne 'ADMN'.&lt;/P&gt;&lt;P&gt;      message 'You are not authorized to run this program' type 'W'.&lt;/P&gt;&lt;P&gt;      stop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be of some use. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Imran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Mar 2008 05:44:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-12T05:44:40Z</dc:date>
    <item>
      <title>Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462842#M832126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having an Z report and to which I need to provide authorizations Plant wise.&lt;/P&gt;&lt;P&gt;how can i do this as an ABAPER&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:35:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462842#M832126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462843#M832127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can call the authority check inside the program. it is preferred to call it in INITIALIZATION event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:39:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462843#M832127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462844#M832128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;for authorization u had to code in your program .&lt;/P&gt;&lt;P&gt;just do copy and paste and try , it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF stype_buffer,&lt;/P&gt;&lt;P&gt;         werks               LIKE  t001w-werks,&lt;/P&gt;&lt;P&gt;         bukrs               LIKE  t001-bukrs,&lt;/P&gt;&lt;P&gt;         subrc               LIKE  syst-subrc,&lt;/P&gt;&lt;P&gt;       END OF stype_buffer,&lt;/P&gt;&lt;P&gt;       stab_buffer           TYPE STANDARD TABLE OF&lt;/P&gt;&lt;P&gt;                             stype_buffer&lt;/P&gt;&lt;P&gt;                             WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF stype_organ,&lt;/P&gt;&lt;P&gt;          werks              LIKE  t001w-werks,&lt;/P&gt;&lt;P&gt;          bwkey              LIKE  t001w-bwkey,&lt;/P&gt;&lt;P&gt;          name1              LIKE  t001w-name1,&lt;/P&gt;&lt;P&gt;          bukrs              LIKE  t001-bukrs,&lt;/P&gt;&lt;P&gt;          waers              LIKE  t001-waers,&lt;/P&gt;&lt;P&gt;        END OF stype_organ,&lt;/P&gt;&lt;P&gt;        stab_organ           TYPE STANDARD TABLE OF&lt;/P&gt;&lt;P&gt;                             stype_organ&lt;/P&gt;&lt;P&gt;                             WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: g_t_organ              TYPE  stab_organ WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      g_s_organ              TYPE  stype_organ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT DISTINCT werks name1 bwkey&lt;/P&gt;&lt;P&gt;                    INTO CORRESPONDING FIELDS OF TABLE g_t_organ&lt;/P&gt;&lt;P&gt;                    FROM t001w&lt;/P&gt;&lt;P&gt;                    WHERE werks IN s_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT g_t_organ.&lt;/P&gt;&lt;P&gt;    AUTHORITY-CHECK OBJECT 'M_MATE_WRK'&lt;/P&gt;&lt;P&gt;    ID 'WERKS' FIELD g_t_organ-werks&lt;/P&gt;&lt;P&gt;    ID 'ACTVT' FIELD '03'.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE 'NO AUTHORIZATION' TYPE 'E'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it works do grant faourable points&lt;/P&gt;&lt;P&gt;priya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:41:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462844#M832128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462845#M832129</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;       You can use Authority Check for the necessary Authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls have a luk at the below sample code which might be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: user TYPE sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;  user = sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Invalidates any user other than OPTIMA-ADMN from executing the report.&lt;/P&gt;&lt;P&gt;  DEFINE check_authority.&lt;/P&gt;&lt;P&gt;    if user ne 'xxxxx'.&lt;/P&gt;&lt;P&gt;      message 'You are not authorized to run this program' type 'W'.&lt;/P&gt;&lt;P&gt;      stop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;  check_authority.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may mention the respective user for xxxx for the necesary authorizations. &lt;/P&gt;&lt;P&gt;For this code except the user "XXXX" rest are not authorized to execute this report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:42:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462845#M832129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462846#M832130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sushmitha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM initialize_plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&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;Validation&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;  PERFORM authority_check.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;  IF pa_werks NE (your choice)&lt;/P&gt;&lt;P&gt;*Select plant as -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;    MESSAGE .&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Checking Whether the User has authorization for the Plant.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT 'Z'  ID  'WERKS' FIELD pa_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; NO AUTHORIZATION FOR PLANT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    MESSAGE e&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;ENDFORM.                    " authority_check)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this code and use accordingly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;/P&gt;&lt;P&gt;Mohinder Singh Chauhan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:43:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462846#M832130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462847#M832131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: user TYPE sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;  user = sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DEFINE check_authority.&lt;/P&gt;&lt;P&gt;    if user ne 'ADMN'.&lt;/P&gt;&lt;P&gt;      message 'You are not authorized to run this program' type 'W'.&lt;/P&gt;&lt;P&gt;      stop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  END-OF-DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be of some use. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Imran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:44:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462847#M832131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462848#M832132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Write this code in initilisation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; AUTHORITY-CHECK OBJECT 'Z_PP_PLANT'&lt;/P&gt;&lt;P&gt;                        ID 'WERKS' FIELD p_werks&lt;/P&gt;&lt;P&gt;                        ID 'ACTVT' FIELD '03'&lt;/P&gt;&lt;P&gt;                        ID 'TCD' FIELD w_tcode.&lt;/P&gt;&lt;P&gt;  IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;    MESSAGE e014 WITH p_werks.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check for the authority object z_pp_plant your orgnisation may have custome defined one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 05:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462848#M832132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T05:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Authorizations</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462849#M832133</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;if the authorization object and authorization id are created and authorization values are assigned to ur user role then only u can check the authorizations in ur program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;tcodes:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;authorization object SU21.&lt;/P&gt;&lt;P&gt;authorization id SU20.&lt;/P&gt;&lt;P&gt;user roles maintainance PFCG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;as a developer u don't have access to all these tcodes&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more info please go through this link&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbacbe35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbacbe35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2008 06:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorizations/m-p/3462849#M832133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-12T06:03:48Z</dc:date>
    </item>
  </channel>
</rss>

