Create Cost center using Bapi_costcenter_createmultiple

Hi All,
This is the first time that i am working on BAPI.
I have to upload an xcel sheet which has the data of required filds that are needed to create the cost center in tcode KS01.
So my flat file is ready to be used.
I am unable to use the bapi to upload this data and i am also getting a runtime error.
I am posting my code. Please help me out to finish the requirement.
DATA: T_COST     TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE,
      T_CONT     TYPE BAPI0012_GEN-CO_AREA,
      T_LIST     LIKE BAPI0012_CCINPUTLIST OCCURS 0 WITH HEADER LINE,
      T_RETN     LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: V_FILE like IBIPPARMS-PATH,
      v_field like DYNPREAD-FIELDNAME,
      v_file1 like RLGRAP-FILENAME.
CALL FUNCTION 'F4_FILENAME'
   EXPORTING
     PROGRAM_NAME        = SYST-CPROG
     DYNPRO_NUMBER       = SYST-DYNNR
     FIELD_NAME          = v_field
   IMPORTING
     FILE_NAME           = v_FILE
v_file1 = v_file.
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                      = V_FILE1
      i_begin_col                   = 1
      i_begin_row                   = 2
      i_end_col                     = 8
      i_end_row                     = 3
    tables
      intern                        = T_COST
   EXCEPTIONS
     INCONSISTENT_PARAMETERS       = 1
     UPLOAD_OLE                    = 2
     OTHERS                        = 3 .
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
CALL FUNCTION 'BAPI_COSTCENTER_CREATEMULTIPLE'
        EXPORTING
          controllingarea            = T_CONT
         TESTRUN                    = ' '
        MASTER_DATA_INACTIVE       = ' '
         LANGUAGE                    = sy-langu
        tables
          costcenterlist             = T_LIST
          return                     = T_RETN
        EXTENSIONIN                =
        EXTENSIONOUT               =
   LOOP AT T_RETN.
     WRITE:/ T_RETN-MESSAGE.
   ENDLOOP.
Regards,
Darpana

Hi,
In Bapi  parameter TESTRUN pass 'X' 
CALL FUNCTION 'BAPI_COSTCENTER_CREATEMULTIPLE'
EXPORTING
controllingarea = T_CONT
TESTRUN = ' '
MASTER_DATA_INACTIVE = ' '
or after 'BAPI_COSTCENTER_CREATEMULTIPLE'
use BAPI_TRANSACTION_COMMIT.
Thanks,
Krishna..

Similar Messages

  • Error in create  cost center

    ks01 transaction code i used while create cost center first error is no standard hierarchy so i used kkop code then i gave hierarchy name gave enter but error is hierarchy name does not exist.-->how to solve this error can any one answer this ?

    Hi,
    Create Standard Hierarchy in OKKP t.code and  active cost components for your controlling area
    Example: Active
    Cost Centers : Component Active
    Order Mgmt: Component Active
    Now asssign Standard Hierarchy during creation cost center (KS01)
    Regards,
    Biju K

  • Configuring ISR Scenario SRK1 (Create Cost Center Request) with Adobe forms

    Hello,
    I am trying to configure the ISR scenario SRK1 (Create Cost Center Request) with Adobe Interactive Forms.
    However when I am trying to generate the form, it is giving an error TR015(Object can only be created in SAP package)
    Apparently by default it tries to create form Adobe form ISR_FORM_SRK1.
    Even if I change that name to ZISR_FORM_SRK1, it tries to create interface ISR_IF_SRK1 which is in SAP's namespace and I cannot generate the form. I cannot seem to be able to force SAP to use a different Interface name. The field for the interface is greyed out and is not picked up
    Am I missing any step or is there any fix to this problem?
    regards,
    Atul Kulkarni

    Hi,
    From the config it picks the formscenario(SRK1) and prefixes the same for adobe form.
    I think the best option would be to copy the Stnadard form scenario to ZSRK1 and proceed. This copy can be done from the config 'Manage Form Scenarios' under this select the option 'Copy form scenario'. This copies the entire config from SRK1 to ZSRK1.
    Regards
    Srikanth KV

  • Business area is mandatory when creating cost center

    Hi ,
    I have an error while creating cost center. business area is a mandatory field when I am trying to create cost center. I want to make it ( business area ) optional . How it is ?
    Thanks

    hi
    Go to OBC4 select your Field sataus varient in that select G004 ,double click on G004 in that Additional Account assigenment Select Business Area As Optional.it will work
    if your problum is solved pls assign me points
    Regards
    ramana

  • Problem in creating work center using bapi

    hai all,
    i am creating work center using " CRAP_WORKCENTER_CREATE ", it is also getting created successfully when I try to check CAPACITY for capacities and scheduling it is giving a error called.
    " in table T006 entry is missing " . why it is comming like that.

    Hi Goutam/Ram,
        I am trying to create capicity . I am useing CRAP_CAPACITY_CREATE .
       But I am getting so many errors. Is it the right Bapi or do know any other BAPI.
       We are trying to copy Capacities and work center from one plant to other.
    Plz send if you any documentation or code. Also send work order creating code.
    Thanks in Advance.

  • What is the T-Code for creating Cost center - profit center standard hierar

    Hi,
    What is the T-Code for creating Cost center - profit center standard hierarchy.Please provide me the T-codes.
    Thanks

    Hi Supriya,
    Create / Change Cost Center Standard Hierarchy - OKEON
    Display Cost Center Standard Hierarchy - OKENN
    Create Profit Center Standard Hierarchy - KCH1
    Change Profit Center Standard Hierarchy - KCH5N
    Display Profit Center Standard Hierarchy - KCH6N
    Srikanth Munnaluri

  • Average Headcount for Cost Center using Infotype 0027

    Hi everybody,
    has any of you experience  calculating an average headcount for cost center using the information of infotype 0027.
    As far as I know the infosources por PA-PA does take into account the infotype 0027 and the employee is just count for the master cost center.
    I can not find the way to split the employee in different cost centers.
    Any help will be very useful.
    Thanks a lot.
    Cristóbal.

    Remi,,, hi many thanks!! It worked out well!!!
    Many thanks as always,,,,

  • To make profit center as mandatory while creating cost center

    Hi,
    what is the procedure to make profit center as mandatory while creating cost center.
    Thanks and Regards
    Boppana

    Hi Boppana,
    There are two possibilities to have the profit center field as
    mandatory in KS01 (cost center creation):
    a) You can modify message number KS096 to "Error" via OBA5.
       Thus, the users would no be able to save a cost center without enteri
       a profit center.
       Depending on Your release you can make KS096 modifiable by
       implementing note 486781.
    b) You can directly modify the field via SE51 (SE51 -> Element list ->
       Rider Special Attributes) to mandatory entry.
       But in order to do this, You will need an SAP developer and
       object key (available via OSS ).
    I would strongly advise method a). It's simpler and you don't
    have to modify a SAP object (it would be a modification of the standard)
    br, Guido

  • Profit Center Mandatory when creating Cost Center

    Hi,
    How do we make Profit Center Mandatory when creating Cost Center, I remember doing this and cannot recollect as to how i did this in a previous version 4.0b.
    Pls advise how to do the same in ECC 5.0 and higher..
    Thanks,
    Praveen

    Dear Praveen ,
    First u will creat PCA then u will acitvit .
    while creating cost center u have to give profit cnenter accounting .
    ur not enter pca aacoutno then it will give the error message account is activted but profit cneter account not given
    Regards
    Suresh

  • Create cost center

    Dear sir.
    Im creating a cost center, on " create cost center: basic screen" - profit center, I choice a profit center I created before, but it says: " Profit center VNMH/100 does not exist" (VNMH is controlling area), and I check again, in fact that cost center 100 is created.
    help me deal this problem.
    Thanks,
    Hangvt

    Hi,
    you have to make sure that
    1. the profit center created is actived and is valid for the whole time range of the cost center
    2. the company code of the cost center has to be activated in the profit center master
    3. the company code has to be assigned to the same controlling area like the profit center controlling area.
    cheers,
    daniela

  • Error while creating Cost center

    Hi,
    After creating Cost center in KS01 when i try to save it,
    it is showing error that "The Persona Responsible say example BORISA01 not Valid".
    How to correct it?
    Thanks
    Swetha

    Hi Swetha,
    In standard setup, this field is set as required but usually this is not setup with a validation. There is not even an F4 option to search for available users.
    However in order to find where this issue is arising please reference the 5 Digit Error code that appears.
    Debugging via "/h" in the transaction field may be required to see what validation has been setup if custum code has been entered.
    This field is not connected to a database table for lookup it is simply an character field where you can enter any value.
    You could also check the 5 digit error code. If this is a custom error you may be able to change it to a warning rather than an error message via the Custum Message Handler. This should then allow you to bypass the validation if one is setup and you should be able to enter any value.
    Kind Regards,
    Brendan

  • Create cost center only can use the fixed controlling area ?

    Hi all,
    When i create a cost center, i find the controlling area is fixed. How  to change it ?
    Regards,
    Yinyan Lu

    In KS01 initial screen access the menu
    Extras --> Set Controlling area
    or press F6
    to change the controlling area

  • Report Painter library for Classic GL for creating cost center report

    Hi,
    I am sure everyone knows what my query is.
    I have tried using library GLTO, GLT1, GLT2, CCSS, GLFUNCT but when i am trying to create/execute report using report painter for cost center but no records are selected. I have checked the settings they all are correct as i have run it for another company code, secondly for GL reports using report painter there is no such error.
    Regards,
    Mohammed Ali Khan.

    Hi Christian,
    So for the late reply... I already check the Scenario FIN_PCA in assigned to our Ledger...
    Are there other ways to generate my report on the report painter? ( Profit center as Column, And GL account and cost center on the row)
    Thanks,
    JM

  • Create Cost Center relationship usin SAP-PD

    Hi all,
    SAP_PD is allowing to deal only with O, S and C object. How we can create new relationship to  Cost Center (K)  using SAP_PD.
    Any ideas?
    Thanks,
    Oleg
    Edited by: Oleg Sokolov on May 26, 2010 2:26 PM

    You can 'start' an SAP_PD service with an Position, Job, or Org Unit. But you can update ANY relationship to that object (even cost center). Play around with it a bit and I'm sure you'll stumble up on the solution.
    Derrick Banks
    Banks & Company, LLC

  • Statistical posting to Cost Center using Statistical Internal Order

    We have a delivery transction in SD which used both a statistical order and cost center as account assignment objects.  However, in the cost center report, the amount was shown in the statistical portion of the report.  Why could have happened?  Shouldn't the item be shown as a true posting?

    When you post to an internal order and cost center one of these is statistical
    When you say the internal order is satistical then you have actual cost on costcenters. When the internal order is not statistical the internal order get the actual cost and the cost center statistical.
    In the fieldstatus group from the internal order you can make the field statistical requered. When you want only to have statistical cost on your internal order.
    With CO-PA it is an different case, see the other reaction on this. But then it is better to use profit center accounting for reporting. 
    Note SD is posting sales (sales cost) and there should no reason to post it on a cost center
    Paul

Maybe you are looking for

  • Error message when trying to set up shared printer

    I can't seem to add my ancient agfa imagesetter to my list of printers. The rip software is running on an old mac running system 9. I've tried typing in the printer's IP address, but that doesn't work either. So I thought I could work around that by

  • How to import a table from another database using DB toolset.

    Hello All I would like to import a table from one database to another using DB toolbox. I do not want to import all data to LV and then save them to another database. Instead I would prefer to use SQL syntax. Does anobody know how to write SQL comman

  • InsertMissingToData X order of elements

    Hi friends! Is anyone able to help me with this issue? I have a to assign an element to another with insertMissingToData enabled, but the order of the elemets is not right ather the assignment, I've made a small poc to make it easier to understand: H

  • Problems with IPod turning on and other things.

    Recently I turned on my IPod shuffle and the green light goes on. I am thinking, great, it is working, but then the light won't turn off and because of it I can't press play or use any other buttons available to me. Somtimes where that green light go

  • Admin.jar connection refused

    I have an EAR file built in JBuilder 7 which I'm trying to deploy to my demonstration Application Server using the JBuilder 7 plug-in for OC4J. Whenever I try to deploy, I get ...\jdk1.3.1\bin\java -jar "...\ora90\j2ee\home\admin.jar" ormi://localhos