# BAPI_ACC_PRIMARY_COSTS_POST — Accounting: Post Primary Costs

> Reposts amounts on primary cost elements between CO objects (the counterpart of KB11N). Programs that transfer cost center or order corrections from an external system in bulk use it. Pass the controlling area and dates in DOC_HEADER; validate first with BAPI_ACC_PRIMARY_COSTS_CHECK and then call BAPI_TRANSACTION_COMMIT.

- Modules: CO
- Type: BAPI
- Function group: K40C
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-acc-primary-costs-post/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| DOC_HEADER | BAPIDOCHDRU12P | Document header (controlling area, dates, user) | Yes |
| IGNORE_WARNINGS | BAPIIW-IGNWARN | Ignore warnings | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| DOC_NO | BAPIDOCHDRU12P-DOC_NO | Posted CO document number |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| DOC_ITEMS | BAPIRCITM | Reposting items | Yes |
| SEND_CRITERIA | BAPIACKECR | Sender CO-PA characteristics | - |
| REC_CRITERIA | BAPIACKECR2 | Receiver CO-PA characteristics | - |
| CUSTOMER_FIELDS | BAPIEXTC | Customer fields | - |
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_ACC_PRIMARY_COSTS_POST'
  EXPORTING
    doc_header = lv_doc_header
  IMPORTING
    doc_no = lv_doc_no
  TABLES
    doc_items = lt_doc_items
    send_criteria = lt_send_criteria
    rec_criteria = lt_rec_criteria
    customer_fields = lt_customer_fields
    return = lt_return.
```

## Related tables

COBK, COEP

