<?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: Error with Authorization Object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290418#M1989353</link>
    <description>&lt;P&gt;Hi Sandra Rossi,&lt;/P&gt;&lt;P&gt;I have assigned the Object to corresponding user and i have written the Code in BADI (&lt;/P&gt;&lt;P&gt;INST_AUTHORITY_CHECK) in method CHECK_EQUI as&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851987-auth4.jpg" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method IF_EX_INST_AUTHORITY_CHECK~CHECK_EQUI.

  if iv_tcode eq 'IE02'.

   DATA : wa_jsto TYPE jsto.
   data : wa_jstat TYPE jstat,
          it_jstat TYPE STANDARD TABLE OF jstat.

   if is_equi-equnr is NOT INITIAL.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
           EXPORTING
            INPUT         = is_equi-equnr
           IMPORTING
             OUTPUT         = is_equi-equnr.

     if is_equi-objnr is NOT INITIAL.

         SELECT SINGLE *
                FROM jsto
                INTO wa_jsto
                WHERE objnr = is_equi-objnr.

          IF wa_jsto-stsma IS NOT INITIAL.

             " Get the user status

              CALL FUNCTION 'STATUS_READ'
                EXPORTING
                  client           = sy-mandt
                  objnr            = is_equi-objnr
                  only_active      = 'X'
                TABLES
                  status           = it_jstat
                EXCEPTIONS
                  object_not_found = 1
                  OTHERS           = 2.
            READ TABLE it_jstat INTO wa_jstat WITH KEY stat = 'E0012'.         "E0012 = CNFA stt=atus



              if sy-subrc = 0.

                  AUTHORITY-CHECK OBJECT 'ZAO_EQ_UST'
                                  ID 'ESTAT' FIELD wa_jstat-stat
                                  ID 'STSMA' FIELD wa_jsto-stsma
                                  ID 'ACTVT' FIELD '03'.

              endif.
          endif.
      endif.

   endif.

 endif.
endmethod.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Oct 2020 11:51:08 GMT</pubDate>
    <dc:creator>former_member185116</dc:creator>
    <dc:date>2020-10-20T11:51:08Z</dc:date>
    <item>
      <title>Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290411#M1989346</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
  &lt;P&gt;My client has a requirement where if an equipment is set with user status 'CNFA',&lt;/P&gt;
  &lt;P&gt;all other fields in the equipment should be in display mode&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851984-auth1.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;for this i have created an Authroization object (ZAO_EQ_UST)in su21 as below,&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851985-auth2.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;with permitted activities for Display only , as shown below..&lt;/P&gt;
  &lt;P&gt;auth3.jpg&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851986-auth3.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;however , we are not able to achieve the desired result of disabling all other fields when status CNFA is set..&lt;/P&gt;
  &lt;P&gt;may i know where i am going wrong..&lt;/P&gt;
  &lt;P&gt;do i need to add additional changes in authorization object..&lt;/P&gt;
  &lt;P&gt;Please guide me in this regard..&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 07:57:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290411#M1989346</guid>
      <dc:creator>former_member185116</dc:creator>
      <dc:date>2020-10-19T07:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290412#M1989347</link>
      <description>&lt;P&gt;Please run an STAUTHTRACE on the transaction to see what objects the transaction is checking&lt;/P&gt;&lt;P&gt;Then you can determine what to do&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 09:39:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290412#M1989347</guid>
      <dc:creator>TammyPowlas</dc:creator>
      <dc:date>2020-10-19T09:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290413#M1989348</link>
      <description>&lt;P&gt;You speak about specific authorization object, standard transaction, but how did you link the both ? do you use Badi / User exit ?? &lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 09:44:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290413#M1989348</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2020-10-19T09:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290414#M1989349</link>
      <description>&lt;P&gt;Please attach directly the images instead of links, like below, that will make your question more attractive.&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/attachments/1850908-auth1.jpg"&gt;auth1.jpg&lt;/A&gt; (100.7 kB)&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851940-1850908-auth11.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/attachments/1850909-auth2.jpg"&gt;auth2.jpg&lt;/A&gt; (200.8 kB)&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851941-1850909-auth21.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 09:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290414#M1989349</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-19T09:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290415#M1989350</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/storage/attachments/1850911-auth3.jpg"&gt;auth3.jpg&lt;/A&gt; (250.4 kB)&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851942-1850911-auth31.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 09:52:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290415#M1989350</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-19T09:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290416#M1989351</link>
      <description>&lt;P&gt;Just a candid question: did you assign some authorization to the user, which ones, did you write some ABAP code, and what does the debug says about the field values checked and check result?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 10:03:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290416#M1989351</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-19T10:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290417#M1989352</link>
      <description>&lt;P&gt;Hello  &lt;SPAN class="mention-scrubbed"&gt;vinay.reddy11&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Creating the authorization objects in itself will not disable the fields. You need to check the condition and then disable the fields in the logic of the screen. You need to put a custom code into the logic of the screen/transaction where you will check the status of the equipment and if the status is CNFA you need to disable the fields.&lt;/P&gt;&lt;P&gt;In this particular case I don't think the authorization objects is needed at all.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;Mateusz</description>
      <pubDate>Mon, 19 Oct 2020 10:23:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290417#M1989352</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-10-19T10:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290418#M1989353</link>
      <description>&lt;P&gt;Hi Sandra Rossi,&lt;/P&gt;&lt;P&gt;I have assigned the Object to corresponding user and i have written the Code in BADI (&lt;/P&gt;&lt;P&gt;INST_AUTHORITY_CHECK) in method CHECK_EQUI as&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1851987-auth4.jpg" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method IF_EX_INST_AUTHORITY_CHECK~CHECK_EQUI.

  if iv_tcode eq 'IE02'.

   DATA : wa_jsto TYPE jsto.
   data : wa_jstat TYPE jstat,
          it_jstat TYPE STANDARD TABLE OF jstat.

   if is_equi-equnr is NOT INITIAL.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
           EXPORTING
            INPUT         = is_equi-equnr
           IMPORTING
             OUTPUT         = is_equi-equnr.

     if is_equi-objnr is NOT INITIAL.

         SELECT SINGLE *
                FROM jsto
                INTO wa_jsto
                WHERE objnr = is_equi-objnr.

          IF wa_jsto-stsma IS NOT INITIAL.

             " Get the user status

              CALL FUNCTION 'STATUS_READ'
                EXPORTING
                  client           = sy-mandt
                  objnr            = is_equi-objnr
                  only_active      = 'X'
                TABLES
                  status           = it_jstat
                EXCEPTIONS
                  object_not_found = 1
                  OTHERS           = 2.
            READ TABLE it_jstat INTO wa_jstat WITH KEY stat = 'E0012'.         "E0012 = CNFA stt=atus



              if sy-subrc = 0.

                  AUTHORITY-CHECK OBJECT 'ZAO_EQ_UST'
                                  ID 'ESTAT' FIELD wa_jstat-stat
                                  ID 'STSMA' FIELD wa_jsto-stsma
                                  ID 'ACTVT' FIELD '03'.

              endif.
          endif.
      endif.

   endif.

 endif.
endmethod.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Oct 2020 11:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290418#M1989353</guid>
      <dc:creator>former_member185116</dc:creator>
      <dc:date>2020-10-20T11:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290419#M1989354</link>
      <description>&lt;P&gt;I have assigned the Object to corresponding user and i have written the Code in BADI (&lt;/P&gt;&lt;P&gt;INST_AUTHORITY_CHECK) in method CHECK_EQUI as&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1852937-auth4.jpg" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method IF_EX_INST_AUTHORITY_CHECK~CHECK_EQUI.

  if iv_tcode eq 'IE02'.

   DATA : wa_jsto TYPE jsto.
   data : wa_jstat TYPE jstat,
          it_jstat TYPE STANDARD TABLE OF jstat.

   if is_equi-equnr is NOT INITIAL.

       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
           EXPORTING
            INPUT         = is_equi-equnr
           IMPORTING
             OUTPUT         = is_equi-equnr.

     if is_equi-objnr is NOT INITIAL.

         SELECT SINGLE *
                FROM jsto
                INTO wa_jsto
                WHERE objnr = is_equi-objnr.

          IF wa_jsto-stsma IS NOT INITIAL.

             " Get the user status

              CALL FUNCTION 'STATUS_READ'
                EXPORTING
                  client           = sy-mandt
                  objnr            = is_equi-objnr
                  only_active      = 'X'
                TABLES
                  status           = it_jstat
                EXCEPTIONS
                  object_not_found = 1
                  OTHERS           = 2.
            READ TABLE it_jstat INTO wa_jstat WITH KEY stat = 'E0012'.         "E0012 = CNFA stt=atus



              if sy-subrc = 0.

                  AUTHORITY-CHECK OBJECT 'ZAO_EQ_UST'
                                  ID 'ESTAT' FIELD wa_jstat-stat
                                  ID 'STSMA' FIELD wa_jsto-stsma
                                  ID 'ACTVT' FIELD '03'.

              endif.
          endif.
      endif.

   endif.

 endif.
endmethod.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2020 06:00:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290419#M1989354</guid>
      <dc:creator>former_member185116</dc:creator>
      <dc:date>2020-10-21T06:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290420#M1989355</link>
      <description>&lt;P&gt;You need to raise an exception if there is no authorization.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AUTHORITY-CHECK OBJECT 'ZAO_EQ_UST'
  ID 'ESTAT' FIELD wa_jstat-stat
  ID 'STSMA' FIELD wa_jsto-stsma
  ID 'ACTVT' FIELD '03'.
IF sy-subrc &amp;lt;&amp;gt; 0.
  RAISE error_with_message.
  " OR
  " MESSAGE RAISING error_with_message
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Wed, 21 Oct 2020 07:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290420#M1989355</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2020-10-21T07:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290421#M1989356</link>
      <description>&lt;P&gt;I think you need to read the documentation about authority-check, and the authorisation concept in general. It doesn't work as you seem to think it does.&lt;/P&gt;&lt;P&gt;I don't know how to achieve the requirement, but I'd bet that using an authority-check isn't the right way.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 08:19:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290421#M1989356</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-10-21T08:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error with Authorization Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290422#M1989357</link>
      <description>&lt;P&gt;Many things illogical in your code:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If IE02 (change) then check authorization ACTVT '03' (display), illogical !&lt;/LI&gt;&lt;LI&gt;CONVERSION_EXIT_ALPHA_OUTPUT : no way, why do you need that !?&lt;/LI&gt;&lt;LI&gt;READ TABLE it_jstat INTO wa_jstat WITH KEY stat ='E0012'. -&amp;gt; AUTHORITY-CHECK OBJECT 'ZAO_EQ_UST' ID 'ESTAT' FIELD wa_jstat-stat - so it's always E0012 that you check? don't use a variable then, or correct your code.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;NB: I didn't see your comment because if you want to target someone, if this person has posted an Answer, use the button COMMENT, if this person is the Original Poster of the question he/she will be automatically informed, otherwise &lt;STRONG&gt;copy/paste their hyperlinked name so that the person receives a warning &lt;/STRONG&gt;(NB: @ doesn't work/but typing this character will suggest hyperlinked names).&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 13:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-with-authorization-object/m-p/12290422#M1989357</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-10-21T13:11:24Z</dc:date>
    </item>
  </channel>
</rss>

