CO BAPI RFC Used the same way in S/4HANA

BAPI_ACC_ACTIVITY_ALLOC_POST Accounting: Post Activity Allocation

Posts direct activity allocations from a sender cost center and activity type to receiver objects (cost center, order, WBS element, etc.). Interfaces that take production hours, machine hours or service quantities from an external system and post them to CO instead of KB21N use it. Validate first with BAPI_ACC_ACTIVITY_ALLOC_CHECK, then call BAPI_TRANSACTION_COMMIT if RETURN contains no type E/A message.

Function group
K40C
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
DOC_HEADERBAPIDOCHDRPDocument header (controlling area, dates, user)Yes
IGNORE_WARNINGSBAPIIW-IGNWARNIgnore warnings—

Exporting parameters

ParameterTypeDescription
DOC_NOBAPIDOCHDRP-DOC_NOPosted CO document number

Tables parameters

ParameterTypeDescriptionRequired
DOC_ITEMSBAPIAAITMActivity allocation itemsYes
CRITERIABAPIACKECRCO-PA characteristics—
CUSTOMER_FIELDSBAPIEXTCCustomer fields—
RETURNBAPIRET2Return messagesYes

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'BAPI_ACC_ACTIVITY_ALLOC_POST'
  EXPORTING
    doc_header = lv_doc_header
  IMPORTING
    doc_no = lv_doc_no
  TABLES
    doc_items = lt_doc_items
    criteria = lt_criteria
    customer_fields = lt_customer_fields
    return = lt_return.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report