Symptom
You receive error "The document has too many line items (maximum number = 997)" when you carry out allocation posting using API Create Allocation Posting.
Environment
- Financial Accounting (FI)
- SAP S/4HANA Cloud Public Edition
- SAP Fiori
Cause
One original line item from SOAP/xml will generate 3 internal line items in CO documents (there are also some cases that a posting record may need up to 4 line items). All these generated internal line items are counted and the total number should not exceed 997.
Resolution
The suggested line items limitation in SOAP request would be 249 items.
See also note 380823 BAPIs for manual actual postings: error BK829 where referenced in solution it may be necessary to reduce the number of posting records even further
Keywords
SOAP, AllocationPostingCreateRequest_In, BAPI_ACC_ACTIVITY_ALLOC_CHECK , BAPI_ACC_ACTIVITY_ALLOC_POST, KB21N, SAP_COM_0315, 997, xml, BK829 bk 829, bapi, controlling, CO, K40C