<?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>Question Re: How to create authorization checking with Tcode in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583600#M4718952</link>
    <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;suityan98&lt;/SPAN&gt;&lt;/P&gt;You may add the following code in the USER_COMMAND_0100 ( as per your requirement )&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ISHMED_READ_USER_AUTH'
    EXPORTING
      i_user        = sy-uname
      i_object      = 'F_BKPF_BUK'
    TABLES
      t_authorities = i_authorization
    EXCEPTIONS
      read_error    = 1
      OTHERS        = 2.

READ TABLE i_authorization INTO wa_authorization WITH KEY objct = 'F_BKPF_BUK' 
                                                          actvt = 'A' 
                                                          field = 'ACTVT' 
                                                          von = '*'.
  IF sy-subrc NE 0.
    MESSAGE 'You are not authorized' DISPLAY LIKE 'E'.
  ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;STRONG&gt;While testing as mentioned above, test with user who does not have this authorization.&lt;/STRONG&gt;Regards,Venkat</description>
    <pubDate>Fri, 12 Aug 2022 07:24:42 GMT</pubDate>
    <dc:creator>venkateswaran_k</dc:creator>
    <dc:date>2022-08-12T07:24:42Z</dc:date>
    <item>
      <title>How to create authorization checking with Tcode</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaq-p/12583598</link>
      <description>&lt;P&gt;How to create authorization checking with tcode? I have tried many ways like creating transaction ZSDI_DRIVER_INFO and ZSDR_DRIVER_INFO during in tcode se80 and assigned the authorization object (F_BKPF_BUK) to the respective tcode. &lt;/P&gt;
  &lt;P&gt;But nothing change, even when testing I try to insert data not in authorization, It still allows the user to save. I am new in SAP ABAP. Hopefully can get some advice on this...&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;MODULE USER_COMMAND_0100 INPUT.&lt;BR /&gt;&lt;BR /&gt;  CASE ok_code.&lt;BR /&gt;    WHEN 'CONFIRM' .&lt;BR /&gt;      &lt;BR /&gt;&lt;BR /&gt;      IF gv_bukrs IS INITIAL&lt;BR /&gt;        OR gv_icno IS INITIAL&lt;BR /&gt;        OR gv_status IS INITIAL.&lt;BR /&gt;&lt;BR /&gt;        MESSAGE 'Please fill in field required.' type 'E'.&lt;BR /&gt;        CALL SCREEN '0100'.&lt;BR /&gt;&lt;BR /&gt;      ENDIF.&lt;BR /&gt;      PERFORM check_data.&lt;BR /&gt;    WHEN 'QUERY'.&lt;BR /&gt;      CALL SCREEN '0200'.&lt;BR /&gt;    WHEN 'UPDATE'.&lt;BR /&gt;      IF gv_bukrs IS INITIAL&lt;BR /&gt;        OR gv_icno IS INITIAL&lt;BR /&gt;        OR gv_status IS INITIAL.&lt;BR /&gt;&lt;BR /&gt;        MESSAGE 'Please fill in field required.' type 'E'.&lt;BR /&gt;        CALL SCREEN '0100'.&lt;BR /&gt;      ENDIF.&lt;BR /&gt;      PERFORM check_data2.&lt;BR /&gt;&lt;BR /&gt;    WHEN 'EXIT'.&lt;BR /&gt;      LEAVE TO SCREEN 0.&lt;BR /&gt;  ENDCASE.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2087496-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 07:07:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaq-p/12583598</guid>
      <dc:creator>suityan98</dc:creator>
      <dc:date>2022-08-12T07:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create authorization checking with Tcode</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583599#M4718951</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;suityan98&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Execute the t-code with the user who does not have this authorization.&lt;/P&gt;&lt;P&gt;If you are testing, you might have the sap_all authorization.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 07:12:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583599#M4718951</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-08-12T07:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create authorization checking with Tcode</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583600#M4718952</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="mention-scrubbed"&gt;suityan98&lt;/SPAN&gt;&lt;/P&gt;You may add the following code in the USER_COMMAND_0100 ( as per your requirement )&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'ISHMED_READ_USER_AUTH'
    EXPORTING
      i_user        = sy-uname
      i_object      = 'F_BKPF_BUK'
    TABLES
      t_authorities = i_authorization
    EXCEPTIONS
      read_error    = 1
      OTHERS        = 2.

READ TABLE i_authorization INTO wa_authorization WITH KEY objct = 'F_BKPF_BUK' 
                                                          actvt = 'A' 
                                                          field = 'ACTVT' 
                                                          von = '*'.
  IF sy-subrc NE 0.
    MESSAGE 'You are not authorized' DISPLAY LIKE 'E'.
  ENDIF.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;&lt;STRONG&gt;While testing as mentioned above, test with user who does not have this authorization.&lt;/STRONG&gt;Regards,Venkat</description>
      <pubDate>Fri, 12 Aug 2022 07:24:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583600#M4718952</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2022-08-12T07:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create authorization checking with Tcode</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583601#M4718953</link>
      <description>&lt;P&gt;not able to call this function, how can i know the others possible function that I can use?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 07:48:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583601#M4718953</guid>
      <dc:creator>suityan98</dc:creator>
      <dc:date>2022-08-12T07:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create authorization checking with Tcode</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583602#M4718954</link>
      <description>&lt;P&gt;From your requirement I understand that you have to code some AUTHORITY-CHECK statements in your code such as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
           ID 'BUKRS' FIELD gv_bukrs
           ID 'ACTVT' FIELD '03'. " display/query
* For activity value, double-click on authorization object for list of values
* examples:
* 02  Update
* 03  Query
* 10  Confirm, etc.
  IF sy-subrc &amp;lt;&amp;gt; 0.
* Implement a suitable exception handling here
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Adding the authorization object to the transaction definition will only trigger a check at start of transaction with the values you also provided to this transaction (click on 'values' from SE93 screen)&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 15:51:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-create-authorization-checking-with-tcode/qaa-p/12583602#M4718954</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-08-16T15:51:53Z</dc:date>
    </item>
  </channel>
</rss>

