Determine company code and location (plant) w.r.t., cost center

How could i determine company code and location based on given cost center. Could anybody please let me know if any table or function module is available to get this.
Thank you

As mentioned above im using META_READ_TABLE FM to get company codes from CSKS table of ECC. Below is the code im using:
       i_res type STANDARD TABLE OF TAB512.
Constants:   c_expr(72) TYPE c VALUE 'KOSTL EQ COST_CTR', c_fld(5) TYPE c VALUE 'BUKRS'.
  w_opt-text = c_expr.
w_fld-FIELDNAME = c_fld.
append: w_opt to i_opt,
        w_fld to i_fld.
**&&--Get Co code from ECC (CSKS table)
    QUERY_TABLE          = c_table
*   DELIMITER            = ' '
*   NO_DATA              = ' '
*   ROWSKIPS             = '0'
*   ROWCOUNT             = '0'
    LOGICAL_SYSTEM       = v1_logsys
    OPTIONS              = i_opt
    FIELDS               = i_fld
    DATA                 = i_res
    CONTROL_RECORD       = i_control.
however it is giving me 'Communication Error' while executing this piece of code. I guess the problem here is with table i_opt which is holding logical expression. while calling this fm system is not recognizing logical expression 'KOSTL EQ COST_CTR'. Could anybody has any suggestion for this. please advise.

Similar Messages

  • PO creation-ME21n-Why SAP does not check company code and Plant relation

    Hi All,
    Does someone know, why SAP does not check Plant and company code relation at the time of PO creation or how can we put validation between plant and company code at the time of PO creation.
    <b>Example:</b> Suppose i have a company 0001 which is assinged to Plant 0001. when i am creating a PO with another company code 0002(Entering at header level-Org, data) and using Plant 0001 at line item level. SAP does not do this validation.
    How can we put this check in place?
    Thanks in advance.

    Hello Deepak,
    There are three types of purchasing
    - Company code specific :You need to assign company code to Pur organization
    - Plant specific : You must assign plant to pur organization
    - Cross company purchasing: No assignment between company code and pur organization.
    In the case 3, the system will not check company code and plant relationship, but it will check plant and pur organization specific.
    The following is the copy of sap help text:
    You can assign a purchasing organization to one company code. This is company-specific purchasing.
    You can assign a purchasing organization to no company code. This purchasing organization can then procure for all plants assigned to it, irrespective of the company code to which the plant belongs.
    Since each plant must be assigned to a company code, the company code can be determined via the plant in each procurement transaction, even if the procuring purchasing organization is not assigned to a company code.
    A purchasing organization must be assigned to one or more plants. This is plant-specific purchasing.
    Now, check your company-code and purchase organization assignment.
    Hope this helps.
    Arif Mansuri

  • Creating order with out Company code and plant - just for pricing -possible

    Hi gurus
    Just for creating sales order (let us say no delivery and no billing, client was not intrested in the initial setup) for just pricing thing, does we really need Company code and plant. with out that just with sales org setup(sale org+D.C) can I create an order to full fil the pricing scenario.
    Please I need help on this

    hi kris,
            we cannot create a order with out company code and plant , due to the following reasons
          we do not require the company code to create the order , but we require the plant to create a material and use it in the sales order .and we require a company code to create a customer .
    the pricing procedure is determined depending upon the sales area(sales org+distribution channel +division).
    please reward the points if it is helpful

  • Where can I find the relation between company code and plant?

    where can I find the relation between company code and plant?
    I need to the list of plants under a company code.
    Which table?

    yes,wayne weng   .What you said is right.
    Thank you very much!
    My MSN:[email protected]

  • Function Module to get Company code and Plant on the basis of infotype and pernr

    Hi Experts,
    I need to know the function module which will return company code and plant based on infotype and pernr(employee Number).
    Salil Bagchi

    I think thats the only way
          persnr          = p0001-pernr
          in_rgdir        = it_rgdir
          no_record_found = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    check whether "Pay date for payroll result" with in Start Date and
                  End date, and "Reason for Off-Cycle Payroll" is initial
      LOOP AT it_rgdir WHERE paydt >= v_begda
                             AND paydt <= v_endda AND
                             void IS INITIAL
                             AND ocrsn IS INITIAL
                             AND srtza = 'A'.
        v_seqnr = it_rgdir-seqnr.
    Hope this helps.

  • Which table contains both company code and Plant

    Which table contains both company code and Plant?
    which table contains Purchase requisition number and Company code?
    Please help me.

    plant and company code <b>marc</b>
    MANDT     MANDT     CLNT     3     0     Client
    MATNR     MATNR     CHAR     18     0     Material Number
    WERKS     WERKS_D     CHAR     4     0     Plant
    Purchase requisition number and Company code in <b>ekpo</b>
    MANDT     MANDT     CLNT     3     0     Client
    BANFN     BANFN     CHAR     10     0     Purchase requisition number
    reward fi usefull

  • Assignment of Purchase Organization with Company Code and Plant

    Please give me solution to Assign Purchase Organization with Company Code and Plant. While creating a material in organization level plant and purchase organization should be assigned.
    Please help me out.

    I am not sure if i have really understood your query.
    Material creation means creating master data, as far as creation and assignment of organization elements with other organizational elements are concern for eg : purchase org in you case is part of standard configuration.
    You create Purchase org using t-code OX08 here you copy from and existing one and then chane the description of Pur org as per your requirement.
    You assign Purchase Org using t-code OX01 to company code assignment, t- codeOX17 for plant assignment to Purchase Org.
    Normally you do all your changes in Devlopment server save the changes in an transport request then move it to quality and production enviornment.
    Hope this helps.

  • No company code found for plant 0001 and sales organization 0001

    Hi BW Experts,
    I am using the datasource 0PLANT_ATTR.While loading the data, i am getting the warning message as "No company code found for plant 0001 and sales organization 0001". I have replicated all the Currencies by using the "Global Settings".Do i need to do any settings in BW Side.
    Please help on this Issue.

    Hi Ram,
    It is not pertaining to the Currency translations or any?
    The warning message is because:
    In the 0PLANT there is 0comp_code as attribute; while loading the data from 0PLANT_ATTR datasource there for that particular PLANT "0001" and Sales Org "0001" system couldnt find the 0comp_code.
    As it is not maintained in the R/3 system.
    This is why the warning messages are coming out..
    Hope you understood...
    Ravi Kanth

  • STO-Within same company code and same sales organisation

    hi freinds
    i need steps for STO Within same company code and same sales organisation "xyz" with different plant "X " and  " Y"
    with regards

    Sales organization is linked to sending plant. It does not matter if receiving plant is using the same or different sales organization. The setup from sending plant is independent from that.
    As for the STO standard setup, I suggest you search SDN first. Below example link.
    STO setup article link:
    Dominik Modrzejewski


    Hi guys,
    My company is building a new plant. They are in the process of deciding whether to create a new company code or create a new plant in SAP. I need to know the advantages and disadvantages of both options. Finally, I need to know which one is the best choice in your opinion.

    I feel as if I'm bothering you. I just have one last ?. How do you do postings in FI? Normally, you do postings through the company code. Since we are designating the plant under the company code and setting up the plant as a profit center. How can we do postings in FI.
    Also, I am doing a presentation to the business, to convince them of why we should do a plant instead of a company code. Do you have any other points I could use to convince them that the plant is better than the company code. And could you play devil's advocate and tell me what kind of things they might say to defend their "old time view" of setting the plant up at a company code?
    Thank you very much for your help,
    Your points will be rewarded
    Not at all. U can define ur Plant as a separate PC and all ur materials can be assigned to this PC. Further ur Plant can be divided in to several cost center and these cost center can be assigned to this PC. When u are making postings to FI u need to assign it to a cost cent or other objects which is turn will populate the PC on the basis of the assignment u made to these cost objects. Every cost objects created in this plant will have the assignment to this PC by this way u can effect postings to this PC and hence the PL account for this PC.
    This will be a good link for understanding the assignment

  • How to get new company code and controlling area in SRM

    Hi SDN,
    we are on SRM 5.0.
    Our finacial experts want to implement a new company code and controlling area.
    In SRM I can set up a new company code easily in ppoma_bbp and import a new plant from backend for the new company code.
    When testing in EBP I get the error: "company code xyz not available in controlling area zzz"
    So I need to import the new backend controlling area, too. How can I get the second controlling area in SRM?
    Thanx for help,

    Hi Muthuraman Govi  and Sanjeev,
    in fact I can see in backend in transaction KS03 (show cost center) there in the F4s, which comp.code + controll area combinations are valid and have indeed cost centers assigned.
    So I have a new valid comp.code and a new valid cont.area.
    The new comp.code belongs to the new contr. area.
    In SRM I set the BUK attribute as described by Sanjeev (I had that already done). Still, if it is like you say, why do I get an error in EBP when trying to buy products from the new plant in the new company code...
    Is there any more necessary in backend or SRM?
    kind regards, matthias

  • Steps to define company code and its dependent entries for mm,pm

    Hi Experts,
    kindly share that how to define company code and its dependent assignments for PM & MM module

    Dear Hitendra
    Company code, Contolling area, Profit Center are Financials related fields and are mapped under FI Enterprise structure as its Org unit. Plant (Logistics Plant) is defined in MM. Related modules like PP, PM, SD extend this logistics plant in their repsective modules as Production Planning Plant, Production Plant, Maintenance Planning Plant, Maintenance Plant, Sales Plant etc.
    Company code is never defined in any logistics moudle , its in Financials where it is defined. It is then assigned to the Plant in logistics thru which the company code gets populated easily in respective modules.In contolling end, its controlling area that talks.
    IMG-->SAP Customizing Implementation Guide->Enterprise Structure-->Definition-->Financial Accounting-->Edit, Copy, Delete, Check Company Code
    This is a very broad upper level details for your query. Please search the SCN in relevant spaces for more information.
    Award points if the above explanation was useful...
    Murad Ahmed.

  • Company code and Purchase Org during vendor registration

    I have one enterprise context, with many company codes and purchasing org.
    I am aware that vendor master data is at enterprise level in ESO. However while integrating to backend i need to capture the relevant co code and Purchasing org.
    When the Purchaser wants to create a vendor, there does not seem anyway to enter which Purchasing org and company code the vendor should be created for.
    Need your suggestions for the following options
    1) capture co code and Purchasing org on bespoke fields and then in PI, pass these values to Co code and Purch org resp
    2) create company contexts - would this resolve this? what are the implications if one vendor needs to be extended to multiple co codes

    Have you imported integration config workbook.
    As part of ECC integartion  guide we have couple of workbook and XML needs to integrated, which will create all the required extension for vendor master and vendor registration.
    Once you imported the integration workbook, you will able to see the company code and purchasing org screens in vendor master.
    Thank you,

  • How to find out company code from a plant ?

    Hello friends,
    I have to modify a program that uses FM "BAPI_COMPANYCODE_GET_PERIOD".   For that, we have to export company code ID.  Currently it is hard coded with one company code.  Now we want to make this program usable by all company codes.  So instead of hard coding, I would like to dynamically find out company code based on the plant.   So I want to know - how to find out company code from a plant ?  Is there any table that has plant to company-code assignment data, or any other FM/BAPI to get this info ?
    - Chetan

    u can find this from table T001K
    or just goto EC01
    here click on STRUCTURE>NAVIGATION
    double click on co code u will get the list
    u can slo try this in EC02

  • Authorization object for company code and profit center together

    Hi all,
    Please help me with the following requirement..
    Company Code = ABCD
    Profit Center = *
    The user is authorized to run the report for company code ABCD only but any profit center within this company code.
    2       Company Code = *
    Profit Center = WXYZ
    The user is authorized to run the report for Profit Center WXYZ only but any company code.
    3       Company Code = *
    Profit Center = *
    The user is authorized to run the report for any company code and profit center.
    The same user could have 1 and 2. So, in this case he should be able to run a report for the total inventory of company code ABCD, and a report for total inventory of profit center WXYZ only regardless company code.
    He should not have visibility to other company codes inventory other then profit center WXYZ.

    Hi ,
    Anyone please help me..

Maybe you are looking for