Advertising:

Document posting in finance with fm BAPI ACC DOCUMENT POST

From SAP Knowledge Base

Dependency: vendor or customer to G/L account line as well as S/H indicator

Posting key for vendor/debitor line S/H indicator vendor/debtor line Posting key G/L account line S/H indicator G/L account line
01(customer) S 50 H
31(vendor) H 40 S
05(customer) S 50 H
11(customer) H 40 S
15(customer) H 40 S
21(vendor) S 50 H
25(vendor) S 50 H
35(vendor) H 40 S

Extension parameter 'extension2' / BAdI 'ACC_DOCUMENT'

Using the import parameter 'extension2', additional data can be supplied to the BAPI before processing.

After the import parameter 'extension2' has been specified, an implementation must be created for the BAdI 'ACC_DOCUMENT' and the respective interface method must be programmed, depending on which additional data should be supplied.

Problem: BAPI creates posting with unexpected posting key in vendor or customer line

The BAPI itself tries to recognize what type of posting should be created based on the import parameters (Account Payables, Account Receivable, etc.).

The result is that certain postings are not recognized and are always posted with a posting key of 01 or 31 depending on the customer or vendor line.

For this reason, the posting keys can be explicitly set before the BAPI carries out the processing. The BAPI must be given the most current posting keys for the respective posting using the extension parameter 'extension2'.

The interface method of the BAdI must then be programmed:

=> Procedure: Set posting key explicitly with BAdI


This is a wiki created in the spare time of a private person working in the SAP ERP area. The aim is to collect knowledge for the own use. The wiki is maintained to the best of knowledge and belief.
All products shown, including in form of screenshots, belong to SAP SE. Their trademarks are, among others: SAP®,ABAP®,SAP Fiori®,SAP HANA®,SAP NetWeaver®,SAP® R/3®,SAP S/4HANA®,SAP S/4HANA® Cloud