Application Development and Automation 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: 
Read only

Pick up cost center based on authorization object

Former Member
0 Likes
596

Hi All,

I have a report which displays information based on cost center.

Now I have to restrict so that the user will be able to view the data from their cost center only.

We are maintaining cost center based on authorization object.

Here my requirement is to pick up the responsible cost center for the users.

Please help me to find out this.

Thanks,

Arun

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
554

Hi

U need to get all Cost Center in according to selection-screen and then do a check of your authorization object by AUTHORITY-CHECK statament.

If the control fails you need to not to show the cost center.

Max

Hi All,

I have a report which displays information based on cost center.

Now I have to restrict so that the user will be able to view the data from their cost center only.

We are maintaining cost center based on authorization object.

Here my requirement is to pick up the responsible cost center for the users.

Please help me to find out this.

Thanks,

Arun

3 REPLIES 3
Read only

Former Member
0 Likes
555

Hi

U need to get all Cost Center in according to selection-screen and then do a check of your authorization object by AUTHORITY-CHECK statament.

If the control fails you need to not to show the cost center.

Max

Read only

0 Likes
554

Hi Max,

is there is anyway to get cost center details from tables.

Thanks,

Arun

Read only

0 Likes
554

Hi

No! There isn't.

U can check the cost center only after selecting it from database, u can't do it while selecting it.

SELECT * FROM <TABLE> WHERE ....
   AUTHORITY-CHECK OBJECT <OBJECT>
        ID <FIELD> FIELD <TABLE-FIELD>.
   IF SY-SUBRC = 0.
     WRITE <TABLE-FIELD>.
  ENDIF.

Max