<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616384#M276041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to incorporate the Authority-Check for Sales Organization field ( VBAK-VKORG) inthe selection screen. In the meanwhlie, i should restrict further processing of Report, if unauthorized Sales Organzations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in explaining the meaning of above requirement and can any one give me the code sample for this..????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its urgent issue and kindly request you to help me out...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Oct 2006 05:50:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-14T05:50:56Z</dc:date>
    <item>
      <title>Authority-Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616384#M276041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to incorporate the Authority-Check for Sales Organization field ( VBAK-VKORG) inthe selection screen. In the meanwhlie, i should restrict further processing of Report, if unauthorized Sales Organzations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me in explaining the meaning of above requirement and can any one give me the code sample for this..????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its urgent issue and kindly request you to help me out...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 05:50:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616384#M276041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T05:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Authority-Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616385#M276042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check if the below code helps you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way is as below.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA: BEGIN OF lt_tvko OCCURS 0,
          vkorg TYPE vkorg,
          bukrs TYPE bukrs,
        END OF lt_tvko.
 
  SELECT vkorg bukrs FROM tvko INTO TABLE lt_tvko
    WHERE vkorg IN lr_vkorg.
  IF sy-subrc NE 0.
    MESSAGE e085(wv).
  ENDIF.
* Check all retrieved co.codes
  SORT lt_tvko BY bukrs.
  DELETE ADJACENT DUPLICATES FROM lt_tvko COMPARING bukrs.
  LOOP AT lt_tvko.
*   Error Message: No authorization for sales organization &amp;amp;1
    PERFORM f_bukrs_auth_chk_p USING lt_tvko-bukrs 'ICC_FI_CN' 'E' '010'
                                     lt_tvko-vkorg '' '' ''.
  ENDLOOP.
 
 
FORM f_bukrs_auth_chk_p USING value(lc_bukrs) TYPE bukrs
                              value(lc_msgid) LIKE sy-msgid
                              value(lc_msgty) LIKE sy-msgty
                              value(ln_msgno) LIKE sy-msgno
                              value(lc_msgv1)
                              value(lc_msgv2)
                              value(lc_msgv3)
                              value(lc_msgv4).
 
  AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
    ID 'BUKRS' FIELD lc_bukrs
    ID 'ACTVT' FIELD '03'.
  IF sy-subrc NE 0.
    MESSAGE ID lc_msgid TYPE lc_msgty NUMBER ln_msgno
      WITH lc_msgv1 lc_msgv2 lc_msgv3 lc_msgv4.
  ENDIF.
 
ENDFORM.                    "f_bukrs_auth_chk_p&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Select the sales organization mapping to Company code and then restrict. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 06:01:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616385#M276042</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T06:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Authority-Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616386#M276043</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;When restricting the report execution by sales organization, i need to follow the logic below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If none of the sales organizations input in the selection screen is authorized, give a message &amp;#145;No authorization for any Sales Org input&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If some of the sales organizations are authorized but others not, retrieve the data of the authorized sales organizations and display them in the report. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me code sample, as i am unable to make it happen... &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 07:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616386#M276043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T07:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Authority-Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616387#M276044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in addition to E.Rao u have to put simple logic : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.If he has no authorization then delete that Sales Org from the Internal table which u are ref.&lt;/P&gt;&lt;P&gt;2.And finally If Sales ord table is Empty then raise error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;check the sample logic in case of plant for sales ord please ref.Eswar Code .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  select werks
    into table i_auth_werks
    from t001w
    where werks in s_werks.

  loop at i_auth_werks.
    authority-check object 'Z_PLNT_AUT'
             id 'ACTVT' field '03'
             id 'WERKS' field i_auth_werks-werks.

    if sy-subrc ne 0 .
    delete   i_auth_werks.
    endif.
  endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. describe table i_auth_werks lines n.&lt;/P&gt;&lt;P&gt;if nle 0.&lt;/P&gt;&lt;P&gt; message e398(00) with&lt;/P&gt;&lt;P&gt;       'User' sy-uname 'not authorised for Plant : ' i_auth_werks-werks.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Please modify ur code as per sample code&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 07:22:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616387#M276044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T07:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Authority-Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616388#M276045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Have made some changes to the code. Please check the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA: BEGIN OF lt_tvko OCCURS 0,
          vkorg TYPE vkorg,
          bukrs TYPE bukrs,
        END OF lt_tvko.
 
  SELECT vkorg bukrs FROM tvko INTO TABLE lt_tvko
    WHERE vkorg IN lr_vkorg.
  IF sy-subrc NE 0.
    MESSAGE e085(wv).
  ENDIF.
* Check all retrieved co.codes
  SORT lt_tvko BY bukrs.
  DELETE ADJACENT DUPLICATES FROM lt_tvko COMPARING bukrs.
  LOOP AT lt_tvko.
*   Error Message: No authorization for sales organization &amp;amp;1
    PERFORM f_bukrs_auth_chk_p USING lt_tvko-bukrs 'ICC_FI_CN' 'E' '010'
                                     lt_tvko-vkorg '' '' ''
                            CHANGING sy-subrc.
    if sy-subrc ne 0.
       delete lt_tvko.
    endif.
  ENDLOOP.
 
 ranges: r_vkorg for tvko-vkorg.
 
  if lt_tvko[] is initial.
 Message eooo(00) with &amp;#145;No authorization for any Sales Org input&amp;#146;.
  else.
     r_vkorg-sign = 'I'.
     r_vkorg-option = 'EQ'.
     loop at lt_tvko.
          r_vkorg-low = lt_tvko-vkorg.
          append r_vkorg.
     endlloop.
  endif.
 
 
FORM f_bukrs_auth_chk_p USING value(lc_bukrs) TYPE bukrs
                              value(lc_msgid) LIKE sy-msgid
                              value(lc_msgty) LIKE sy-msgty
                              value(ln_msgno) LIKE sy-msgno
                              value(lc_msgv1)
                              value(lc_msgv2)
                              value(lc_msgv3)
                              value(lc_msgv4)
                     CHANGING p_subrc.
 
  AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
    ID 'BUKRS' FIELD lc_bukrs
    ID 'ACTVT' FIELD '03'.
  p_subrc = sy-subrc.
 
ENDFORM.                    "f_bukrs_auth_chk_p&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now range &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;r_vkorg&lt;/P&gt; will have the list of authorized sales organizations. You can use it as the select-option for further processing.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am not on SAP, have just coded from notepad. Please bear incase of any syntax errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 07:27:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616388#M276045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T07:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Authority-Check</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616389#M276046</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;TABLES TVKO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: SO_VKORG FOR TVKO-VKORG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA IT_TVKO LIKE STANDARD TABLE OF TVKO WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;  SELECT * FROM TVKO INTO TABLE IT_TVKO WHERE VKORG IN SO_VKORG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT IT_TVKO.&lt;/P&gt;&lt;P&gt;    AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'&lt;/P&gt;&lt;P&gt;             ID 'VKORG' FIELD IT_TVKO-VKORG&lt;/P&gt;&lt;P&gt;             ID 'VTWEG' DUMMY&lt;/P&gt;&lt;P&gt;             ID 'SPART' DUMMY&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;      DELETE IT_TVKO.&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;  DESCRIBE TABLE IT_TVKO LINES SY-TABIX.&lt;/P&gt;&lt;P&gt;  IF SY-TABIX &amp;lt; 1.&lt;/P&gt;&lt;P&gt;    MESSAGE E208(00) WITH 'No authorization for any Sales Org input'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Oct 2006 07:29:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-check/m-p/1616389#M276046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-14T07:29:27Z</dc:date>
    </item>
  </channel>
</rss>

