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

How to check authorization for company code for a selet-option variable

How to check authorization for company code for a selet-option variable

Thank you

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 26, 2007 at 03:14 AM

    You need to take all the valid compnay codes into one internal table than call the AUTHORITY CHECK for every company code in that internal table.

    Like:

    SELECT BUKRS
    INTO IT_BUKRS
    FROM T001
    WHERE BUKRS IN S_BUKRS
    LOOP AT IT_BUKRS.
      AUTHORITY-CHECK 'F_BUK' " <<  I am not sure about the object
       FIELD IT_BUKRS-BUKRS       
       ACTIVITY '03'  " << 
    ENDLOOP.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 26, 2007 at 03:34 AM

    Hi pradeep,

    Use authorization object <b>F_BKPF_BUK</b>.

    Fetch all company codes into internal from select-options.

    SELECT bukrs

    INTO it_bukrs

    FROM t001

    WHERE bukrs IN s_bukrs.

    Loop through ur internal table and check for authorization.

    LOOP AT it_bukrs.

    AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'

    ID 'BUKRS' FIELD it_bukrs-bukrs " passing internal table value

    ID 'ACTVT' FIELD '03'. " u can pass required value

    ENDLOOP.

    check this link for more information:

    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm

    I have considered <b>F_BKPF_BUK Accounting Document</b>: <b>Authorization for Company Codes</b>. This is an object in class Financial Accounting.

    To refer other objects use TCODES SU20 for fields and SU21 for objects.

    Reward me if useful,

    Harimanjesh AN

    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.