<?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/5104182#M1184322</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;Are u trying like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT  'your object '&lt;/P&gt;&lt;P&gt;    ID ' your field '  FIELD s_werks-low&lt;/P&gt;&lt;P&gt;    ID 'ACTVT'     FIELD '03'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will allow the plants which have authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srilakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jan 2009 09:41:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-21T09:41:03Z</dc:date>
    <item>
      <title>Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104178#M1184318</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 have put an authorization check on WERKS which is entered through SELECT-OPTIONS.&lt;/P&gt;&lt;P&gt;So lets say that the range entered by the user consists of some plants which should have the authorization to view that report and some should not, however when i put the authorization check in the report it is blocking all the plants to view the report.&lt;/P&gt;&lt;P&gt;How to tackle such situations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104178#M1184318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104179#M1184319</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;Remove all the plants for which the authorization check fails and proceed for only those plants for which the user has authorization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Anoop Panackal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:36:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104179#M1184319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104180#M1184320</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;    loop at s_werks .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'(say)&lt;/P&gt;&lt;P&gt;         ID 'ACTVT' FIELD '03'&lt;/P&gt;&lt;P&gt;         ID 'BUKRS' FIELD s_werks-low.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;       delete s_werks.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proceed with the plants that has autorization checks .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg&lt;/P&gt;&lt;P&gt;Ramya&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramya S on Jan 21, 2009 10:39 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:38:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104180#M1184320</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104181#M1184321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how can you remove plants from authorization object???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104181#M1184321</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104182#M1184322</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;Are u trying like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  AUTHORITY-CHECK OBJECT  'your object '&lt;/P&gt;&lt;P&gt;    ID ' your field '  FIELD s_werks-low&lt;/P&gt;&lt;P&gt;    ID 'ACTVT'     FIELD '03'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will allow the plants which have authorizations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srilakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:41:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104182#M1184322</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104183#M1184323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new FM which looks something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION AUTHORITY_CHECK.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(AUT_OBJ) TYPE  C&lt;/P&gt;&lt;P&gt;*"     REFERENCE(FIELD1_OBJECT) TYPE  C&lt;/P&gt;&lt;P&gt;*"     REFERENCE(FIELD1_VALUE) TYPE  C&lt;/P&gt;&lt;P&gt;*"     REFERENCE(FIELD2_OBJECT) TYPE  C&lt;/P&gt;&lt;P&gt;*"     REFERENCE(FIELD2_VALUE) TYPE  C&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      NO_AUTHORITY&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   authority-check object aut_obj&lt;/P&gt;&lt;P&gt;     id field1_object field field1_value&lt;/P&gt;&lt;P&gt;     id field2_object field field2_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;     Raise No_authority.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And call it in your program like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form check_authority.&lt;/P&gt;&lt;P&gt;  data : wa_t001 like t001w.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check for the validity of plant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select single *&lt;/P&gt;&lt;P&gt;  into wa_t001&lt;/P&gt;&lt;P&gt;  from t001w&lt;/P&gt;&lt;P&gt;  where werks = pa_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;If the plant entered is a valid plant check for authority&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;    call function 'AUTHORITY_CHECK'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              aut_obj       = co_auth_obj&lt;/P&gt;&lt;P&gt;              field1_object = co_werks&lt;/P&gt;&lt;P&gt;              field1_value  = pa_werks&lt;/P&gt;&lt;P&gt;              field2_object = co_actvt&lt;/P&gt;&lt;P&gt;              field2_value  = co_03&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;              no_authority  = 1&lt;/P&gt;&lt;P&gt;              others        = 2.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      message e261 with pa_werks.     "no authorization for plant&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    message e048 with pa_werks.       "plant &amp;amp; is invalid.&lt;/P&gt;&lt;P&gt;  endif.                              "sy-subrc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " check_authority&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Harsh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:42:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104183#M1184323</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104184#M1184324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what i am trying is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AUTHORITY-CHECK OBJECT 'ZREPORTS'&lt;/P&gt;&lt;P&gt;                ID 'ACTVT'    FIELD '03'&lt;/P&gt;&lt;P&gt;                ID 'VKORG' FIELD s_vkorg&lt;/P&gt;&lt;P&gt;                ID 'VKGRP' FIELD s_vkgrp.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE 'No Authorisation for selected sales organization' TYPE 'I' DISPLAY LIKE 'W'.&lt;/P&gt;&lt;P&gt;    LEAVE TO TRANSACTION sy-tcode.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note that both vkorg and vkgrp are in select options&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:43:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104184#M1184324</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104185#M1184325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can do the authorization check later and filter the reocrds where it fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is select the data first for the select-options and do the authorization check while looping at the output table. Whereever the authorization fails, delete that record. keep it otherwise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from dbtab into table itab
where vkorg in s_vkorg...

loop at itab.

AUTHORITY-CHECK OBJECT 'ZREPORTS'
ID 'ACTVT' FIELD '03'
ID 'VKORG' FIELD itab-vkorg
ID 'VKGRP' FIELD itab-vkgrp.

IF SY-SUBRC NE 0.
delete itab.
continue.
ENDIF.

" rest of the processing.

endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way the users will only get a list of records they are authorized to see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 09:59:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104185#M1184325</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T09:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104186#M1184326</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;U can't do that authorization control, but u need to check the data extracted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT ITAB.
  AUTHORITY-CHECK OBJECT 'ZREPORTS'
    ID 'ACTVT' FIELD '03'
    ID 'VKORG' FIELD ITAB-VKORG
    ID 'VKGRP' FIELD ITAB-VKGRP.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    DELETE ITAB.
  ENDIF.
ENDLOOP.

DESCRIBE TABLE ITAB LINES SY-TABIX.

IF SY-TABIX = 0.
  MESSAGE 'No Authorisation for selected sales organization' TYPE 'I'
  DISPLAY LIKE 'W'.
  LEAVE TO TRANSACTION SY-TCODE.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; or to filter the possible hits of the selectiion-screen:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF IT_SEL OCCURS 0,
        VKORG TYPE TVKBZ-VKORG,
        VKGRP TYPE TVBVK-VKGRP,
      END   OF IT_SEL.

SELECT TVKBZ~VKORG TVBVK~VKGRP INTO TABLE IT_SEL
   FROM TVKBZ INNER JOIN TVBVK ON  TVKBZ~VKBUR = TVBVK~VKBUR
      WHERE TVKBZ~VKORG IN SO_VKORG
        AND TVBVK~VKGRP IN SO_VKGRP.

LOOP AT IT_SEL.
  AUTHORITY-CHECK OBJECT 'ZREPORTS'
    ID 'ACTVT' FIELD '03'
    ID 'VKORG' FIELD IT_SEL-VKORG
    ID 'VKGRP' FIELD IT_SEL-VKGRP.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    DELETE IT_SEL.
  ENDIF.
ENDLOOP.

DESCRIBE TABLE IT_SEL LINES SY-TABIX.

IF SY-TABIX = 0.
  MESSAGE 'No Authorisation for selected sales organization' TYPE 'I'
  DISPLAY LIKE 'W'.
  LEAVE TO TRANSACTION SY-TCODE.
ELSE.
  SELECT * FROM &amp;lt;TABL&amp;gt; INTO TABLE ITAB
     FOR ALL ENTRIES IN IT_SEL
       WHERE VKORG = IT_SEL-VKORG
         AND VKGRP = IT_SEL-VKGRP.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 10:24:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authorization-check/m-p/5104186#M1184326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T10:24:15Z</dc:date>
    </item>
  </channel>
</rss>

