<?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 issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027872#M1498963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically what you need to do is to select all existing WERKS from table T001W into an internal table and then loop at that table. For every entry do an authorization check using e.g. authorization object M_MATE_WRK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AUTHORITY-CHECK OBJECT 'M_MATE_WRK'
       ID 'ACTVT' FIELD lv_activity
       ID 'WERKS' FIELD lv_werks.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where lv_activity is the activity you want to check (display(03), change(02) etc) and lv_werks the current WERKS value in the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case the user is not authorized for this WERKS just delete the entry from the internal table. After the loop the internal table will only contain the WERKS the user is authorized for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using a different authroization object to check for authorization you need to change the authority-check statement accordingly to use that object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jun 2010 19:46:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-02T19:46:01Z</dc:date>
    <item>
      <title>Authorization issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027871#M1498962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During a program execution I need to get al the WERKS where the user has authorization. Can you explain me if there is a table or a MF for getting this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 19:12:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027871#M1498962</guid>
      <dc:creator>marcela_martinez</dc:creator>
      <dc:date>2010-06-02T19:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027872#M1498963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically what you need to do is to select all existing WERKS from table T001W into an internal table and then loop at that table. For every entry do an authorization check using e.g. authorization object M_MATE_WRK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AUTHORITY-CHECK OBJECT 'M_MATE_WRK'
       ID 'ACTVT' FIELD lv_activity
       ID 'WERKS' FIELD lv_werks.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where lv_activity is the activity you want to check (display(03), change(02) etc) and lv_werks the current WERKS value in the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case the user is not authorized for this WERKS just delete the entry from the internal table. After the loop the internal table will only contain the WERKS the user is authorized for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using a different authroization object to check for authorization you need to change the authority-check statement accordingly to use that object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 19:46:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027872#M1498963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-02T19:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027873#M1498964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael for the answer. I thougt previously in this option but I think that is another one very much direct.&lt;/P&gt;&lt;P&gt;Thanks again and regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jun 2010 19:48:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-issue/m-p/7027873#M1498964</guid>
      <dc:creator>marcela_martinez</dc:creator>
      <dc:date>2010-06-02T19:48:53Z</dc:date>
    </item>
  </channel>
</rss>

