Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Company code Authorization in custom tcode/ztcode

Former Member
0 Kudos

Dear All,

I have created alv sales report in ECC and it is required to authorize to the users to see only the respective company code or sales org. data. We added customize tcode into roles.But it is not working.

6 REPLIES 6

former_member182877
Participant
0 Kudos

Hi Tayab,

Please create an Auth Object for your fields of concern. Implement the Auth Object in your report. And check for Sy-subrc. If 0 display the values!

Hope this helps.

Cheers,

Kripa Rangachari.

former_member184158
Active Contributor

Hi,

in your report "alv sales report" you can use this statement


AUTHORITY-CHECK OBJECT 'Z_comp_code'

  ID 'ACTVT' FIELD '03'

  ID 'Z_comp_code' FIELD lv_com_code. "

  IF sy-subrc EQ 0.


endif.


and the same for the sales.


refer to this document,may it help you.


http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a5...


Regards

Ebrahim


raymond_giuseppi
Active Contributor
0 Kudos

First analyze any similar standard transaction (e.g. VA01) with transaction SU24, you should easily identify required authority-check.

Add those check in your report, then use SU24 on your z-transaction so adding the transaction to a role with PFCG will add those check to the role.

Refards,

Raymond

former_member182915
Active Contributor
0 Kudos

Hi,

As Suggested by Raymond check with SU24 for authorization object.

Other wise some standard authorization object available to check company code wise or sales org wise authority-check , So for that take the help of SU21  tcode  .

0 Kudos

Thanks All of you, it has solved by applying su21 and authority-check.

regards

former_member182915
Active Contributor
0 Kudos

Hi Syed,

then mark the appropriate answer as helpful or correct and close the thread.