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

PF Status

Former Member
0 Likes
549

Hi,

My report contains one "Reprocess IDOC" Button.But this functionality should be restricted to some user.Only some users should be able to reprocess the idoc those having perticular role.So how should i use this restriction in my report or is there any authorization related change?Please help me out.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
501

Hi,

In the Start of Selection

select * from agr_users (agr roles table is there) into wa where (role = your role that you want to check) where( username) = sy-uname.

If sy-subr ne 0.

message type 'I' with text-001 ( Where text-001) is " you dont have the authorisation to run this Program ".

endif.

With Regards,

Sumodh.P

3 REPLIES 3
Read only

former_member585060
Active Contributor
0 Likes
501

Hi,

In INITIALIZATION event, add a check for the authorization,

Sample

AUTHORITY-CHECK OBJECT 'ZOBJECT''
                          ID 'ACTVT' FIELD '02'
                          ID 'AUTH' FIELD sy-uname.

  IF sy-subrc NE 0.
    MESSAGE e999 WITH text-010.
    EXIT.
  ENDIF.

click F1 on AUTHORITY-CHECK for more info.

Regards

Bala krishna

Read only

Former Member
0 Likes
502

Hi,

In the Start of Selection

select * from agr_users (agr roles table is there) into wa where (role = your role that you want to check) where( username) = sy-uname.

If sy-subr ne 0.

message type 'I' with text-001 ( Where text-001) is " you dont have the authorisation to run this Program ".

endif.

With Regards,

Sumodh.P

Read only

Former Member
0 Likes
501

Hi,

the suggestion of creating your own authorisation object is a good one, but I think you only want the button excluded from your PF-STATUS when the user has no autotisation.

To do so check whether the user has authorisation. If not, add the function to the exlusion table and

SET PF-STATUS 'ZZZZ' EXCLUDING lt_excude_table.

Roy