SAPTechno

SAP Function BAPI_ACC_DOCUMENT_POST - Accounting: Posting

IMPORT
Parameter Reference Type Length Default Optional Text
CONTRACTHEADER BAPIACCAHD u 86 X Additional Contract Accounts Recievable and Payable Header Line
CUSTOMERCPD BAPIACPA09 u 383 X One-time customer
DOCUMENTHEADER BAPIACHE09 u 251 Header

EXPORT
Parameter Reference Type Length Text
OBJ_KEY BAPIACHE09-OBJ_KEY C 20 Reference key
OBJ_SYS BAPIACHE09-OBJ_SYS C 10 Logical system of source document
OBJ_TYPE BAPIACHE09-OBJ_TYPE C 5 Reference procedure

TABLES
Parameter Reference Length Optional Text
ACCOUNTGL BAPIACGL09 918 X G/L account item
ACCOUNTPAYABLE BAPIACAP09 436 X Vendor Item
ACCOUNTRECEIVABLE BAPIACAR09 547 X Customer Item
ACCOUNTTAX BAPIACTX09 79 X Tax item
ACCOUNTWT BAPIACWT09 160 X Withholding tax information for FI Interface
CONTRACTITEM BAPIACCAIT 266 X Additional Contract Accounts Recieviable and Payable Document Line Item
CRITERIA BAPIACKEC9 58 X CO-PA Account Assignment Characteristics
CURRENCYAMOUNT BAPIACCR09 90 Currency Items
EXTENSION1 BAPIACEXTC 1000 X Container for 'Customer Exit' Parameter
EXTENSION2 BAPIPAREX 990 X Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
PAYMENTCARD BAPIACPC09 212 X Payment Card Information
REALESTATE BAPIACRE09 91 X Real Estate Account Assignment Data
RETURN BAPIRET2 548 Return parameter
VALUEFIELD BAPIACKEV9 76 X CO-PA Account Assignment Value Fields

DOCUMENTATION

Functionality
Using this method you can create a posing in accounting for certain
business transactions.
Possible (Business Transactions):

  • Postings that generally only affect the general ledger. (RFBU)

  • Billing: For billing in Sales and Distribution, accounting is supplied

  • with the relevant billing data. (SD00)
    Billing Document
    • Accounting can use the data of a logistics system that result from an

    • Invoice Receipt. (RMRP)
      • Goods Movement are triggered by transactions

      • in Sales and Distribution or by inventory postings. Within logistics,
        they lead to a change in the warehouse stocks of Management>Inventory Management. This results in a posting in
        accounting. This is why accounting is supplied with the relevant data
        from logistics. (RMWA)

        Example

        • Billing document:

        • By selling goods in accordance with targets, revenue is generated. The
          revenue is posted in billing and forwarded to accounting.
          • Invoice receipt:

          • Raw materials are purchased in accordance with targets. The invoice
            receipt is posted in a logistics system. The data from the raw
            materials is forwarded to accounting.
            • Goods Movment:

            • The use of raw materials leads to a change in stock in inventory
              managment. The posting of raw material consumption is forwarded to
              accounting.
              • G/L Account Posting:

              • Provision posting for an expected warranty service. This can refer to
                acquisitions or retirements belonging to stocks that are not in
                subledger accounting relevant to inventory management. This is
                particularly the case if such materials are not displayed as
                vendor/customer, materials, loans etc. or cannot be displayed in this
                way. This can also refer to write-ups or depreciation that contain
                higher aggregations of values than are maintained in a corresponding
                subledger that is relevant to inventory management.
                The conversion of foreign currencies for receivables/payables due to
                large exchange rate changes that should not lead to an update of the
                accounts payable or accounts receivable accounting. A similar
                transaction can arise for the revaluation of raw materials if this
                revaluation takes place at a correspondingly aggreagated level.
                Reclassification of inventory of P&L statement accounts that are only
                used for reconcilliation purposes in the general ledger (this
                rearranges values for balance sheet items).
                Balance reclassifications of stocks to receivables with different
                return times.

                Notes

                • If the parameter CurrencyAmount is filled with the currency fields, a

                • complete document check including characteristics and value components
                  of profitability analysis (CO-PA). Otherwise, the account assignment
                  objects are checked.
                  • Messages are returned in the parameter Return. In the parameter

                  • documentation you can find the return values and their meaning.

                    Further information
                    You can find further information in the SAP Library under "Financials
                    -> Accounting - General (AC) -> Interfaces to Accounting (AC)".

                    Parameters
                    OBJ_KEY

                    OBJ_SYS

                    OBJ_TYPE

                    CONTRACTHEADER
                    In this parameter fields are transferred that only affect the contract
                    accounts receivable (FI-CA).
                    By filling this field, the sender controls the FI-CA open item
                    accounting instead of accounts receivable accounting.

                    CUSTOMERCPD

                    DOCUMENTHEADER
                    Parameters for the transfer of document header data.
                    The following fields must be filled:

                    • OBJ_TYPE Sender identification

                    • OBJ_KEY Reference number of source document

                    • OBJ_SYS Logical system of source document

                    • COMP_CODE Company code

                    • PSTNG_DATE Posting date

                    • BUS_ACT,,,,Business transaction

                    • USERNAME Document creator

                    • Default
                      The field COMPO_ACC must remain empty for a general
                      posting. If an SAP component is transferred in this field, a posting
                      will only be made in this component. This function is only used for
                      posting subsequently.
                      INCLUDE ACC_AWTYP_AWKEY_AWSYS OBJECT DOKU ID TX



                      ACCOUNTGL

                      ACCOUNTPAYABLE

                      ACCOUNTRECEIVABLE

                      ACCOUNTTAX
                      Parameters for the transfer or tax lines.
                      The following fields must be filled:

                      • ITEMNO_ACC,,,,Item number

                      • TAX_CODE,,,,Tax code

                      • COND_KEY,,,,Condition type

                      • If the Jusistiction Code is active, these fields must also be filled.
                        The currency fields are not contained in this parameter. They must be
                        transferred in the parameter Currency Amount for the different currency
                        types or currencies. A connection is created to the corresponding
                        document line item via the item number ITEMNO_ACC which must be unique
                        for all line items.

                        CONTRACTITEM
                        In this parameter fields are transferred that are concerned with an
                        accounting document not including the contract accounts receivable and
                        payable (FI-CA) at the item level.
                        Link to debitor line:
                        The item is also transferred to the debitor line (ACCOUNTRECEIVABLE)
                        and must therefore contain the same item number (ITEMNO_ACC).

                        CRITERIA

                        CURRENCYAMOUNT

                        EXTENSION1
                        This exit can be used to edit the accounting document before it is
                        transferred to the accounting components for the update.
                        For this, BTE technology (Business Transaction
                        Events) is used.

                        EXTENSION2
                        This enhancement structure can be used to transfer additional fields.
                        There are four fields available for each data record (VALUEPART1 - 4),
                        which each contain 240 characters. A defined ABAP dictionary structure
                        can be transferred in the field STRUCTURE, on the basis of which the
                        field contents are read.
                        The accounting document can be supplemented and changed in an
                        implemented BAdI (ACC_DOCUMENT) before the
                        active accounting component is called.

                        Default
                        The class CL_EXM_IM_ACC_DOCUMENT is available as example
                        implementation. Here, for each data record of the parameter that is
                        transferred the ABAP dictionary structure is checked and the content of
                        the fields VALUEPART1 to -4 is set in the structure. If the structure
                        that is transferred contains a field POSNR, the associated lines of the
                        accounting document are updated using the contents of the enhancement.

                        PAYMENTCARD
                        In this parameter data for credit card payment can be transferred.
                        Link to debitor line:
                        The item is also transferred to the debitor line (ACCOUNTRECEIVABLE)
                        and must therefore contain the same item number (ITEMNO_ACC).

                        REALESTATE
                        This parameter can be used to transfer account assignments for Real
                        Estate Management.
                        The current line represents an addition to the accounting document line
                        items (ACCOUNTGL, ACCOUNTRECEIVABLE, ACCOUNTPAYABLE). The line in
                        parameter REALESTATE must be connected to the document line item
                        (ITEMNO_ACC) using the line number.

                        RETURN

                        VALUEFIELD

RELATED NOTES
1622448Error FAGL_POST_SERVICE 014 when parking w/ acctg interface
1241247BAPI does not update External Tax System
1539041BAPI_ACC_DOCUMENT_POST: Incorrect line item schema
1578618Error F5 800 for postings using BAPI
1546106No distribution of postings split in FI using ALE
1533673BAPI_ACC_DOCUMENT_POST with asset lines: Error AA486
1538291BAPI_ACC_DOCUMENT_POST: Incorrect assignment of tax data
643232General BAPIs do not generate asset line items
1521108Posting split with Note 1353125 not for net document types
1024468Error log in accounting IDOCS

Based on SAP ECC6.