<?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 Check in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/3230228#M770562</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this sample code...not a stright solution to your requirement..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA wa(20).
AT LINE-SELECTION.
  CLEAR wa.
  READ LINE sy-lilli LINE VALUE INTO wa.
  CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
    EXPORTING
      tcode  = wa
    EXCEPTIONS
      ok     = 1
      not_ok = 2
      OTHERS = 3.
  IF sy-subrc EQ '1'.
    WRITE :/ 'You are authorised view this report'.
  ELSE.
    WRITE :/ 'you are NOT authorised to use this report'.
  ENDIF.

START-OF-SELECTION.
  WRITE :/ 'T-code List',
         / 'SM04',
         / 'SE38',
         / 'SE71'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2008 11:29:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-10T11:29:26Z</dc:date>
    <item>
      <title>Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/3230227#M770561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In one report i am displaying the list of executable reports.&lt;/P&gt;&lt;P&gt;Now if the user double clicks the code, the same T Code will be opened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if a particular user has no authorization, the system openes the T Code eventhough it is not authorized to do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that I am using one functional module 'SUSR_AUTHORITY_CHECK_SIMULATE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SUSR_AUTHORITY_CHECK_SIMULATE'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;           USER_NAME = SY-UNAME&lt;/P&gt;&lt;P&gt;           OBJECT = 'S_TCODE'&lt;/P&gt;&lt;P&gt;           FIELD1 = 'TCD'&lt;/P&gt;&lt;P&gt;           VAL1 = TCODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;           SY_SUBRC = SYSUBRC&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;           NOT_AUTHORIZED = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tcode is passed and if sy-subrc is set to 0 it shold allow the tCode to open.&lt;/P&gt;&lt;P&gt;But this is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me what to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 11:06:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/3230227#M770561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T11:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/3230228#M770562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this sample code...not a stright solution to your requirement..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA wa(20).
AT LINE-SELECTION.
  CLEAR wa.
  READ LINE sy-lilli LINE VALUE INTO wa.
  CALL FUNCTION 'AUTHORITY_CHECK_TCODE'
    EXPORTING
      tcode  = wa
    EXCEPTIONS
      ok     = 1
      not_ok = 2
      OTHERS = 3.
  IF sy-subrc EQ '1'.
    WRITE :/ 'You are authorised view this report'.
  ELSE.
    WRITE :/ 'you are NOT authorised to use this report'.
  ENDIF.

START-OF-SELECTION.
  WRITE :/ 'T-code List',
         / 'SM04',
         / 'SE38',
         / 'SE71'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2008 11:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/3230228#M770562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-10T11:29:26Z</dc:date>
    </item>
  </channel>
</rss>

