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


Hi all,

while creating a salesorder with the function module BAPI_SALESORDER_CREATEFROMDAT2 I want to pass the cost center within the positions.

But I don't find any fields where I can transfer the cost center into the BAPI function module.

The table for the items (bapisditm) and the table for the conditions (bapicond) do not offer the possibility to pass the cost center.

If you go into the transaction VA01 and enter a position you are able to open the detail for the positions and switch to the account assignments for entering the cost center.

Does anyone has a solution how to transfer the cost enter using the BAPI function module?

Kind regards,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Nov 18, 2009 at 01:36 PM

    Hi, Georf...

    I've followed the path provided by you but what I find there is the Profit Center... That field is placed in the BAPISDITM structure as PROFIT_CTR.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      We have tried to perform the same as suggested in my code but the cost center still does not get copied into the sales order that created. We could not add the cost center into VBAPKOM and VBAPKOMX as there is an error during the activation mentioned there is duplicate field name KOSTL in the structure. Please advise if anything is missed.

      ** Moving extension of VBAP

      lwa_bape_vbap-vbeln = space.

      lwa_bape_vbap-posnr = '000010'.

      lwa_bape_vbap-kostl = lwa_cntrct_item-kostl.

      APPEND lwa_bape_vbap TO lt_bape_vbap.

      lwa_bape_vbapx-vbeln = space.

      lwa_bape_vbapx-posnr = '000010'.

      lwa_bape_vbapx-kostl = 'X'.

      APPEND lwa_bape_vbapx TO lt_bape_vbapx.

      CLEAR lwa_extensionin.

      MOVE 'BAPE_VBAP' TO lwa_extensionin-structure.

      ** Conversion to Unicode

      CALL METHOD cl_abap_container_utilities=>fill_container_c


      im_value = lwa_bape_vbap


      ex_container = lwa_extensionin-valuepart1.

      APPEND lwa_extensionin TO lt_extensionin.

      MOVE 'BAPE_VBAPX' TO lwa_extensionin-structure.

      MOVE lwa_bape_vbapx TO lwa_extensionin-valuepart1.

      APPEND lwa_extensionin TO lt_extensionin.


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.