AUTHORITY-CHECK on cost center

We have set the authorisation (using object cost center) to time admin such that they can maintain leave for certain group of the user.
The question is now how to program the abap code so that my customised leave report can validate the authorisation to ensure that when he generate the leave report, other those employees who are in the cost center that he is authorise to view is listed?
Appreciate if you can share the code.

Hi,
see the help link also.
[http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/content.htm]
program an AUTHORITY-CHECK.
AUTHORITY-CHECK OBJECT <authorization object>
ID <authority field 1> FIELD <field value 1>.
ID <authority field 2> FIELD <field value 2>.
ID <authority-field n> FIELD <field value n>.
The OBJECT parameter specifies the authorization object.
The ID parameter specifies an authorization field (in the authorization object).
The FIELD parameter specifies a value for the authorization field.
The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.
http://help.sap.com/saphelp_nw04s/helpdata/en/52/67167f439b11d1896f0000e8322d00/content.htm
To ensure that a user has the appropriate authorizations when he or she performs an action, users are subject to authorization checks.
Authorization : An authorization enables you to perform a particular activity in the SAP System, based on a set of authorization object field values.
You program the authorization check using the ABAP statement AUTHORITY-CHECK.
AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
ID 'ACTVT' FIELD '02'
ID 'CUSTTYPE' FIELD 'B'.
IF SY-SUBRC 0.
MESSAGE E...
ENDIF.
'S_TRVL_BKS' is a auth. object
ID 'ACTVT' FIELD '02' in place 2 you can put 1,2, 3 for change create or display.
The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.
This Authorization concept is somewhat linked with BASIS people.
As a developer you may not have access to access to SU21 Transaction where you have to define, authorizations, Objects and for nthat object you assign fields and values. Another Tcode is PFCG where you can assign these authrization objects and TCodes for a profile and that profile in turn attached to a particular user.
Take the help of the basis Guy and create and use.

Similar Messages

  • Checking requesting cost center to a company code

    Hi All,
    How to check a requesting cost centre which is belong to a company code ?
    Thank you.
    Nies

    You need to use validation along with a user exit.
    User Exit is some where you write the logic that the company code (BUKRS) of the requesting cost center (AKSTL) should be same as the company code on the WBS (PBUKR)
    Take help of ABAPer in writing the logic of the user exit.
    Regards
    Sreenivas
    Pls close the post if satisfied.

  • Want to check whether cost center exists or not during payroll process ?

    Dear All,
    Requirement is to throw an error for an employee during payroll run if the cost center does not exist.
    I guess this may be achieved by PCR only.  There is an operation OUTWPCOSTC which can help.
    Issue is that there are parameters like VALEN and VAOFF which need to be taken care of while using OUTWPCOSTC.
    Also, when cost center is not assigned, its value in WPBP is BLANK.  How to query a BLANK value in PCRs?
    Can any help on this with an complete example?
    Regards,
    Ankit

    Hi Ankit,
    Try with PCR
    VALEN 1
    OUTWPCOSTC
    Update the PCR in sub schema COPY  Z002                  Edit basic data
    000040 WPBP                        Read Work Center/Basic Pay Data
    000050 GON                         Continue if Data is Complete
    000060 ACTIO ZQ14 GEN              Check if cost centre exits
    000070 BLOCK END                   Edit basic data
    This will help you while runing the Payroll.
    Thanks & Regards
    Vikram Mali

  • Purchase requisition and cost center authorization check

    Hi all,
    in a R/3 4.7, I need to check the cost center (or profit center) when managing (create/modify/view) purchase requisitions.
    I have not found any auths object which perform this check.
    Any idea ?
    A BADI seems to be he only solution, inserting an authorizaton check.
    Thanks
    Andrea

    Hi
    use the BADI in SE18 Tcode
    ME_REQ_POSTED
    implement this and use
    the Method POSTED has the parameter IM_EBKN which has KOSTL field
    this will work
    see the sample code for this BADI
    BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions
    Definition Name: ME_REQ_POSTED
    Interface Name : IF_EX_ME_REQ_POSTED
    Implementing Class: ZCL_IM_PUR_REQ
    Method :            POSTED
    METHOD if_ex_me_req_posted~posted .
      TYPE-POOLS: pgrt.
      DATA: t_txpdat TYPE STANDARD TABLE OF txpdat.
      DATA: s_txpdat TYPE txpdat.
      DATA: t_ident  TYPE pgrt_t_obj_ident.
      DATA: s_ident  TYPE pgrt_obj_ident.
      DATA: ident_tmp TYPE eketkey.
      DATA: nmrid_init TYPE txpdat-nmrid.
      DATA t_obj_event TYPE pgrt_t_obj_event.
      DATA s_obj_event TYPE pgrt_obj_event.
      DATA t_event     TYPE pgrt_t_event.
      DATA s_event     TYPE pgrt_event.
      DATA change_yes  TYPE c.
        IF l_s_eban-estkz NE 'B'.
          CLEAR v_mtart.
          SELECT SINGLE  mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.
          IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.
            MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.
          ENDIF.
        ENDIF.
        IF  l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.
          IF l_s_eban-knttp NE 'A'.
            IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' )  AND l_s_eban-matnr EQ space.
              MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    reward points if useful
    regards
    Anji

  • Cost center not checked during the inbound idoc FIDCCP2

    Hi all,
    Could you please give any input on this strange issue.
    I am testing inbound Idoc FIDCCP2 (GLVOR = 'HRP1' ) with tcode WE19 and when I fill cost center with value 'ZZZZZ' the system post the FI document and deosn't check the cost center like in FB01.
    With FB01 I have a error message "Coste center 'ZZZZ 'does not exist on 21.08.2014" and cannot post the document.
    Thanks.
    Farouk.

    Try OSS note 114814.
    Regards
    Waza

  • Cost center is not getting determined for free of charge delivery

    Dear Experts,
    We have configured a new division, as part of the project, from the SD poing of view all requried config done, from the FI-CO side they created a new profit center and which is assigned to the materials ( of new division).
    Alos completed OVF3 (Cost center determination).
    now the issue is when am checking the cost center in accounting doc after PGI for the new material( new division) is not determined.
    where as when am doing PGI for old material ( other division), cost center is determing.
    Kindly advise what setting  might be missing?
    Serched in goolge but could not find the relavant answer.
    thanks,
    Srinu.

    This is purely FI related issue and you can very well pass on this issue to FI team.  You can also go through the following note for more information.
    Note 83702 - INFO: Acct assignmt logic sales order proc. - REM
    G. Lakshmipathi

  • Error saying cost center/EAT007 validity exists only for 2009

    I am trying to upload the HR details from Non SAP to SAP for 2010, using an interface from T.code se38, I am getting an error saying 
    "Master record for cost center(number)/ EAT007 exists only for 2009".
    When I see the cost center validity in KS02, its validity is from 01.01.2009 to 12.31.9999.
    Could anybody answer this.

    Hi Abhishek,
    I am trying to upload the time sheets of the employees from other software to SAP using the Tcode SE38,
    Later from HR to Co we are using CATs (Cat2 and CAT7) to transfer the data. Time time sheet contais the details of the sales order against which they have spent time, their time consumption for providing services and also the activity type they have performed.
    In SE38, while I am trying to upload the data it shows an error saying "Master record for cost center/EAT007 exist only for 2009".I am trying to upload the data for 2010 Jan to Aug.
    When checked, the Cost center's validity in our system is from 01.01.2009 to 12.31.9999.
    Please assist.

  • Cost Center Reports contains No line items

    Hi,
    I have posted a document in finance and made the assignment to the respective cost centers.
    But when I checked the cost center report KSB1 or any other cost center report, it does't contain any items in it.
    I have checked up the controlling settings and versions controls and locks for the particular cost centers every thing is fine.
    When I am displaying the document overview it is showing the controlling document.
    But I do not kown why it is not appearing in the report called KSB1 or any other plan/actual variance report. It is very interesting why it happens to be.
    Can any one help me in this regard.
    Thanks,
    Srini

    Hi Rakesh,
    When I am executing the transaction KSB1 I am not getting any messages at all.
    It is not displaying any items in it.
    I have checked OKKP, everything is fine. If these setting are not fine how come the document is generated in controlling.
    It is very interesting how the report is not displayed when the document is generated.
    You may be correct I may not have authorisation to display the report.
    How can I check this.
    Thanks,
    Srini

  • RKP2 and RKP3 - Planning activities by cost center

    Hi people,
    I'm having a problem with planning in activity-based costing. I planned an activity in a cost center, executed transaction KP26 and then the transaction CP06. The plan is executed, but when i see Line items, for CO plan documents, i see that system created two documents, one with the object RKP3, which debit the activity and credit the cost center. This is what is supposed, but when i checked the cost center, the value was again debited, which used object RKP2, with just one debit in the cost center.
    My question is: why system restore the value that i wanted to distribute from the cost center to activity, first correctly in RKP3 and then (not supposed..), in RKP2.
    Thanks for the help.
    Cumps.

    Cost Centres are for planning costs.
    Revenue is planned on a Profitability Segment, Sales order which has been enabled for costing, or WBS or Internal order which has been enabled to receive revenue.
    BTW, Profit centres are not CO objects, which is why you need one of the above. Alternatively you can create your Revenue accounts as GL accounts only, then you don't need the cost objects.

  • Cost center in FB01 - User exit or BADI

    Hi,
    I would like to change the cost center field data in transaction FB01 with some other data based upon some conditions.
    Please suggest with user exits or badi.
    thanks.

    Thanks for reply.
    In the user exits mentioned, checking for cost center value in the import parameter DOC_ITEM_TAB and based on some validations i have changed the it to other value. But this new value is not considered by the program still it is creating with the old value.
    The changed value has to be exported from the user exit right? this is not happening as we know dont have cost center field in export or changing parameters
    Please suggest

  • Validation for Cost center for Goods issue against the cost centers

    Dear Friends
    In my client place we have 6 plants are defined and profit centers are defined for each plant. Hence here each plant is one profit center. Cost centers are defined plant wise.
    The requirement is when the goods issued to cost center system should check the cost center is defined against the plant. ( i.e., Cost center def against the Profit Center, and Profit center equal to Plant).
    Is there any provision to assign the plant to profit center or vice versa?
    Please guide me how to resolve the issue.
    Thanks in advance.

    Hi
    Please check EC01. May be it can help you. But in my view it is not possible.

  • Cost center not updated when posting in non leading ledger

    Hello FI Experts
    I have two ledgers - Leading and Non Leading Ledger.
    When I posted expense entry it updated both the ledgers and updated cost center value. This updated value i checked in cost center report KSB1.
    For Ex: Rs. 1,00,000
    Now I posted another expense entry in non leading ledger only. For Ex: Rs.50,000
    How ever this entry didn't updated cost center report value. I checked in report KSB1
    So I want to know:
    1. Are there any cost center reports / profit center reports in controlling module where I can get non leading ledger specific amount in cost centers and profit centers
    2. Is it possible to run assesment and distribution cycle, cost reposting and other CO transactions for non leading ledger amount
    Deepak

    Hi Deepak.
    You can verify is the cost center was posted on document running tcode SE16N on the FALGFLEXA table, put the document number to do research.
    After you can trying to post the new document through Tcode FB50L choosing or not a legder specific, then verify the document was posted correctly running the Tcodes SKb1 or Se16N with FAGLFLEXA table again.
    Also you can check this link Checking the Allocation of General Ledgers to Cost Centres
    Kind Regards
    Jandoval Nascimento

  • 0315 infotype error when we are updating the cost center

    Hi Experts
    for one employee when i am going to change the cost center in 0315 infotype it is giving the error like
    cost center does not exist in CSKS . but i checke in CSKS table it is availble in CSKS
    but i noticed one point in this t-code for last costcenter , controlling area is not availble.
    is this the cause for error.
    Plz advise.
    Thanks

    Hi,
    If you are checking the cost center by querying on CSKS table, The cost center should be of length 10.
    You need to append Zeros to the cost center in the front to make the length as 10 and pass it to CSKS table.
    Use the FM CONVERSION_EXIT_ALPHA_INPUT to input zeros in the front.
    Thanks,
    Sowmya

  • Good Receipt and Cost Center

    I Created PO Stock. and i want to do Good Receipt. but i getting error like this
    Cost center 1000/130102 blocked against direct postings on 08.12.2011
    i have checked the cost center. and yes for cost center 130102 are blocked. what i want to ask is.
    is there any connection between Good receipt and Cost Center. as far as i know, Good Recipt only related with GL Account. except for GR for PO from maintenance Order.
    if it's related what are the T-Code to change/setting the cost center for Good Receipt.
    Thanks.

    Hi Elam24,
    I have checked fs00. and for Cost cneter it's already Optional Entry.
    HI Rajesh Satope,
    yes i have checked the cost center and the cost center should not be used. so how to change the cost center, so when i created GR system will not send an error for this material.
    NOTE : when i do GR for another material. it goes fine.
    Hi Bijay Kumar Barik,
    Thanks. it work. GR related to Cost Center from GL Account. and like Rajesh Satope said. "There are cases where some accounts do require a assignment to CO object". and to Change the cost center for certain GL Account(in my case it's Gl Account for Cost Difference) use T-Code KA03 at Tab Default Account Assignment. change the Cost Center and it's work :).
    Thanks.

  • How to change cost center in Asset Master record ?

    Hi SAP Gurus,
    My client is asking me to change cost centers in Asset Master records using LSMW. Currently, the field cost center is in display mode. In order to change the cost center, the field cost center must be in change mode while recording in LSMW. I have changed screen layout rule for Asset Master data. I have selected radio button "Optional" for cost center in screen layout for Asset Master data. But still cost center field is in display mode in Asset Master record. It must be changeable.
    Please suggest me how I can resolve the issue.
    Regards,
    K.S.K

    Hi Saravana,
    We can change the cost center for AuC Investment measure at WBS element level. For that purpose we need to go to AuC Investment measure Asset master record and check WBS element under Origin Tab. Double click on WBSE and then check the cost center under Assignment tab. And also check the cost center in Asset master record for the same. Now you can go to T.Code CJ12 (Change WBS Element) and change the cost center for the same. Once you make changes system automatically change the cost center in asset master record for the same.
    Note: - Now you have to identify all the AuC Investment measure Assets and the WBS Element for the same. Then change the cost center in WBS Element record. And the corresponding changes will be done in relevant Asset master record automatically.
    But before making the change please check with the PS/PM consultant regarding changes in WBS element. Means where it will effect?
    With Regards
    Ravinder Kaushik

Maybe you are looking for

  • Bridge CS5.1 - Missing info in FILMSTRIP mode

    For some reason the information that used to be availble to see and use (file name and ability to give star ratings to multiple files at once) is now missing from my Bridge CS5.1 (see attached file).  It was working just fine last week but now no.  I

  • When attaching docs to email they appear open in the email and I just want an icon so I can send a pdf file.

    I want to be able to send, for example a .pdf file as an email attachment, but when I use the paper clip to browse and attach a docuemnt it opens the document and pastes the words in rather than leaving an icon.

  • Inputing array data through JTextFields

    Dear All, I am working on a little programme that will manipulate array variables. However, I will like the array data to be added though a GUI form made of text fields. I can input the data as part of the code, but I want it flexible. The array is l

  • Viewing asp pages in Dreamweaver

    Developed an aspx page in Visual Studeo, but cannot view the page in Dreamweaver's design mode - only shows me the code view.

  • I have trouble with 5.1 to 6i conversion.

    I have a program which was created in 5.1 when I opened it in 6i and ran it, my case structures do not work correctly. I have two outputs clk and data. I tell it when clk=0 (True), write data. It does just the opposite. It writes data on the line whe