<?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: Regarding security check... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108650#M1185146</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;You need to create authrization Object for department also as like we create for plant,company code..etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT tbl_plant.
*   Calling the subroutine to check each plant code.
    PERFORM plant_code_check USING tbl_plant-werks
                                   v_value
                                   v_errmess
                                   v_subrc.
*   Get out and stop checking on the first failure.
    IF sy-subrc NE 0.
      IF v_errmess EQ space.
        v_werks = tbl_plant-werks.
      ENDIF.
      EXIT.
    ENDIF.
  ENDLOOP.


*********************************************************************************************

FORM plant_code_check USING v_werks v_value v_errmess v_subrc.
* Authorization check here..
  AUTHORITY-CHECK OBJECT 'ZPLANT'
                                                 ID 'ACTVT' FIELD v_value
                                                 ID 'WERKS' FIELD v_werks.

* Checking for Return code from the authority check.
  IF sy-subrc NE 0.
*   If error message printing option is turned on, write error message.
    IF v_errmess NE space.
*   Not authorized for this company code message.
      MESSAGE e000(zm1) WITH text-010 v_werks.
    ELSE.
      v_subrc = sy-subrc.                      "Not authorized
    ENDIF.
  ENDIF.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Parvathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2009 15:19:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-03T15:19:00Z</dc:date>
    <item>
      <title>Regarding security check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108648#M1185144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;I am working on security side of a custom selection report. I have created a a authorization object in SU21 so that any user who does not have authorization will not be able to execute the report by using sy-subrc for authorization-check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one more kind of authorization that is required. There is a dropdown selection field called 'Department' on selection screen which has around thre values. The requirement is security check on that selection field itself, so that when use does a dropdown, he would only see the department for which he/she is authorized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone tell how do I achieve this ? I know that we can specify the values in authorization object for which user can select data but do we have to do any coding for this in ABAP ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 15:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108648#M1185144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T15:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding security check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108649#M1185145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Drop down is created using FM : 'VRM_SET_VALUES' where ID and values hold the content... check the authorization check and send data to the Structures only if the authority check is passed..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN. 
AUTHORITY-CHECK OBJECT 'S_CARRID' 
ID 'CARRID' FIELD carr 
ID 'ACTVT' FIELD '03'. 
 
IF sy-subrc NE  0. 
 vrkme_lstbox_values-key = 'C'.
 vrkme_lstbox_values-text = 'Display All'(015).
APPEND vrkme_lstbox_values TO vrkme_lstbox.
ENDIF.

CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING
     id              = vrkme_lstbox_name
    values          = vrkme_lstbox
  EXCEPTIONS
   id_illegal_name = 1
    OTHERS          = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 15:12:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108649#M1185145</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-02-03T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding security check...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108650#M1185146</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;You need to create authrization Object for department also as like we create for plant,company code..etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT tbl_plant.
*   Calling the subroutine to check each plant code.
    PERFORM plant_code_check USING tbl_plant-werks
                                   v_value
                                   v_errmess
                                   v_subrc.
*   Get out and stop checking on the first failure.
    IF sy-subrc NE 0.
      IF v_errmess EQ space.
        v_werks = tbl_plant-werks.
      ENDIF.
      EXIT.
    ENDIF.
  ENDLOOP.


*********************************************************************************************

FORM plant_code_check USING v_werks v_value v_errmess v_subrc.
* Authorization check here..
  AUTHORITY-CHECK OBJECT 'ZPLANT'
                                                 ID 'ACTVT' FIELD v_value
                                                 ID 'WERKS' FIELD v_werks.

* Checking for Return code from the authority check.
  IF sy-subrc NE 0.
*   If error message printing option is turned on, write error message.
    IF v_errmess NE space.
*   Not authorized for this company code message.
      MESSAGE e000(zm1) WITH text-010 v_werks.
    ELSE.
      v_subrc = sy-subrc.                      "Not authorized
    ENDIF.
  ENDIF.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Parvathi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2009 15:19:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-security-check/m-p/5108650#M1185146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-03T15:19:00Z</dc:date>
    </item>
  </channel>
</rss>

