The Tip Doctor, Insider Learning Network
In an elementary accounting document with only two line items, the first item is a credit item and the second one is a debit item. When performing such a posting manually in the SAP system, you have to enter the company code and document currency for a whole document. Then for each line item, you need to enter the posting key (which defines the account type and debit/credit indicator), the account number (or customer/vendor number), and the amount. The corresponding demo report showing the process of generating the simplest accounting document is ZDEMO_ACC_BAPI.
For the same operation when using a BAPI, you have to fill in at least three parameters of the function module: [text_removed]import parameter DOCUMENTHEADER of structure BAPIACHE09), account information for each item (table parameter ACCOUNTGL of structure BAPIACGL09), and currency amount information for each item (table parameter CURRENCYAMOUNT of structure BAPIACCR09).
This excerpt was taken from Sergey Korolev’s “Tips and Tricks for Using BAPIs in Accounting Documents” (SAP Professional Journal, Update 2, 2010).