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

Authorization Check

Hi,

My requirement is as such that a ZFB03 transaction should take me to Autual FB03 for Authorized users.A simple call transaction 'FB03' in the program of transaction ZFB03,doesn't do standard Authorization checks of the FB03.Is there any way to perform Standard Authorization Checks in this Z program?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 04, 2007 at 11:11 AM

    Sure. Debug, or look at the code of FB03, and see what authorisation checks it makes. Then put these into your code.

    You should also check S_TCODE for FB03 access.

    ( I'm assuming you know how to use AUTHORITY-CHECK ).

    matt

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 11:22 AM

    Hi ,

    Try the following code.

    *************************AUHTORITY CHECK IMPLEMENTED************************
    INITIALIZATION.
    
      AUTHORITY-CHECK OBJECT 'ZAOBJECT'
                ID 'TCODE' FIELD 'ZTCODE'
                ID 'ACTVT' FIELD '16'.
      IF sy-subrc NE 0.
        MESSAGE 'NO authorisation found' TYPE 'E' .
      ENDIF.
    
    *************************AUHTORITY CHECK IMPLEMENTED ***********************
    
    

    Before add this part in your code cretaed authority object'ZAOBJECT'

    Where add the activity field 16.

    Regards

    Debjani

    Add a comment
    10|10000 characters needed characters exceeded

    • Yes. In fact it is advised. From the documenation of the function module.

      <i>This function module checks all authorizations as at the start of a transaction, that is, the authorization object S_TCODE and authorization objects that were stored when defining the transaction using SE93. It should be called before a CALL TRANSACTION....</i>

      matt

  • Posted on Dec 04, 2007 at 12:24 PM

    Hi,

    try like this

    FORM sub_check_auth_iwerk .

    --Constant for t code, no tcode hence value = '' (all)

    CONSTANTS: lc_tcd LIKE tstc-tcode VALUE '*'.

    *--Table for all the plants in selection screen. This

    • table will be used for authority check.

    DATA: BEGIN OF li_plant OCCURS 0,

    iwerk LIKE t001w-werks,

    END OF li_plant.

    *--Select query to pick plant from table t001w

    SELECT werks "Plant

    INTO TABLE li_plant

    FROM t001w

    WHERE werks IN s_iwerk.

    LOOP AT li_plant.

    AUTHORITY-CHECK OBJECT 'I_SWERK'

    ID 'TCD' FIELD lc_tcd

    ID 'SWERK' FIELD li_plant-iwerk.

    *--Check SUBRC

    IF sy-subrc NE 0.

    *--No Authorization for Plant

    MESSAGE e016 WITH li_plant-iwerk.

    ENDIF.

    ENDLOOP. "loop at li_plant

    ENDFORM. "sub_check_auth_iwerk

    Regards,

    prashant

    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.