<?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: Authority Object in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978555#M1604419</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 can achieve this as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF sy-tcode EQ 'tcode-name'.
    AUTHORITY-CHECK OBJECT 'zxyz'
             ID 'zxyz_tcode' FIELD 'tcode_name'
            ID 'zxyz_field' FIELD 'col_name'
             ID 'ACTVT' FIELD '02'.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;01 - create or generate&lt;/P&gt;&lt;P&gt;02 - change&lt;/P&gt;&lt;P&gt;03 - display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'zxyz_tcode'  - are the Authorization fields that needs to be configured in the Authorization Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sowmya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Jul 2011 04:38:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-07-01T04:38:09Z</dc:date>
    <item>
      <title>Authority Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978554#M1604418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guru's,&lt;/P&gt;&lt;P&gt;               I am facing a bit of problem to understand authority objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example. : I have authority object - ZXYZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which has 3 id's - A, B, C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the authority - I have to set certain editable columns in a custom report as not editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If autho object zxyz and id A is sy-subrc = 0 then column one will be non editable, but col 2 and 3 will be editable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we achieve the same? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Swordfish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 01:37:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978554#M1604418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-01T01:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978555#M1604419</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 can achieve this as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF sy-tcode EQ 'tcode-name'.
    AUTHORITY-CHECK OBJECT 'zxyz'
             ID 'zxyz_tcode' FIELD 'tcode_name'
            ID 'zxyz_field' FIELD 'col_name'
             ID 'ACTVT' FIELD '02'.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;01 - create or generate&lt;/P&gt;&lt;P&gt;02 - change&lt;/P&gt;&lt;P&gt;03 - display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'zxyz_tcode'  - are the Authorization fields that needs to be configured in the Authorization Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sowmya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 04:38:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978555#M1604419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-01T04:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978556#M1604420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please refer the below link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://sap.mis.cmich.edu/sap-abap/abap06/sld023.htm|http://sap.mis.cmich.edu/sap-abap/abap06/sld023.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above example is same as your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sowmya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 04:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978556#M1604420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-01T04:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978557#M1604421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this logic by passing different values to g_field and gc_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   IF g_field IS NOT INITIAL.

      AUTHORITY-CHECK OBJECT 'ZOBJECT'
               FOR USER g_user
               ID 'ZFIELD' FIELD g_field.

      IF sy-subrc NE 0.

    LOOP AT SCREEN.
      IF screen-name = gc_field.
        screen-input = gc_false.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

      ENDIF.

ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 04:43:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978557#M1604421</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2011-07-01T04:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Authority Object</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978558#M1604422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you are using ALV grid the code should look something like this (i will write only parts of code for better understanding):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) create field catalog based on custom structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call function 'LVC_FIELDCATALOG_MERGE'
    exporting
      i_structure_name       = 'ZPPREQ_ALV_ST'
    changing
      ct_fieldcat            = gt_fieldcat[]
    exceptions
      inconsistent_interface = 1
      program_error          = 2
      others                 = 3.

 ls_fiedcat-edit = 'X'.
modify gt_fieldcat from ls_fiedcat transporting edit where fieldname = 'BUKRS' or fieldname = 'GJAHR'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZPPREQ_ALV_ST - is a custom structure which you have to create via se80 tcode and it should have field CELL_TAB type	LVC_T_STYL. it is table responsible for fields edit state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) define ALV grids layout:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;cs_layout-zebra      = 'X' .
cs_layout-smalltitle = 'X'.
cs_layout-cwidth_opt = 'X'.
cs_layout-stylefname = 'CELL_TAB'.
cs_layout-edit       = 'X'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to identify that this table is responsible for cells style (editable/ non editable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Select data and call ALV grids object for first display and make additional logic if it is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) change fields state:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at it_outab reference into lp_outtab.

authority-check object 'F_BKPF_BUK'
   id 'BUKRS' field lp_outtab-&amp;gt;bukrs
   id 'ACTVT' field '02'.

if sy-subrc ne 0.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can get fields name dynamically:&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/groups/technical-functional/sap-dev/how-to-loop-through-itab-and-get-field-names-614424" target="test_blank"&gt;http://sap.ittoolbox.com/groups/technical-functional/sap-dev/how-to-loop-through-itab-and-get-field-names-614424&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you could use some other logic up to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
case fieldname.
   when 'BUKRS'
     ls_cell_tab-fieldname = 'BUKRS'.
     ls_cell_tab-style = cl_gui_alv_grid=&amp;gt;mc_style_disabled.
     append ls_cell_tab to lp_outtab-cell_tab.
   WHEN 'GJAHR
....
   when others
endcase.

endif.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dez_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 04:53:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/authority-object/m-p/7978558#M1604422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-01T04:53:26Z</dc:date>
    </item>
  </channel>
</rss>

