<?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 AUTHORITY-CHECK &amp; customized program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check-customized-program/m-p/2418024#M539710</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;I've applied an authority-check to my customized program. What I did was, I've created an authorization object name 'ZFI_PGRM' in SU21 and tie it with authorization fields BUKRS, ACTVT. This authority-check will validate on the company code (BUKRS) entered from the selection screen. Below are my lines in the customized program :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: text      TYPE string,&lt;/P&gt;&lt;P&gt;          m_text  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text = 'You are not authorised for Company Code'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_t001 LIKE t001 OCCURS 0 WITH HEADER LINE..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM t001&lt;/P&gt;&lt;P&gt;       INTO TABLE t_t001&lt;/P&gt;&lt;P&gt;             WHERE bukrs IN s_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_t001.&lt;/P&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT 'ZFI_PGRM'&lt;/P&gt;&lt;P&gt;      ID 'BUKRS' FIELD t_t001-bukrs&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;    CONCATENATE text t_t001-bukrs INTO m_text SEPARATED BY space.&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;At the same time BASIS tie the autorization object 'ZFI_PGRM' to the user role in order to access the program using PFCG. The problem now is the result that I'm getting always SY-SUBRC = 12 eventhough the user is allowed to access the company's report. Please help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haryati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jun 2007 02:30:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-27T02:30:10Z</dc:date>
    <item>
      <title>AUTHORITY-CHECK &amp; customized program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check-customized-program/m-p/2418024#M539710</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;I've applied an authority-check to my customized program. What I did was, I've created an authorization object name 'ZFI_PGRM' in SU21 and tie it with authorization fields BUKRS, ACTVT. This authority-check will validate on the company code (BUKRS) entered from the selection screen. Below are my lines in the customized program :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: text      TYPE string,&lt;/P&gt;&lt;P&gt;          m_text  TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;text = 'You are not authorised for Company Code'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_t001 LIKE t001 OCCURS 0 WITH HEADER LINE..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM t001&lt;/P&gt;&lt;P&gt;       INTO TABLE t_t001&lt;/P&gt;&lt;P&gt;             WHERE bukrs IN s_bukrs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_t001.&lt;/P&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT 'ZFI_PGRM'&lt;/P&gt;&lt;P&gt;      ID 'BUKRS' FIELD t_t001-bukrs&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;    CONCATENATE text t_t001-bukrs INTO m_text SEPARATED BY space.&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;At the same time BASIS tie the autorization object 'ZFI_PGRM' to the user role in order to access the program using PFCG. The problem now is the result that I'm getting always SY-SUBRC = 12 eventhough the user is allowed to access the company's report. Please help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haryati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2007 02:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check-customized-program/m-p/2418024#M539710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-27T02:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: AUTHORITY-CHECK &amp; customized program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check-customized-program/m-p/2418025#M539711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Run transaction SU53 after the auth check fails and maybe it will give you a clue as to what is going on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jun 2007 10:54:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check-customized-program/m-p/2418025#M539711</guid>
      <dc:creator>former_member378318</dc:creator>
      <dc:date>2007-06-27T10:54:16Z</dc:date>
    </item>
  </channel>
</rss>

