BAPI_SALESORDER_CREATEFROMDAT2 Error with profit center
I am using BAPI_SALESORDER_CREATEFROMDAT2 to create a sales order, but it is not being created. The return tab shows this:
S V4 233 SALES_HEADER_IN has been processed successfully
E KM 026 Profit center 2000/2000 does not exist for 08.04.2010
E V4 248 Error in SALES_ITEM_IN 000000
W V1 555 The sales document is not yet complete: Edit data
E V4 219 Sales document was not changed
I am exporting teh profit center like this:
it_items-profit_ctr = '2000'.
The strange thing about this is that when I create the sales order manually, using VA01 and the same parameters I am using in the BAPI, the sales order is created.
What am I doing wrong?
Thanks in advance
Welcome to SCN!!!
This looks like Profit center is not valid as on date. Please check with your functional whether this is the valid Profit center for you sales area and for the given date.