# BAPI_COSTACTPLN_POSTPRIMCOST — Post Primary Cost Planning

> Posts primary cost planning in a plan version for CO objects such as cost centers and orders (the counterpart of KP06). Programs that transfer budget and plan data from Excel or planning tools to CO use it. The COOBJECT and PERVALUE/TOTVALUE rows are linked through INDEXSTRUCTURE; DELTA = 'X' adds to the existing plan, and if RETURN has no errors call BAPI_TRANSACTION_COMMIT.

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

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| HEADERINFO | BAPIPLNHDR | Plan header (controlling area, year, periods, version) | Yes |
| DELTA | BAPI6031_CTRLDATA-DELTA | Add change to existing plan (delta) | - |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| INDEXSTRUCTURE | BAPIACPSTRU | Index linking objects and value rows | Yes |
| COOBJECT | BAPIPCPOBJ | Planned CO objects | Yes |
| PERVALUE | BAPIPCPVAL | Period plan values | - |
| TOTVALUE | BAPIPCPTOT | Total plan values | - |
| CONTRL | BAPIPCPCTRL | Distribution key control data | - |
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_COSTACTPLN_POSTPRIMCOST'
  EXPORTING
    headerinfo = lv_headerinfo
  TABLES
    indexstructure = lt_indexstructure
    coobject = lt_coobject
    pervalue = lt_pervalue
    totvalue = lt_totvalue
    contrl = lt_contrl
    return = lt_return.
```

## Related tables

COSP

