Skip to Content
author's profile photo Former Member
Former Member

Regarding Authority check step/code

There are 2 group of users : grp1 & grp2.

We have alv report for adding deleting, updating ,records wherein we have to put an authority check where grp1 has authority to change/add records and grp2 can only view records. We are not allowed to use the table maintenance generator...

Can any one provide a sample code with detailed explanation....

Please provide steps/code to implement the same...

Thanks in advance !!!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 12:12 PM

    Hi Suresh,

    The best option is by using the set pf status option in calling an ALV

    The ADD/DELETE/CHANGE buttons needs to be defined in the PF status by using a function code

    We need to come up with some way to identify the user group from current user

    like if current user(sy-uname = 'ABC' then we need to find out if he has grp1 or grp2 assigned to him)

    or some other alternate method to identify his group...

    once this is done we can do like the following(this should be done before calling the ALV or in set pf status subroutine)and exclude the function codes in the pf staus so that user cannot view it

    ----


    data : int_fcode is type table of sy-ucomm with header line.

    if user in grp1.

    int_fcode = 'ADD'.

    append int_fcode.

    int_fcode = 'DELETE'.

    append int_fcode.

    endif.

    -


    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'

    EXPORTING

    i_callback_program = g_repid

    i_callback_pf_status_set = 'SET_PF_STATUS'........

    -


    form 'SET_PF_STATUS'.

    set pf-status 'XXXX' excluding int_fcode..

    endform.

    ----


    Pls check the option out and revert ....

    Also check if in the OOPS alv ,any options are available for direct disabling of buttons ......

    Hope it helps

    Regards

    Byju

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 12:20 PM

    Hi,

    you can create a authorisation object with field 'Activity'.

    eg Activity 1. deletion ---auth grp1......and so on

    you can check in your code if the particular is authorised or not.

    based on that you can make ur ALV editable or Display only.

    Hope this helps,

    Rajat

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.