FI--Note 306504 - Collective note: BAPIs for the AC interface

Symptom

Composite SAP note: BAPIs and IDocs for the AC interface

This note answers frequently asked questions regarding:

  • BAPI documentation
  • The business transaction concept
  • Enhancement of the interfaces (SAP and customer)
  • The importance of the parameter OBJ_TYPE (reference transaction)
  • Navigation between the documents (parameters OBJ_KEY and OBJ_SYS)
  • Summarization of documents in FI and CO
  • The parameter EXTENSION1
  • Testing the BAPIs and IDocs

 

Other terms

BAPIs:

  • BAPI_ACC_BILLING_POST/CHECK
  • BAPI_ACC_INVOICE_RECEIPT_POST/CHECK
  • BAPI_ACC_GOODS_MOVEMENT_POST/CHECK
  • BAPI_ACC_GL_POSTING_POST/CHECK
  • BAPI_ACC_EMPLOYEE_EXP_POST/CHECK
  • BAPI_ACC_EMPLOYEE_PAY_POST/CHECK
  • BAPI_ACC_EMPLOYEE_REC_POST/CHECK
  • BAPI_ACC_DOCUMENT_POST/CHECK

 

Solution

 

How do you find documentation?

Use Transaction BAPI. You can find the documentation in the hierarchy under Accounting - General => Accounting Interface. All of the business objects for the AC interface are located here.

The business transaction concept

Each of the above-mentioned BAPIs and/or message types reflects a specific business transaction. Technically, the same programs run for all message types. However, the business transaction controls the processing in the individual components in accounting. For this reason, the interfaces should not be used for external business transactions.
You can also use the BAPIs ACC_BILLING, ACC_INVOICE_RECEIPT and ACC_GOODS_MOVEMENT for customer, vendor, or G/L account postings.

Enhancement of the interfaces

The interfaces are enhanced for each release. For technical reasons, however, these enhancements cannot be transferred to earlier releases. From Release 4.5, you can use parameter EXTENSION1 to enhance the interface as required (see customer enhancement or long text for the parameter EXTENSION01).

Use of OBJ_TYPE (reference transaction)

Enter your own value in field OBJ_TYPE (reference transaction). You must maintain this value in table TTYP. You can specify a function module that is then called if the user wants to navigate back to the source or sender document from an accounting document. This means that
in the document navigation (audit), you can integrate documents that were posted via the BAPIs. The field TTYP-STRUC reflects the structure of the organizational units (for example, company code and fiscal year).
If you use SAP values in field OBJ_TYPE, this can result in unwanted effects, for example, errors may occur during the processing of taxes, during the navigation to the source document, or a document number, which is derived from the reference document number of the sender may be assigned (reference transaction BKPFF). In the test phase, you can use the IDoc reference transaction.
Define the FI and CO line item summarization separately for each reference transaction.

Segments for tax items

In the segments for the tax items, the wrong required entry fields were described in the documentation. The correct required entry fields are:

  • Item number (ITEMNO_ACC)
  • Tax code (TAX_CODE)
  • Condition type (COND_KEY)


If the tax jurisdiction code is active, you must also make entries in the TAXJURCODE and TAXJURCODE_DEEP fields.
See also Note 333424 for the tax items.

Source document or reference to sender document

Depending on which components are active, several documents are updated
(FI document, CO document, and so on), when a business transaction is updated in the accounting.
Except for in the BAPI document header, the component to be updated is specified (for example, Compo_ACC= FI) and then only this component is updated and no SL or CO documents are created. Therefore, the component is submitted with initial settings by default. For the business transactions that are posted with the BAPIs or IDocs stated above, there should be a source document with a unique document number outside of the accounting. This document number must also be assigned to the above IDocs, and as a reference number, must be updated in all accounting documents. It links the accounting documents with each other or the accounting documents with the source document. It consists of the following fields:

  • OBJ_KEY (AWKEY) reference key (document number of the source document)

           AWKEY comprises AWREF and AWORG. AWREF stands for the source document

           number and AWORG stands for related organizational units, such as company code and fiscal year (maintain the structure of AWORG in table TTYP for each reference transaction AWTYP in field STRUC).

  • OBJ_SYS (AWSYS) Logical system (logical system of source document)

You do not have to use the document number of the source document as a reference key. If there is no source document, you can also use another reference, as long as it is unique. However, for parallel processing for example, the same time stamp may occur in several documents. Such documents are then incorrectly linked to each other.

Navigation via the documents in the accounting

From the accounting view, the source document (Prima Nota) is not located in the accounting. Instead, it is located in an external system, and field AWSYS contains the ID for this external system. The FI document is not seen as a source document. For this reason, you cannot navigate to the source document. Error message RW 020 appears: 'Original document is not in the local system'. You can however navigate via the accounting documents if the reference key (AWKEY) is unique in the IDoc.

Transferring summarized data:

The BAPIs or Idocs were developed for transaction-related business processes, which means that you can post individual billing documents, goods movements, or invoice receipts to the accounting. You can also transfer summarized data. However, the billing business transaction expects a customer item and the invoice business transaction expects a a vendor item.

Customer enhancements:

As of Release 4.5, you can also transfer additional information to parameter EXTENSION1 during posting. The data must be read from parameter EXTENSION1 in an Exit and then transferred to the AC interface. For more information, see the long text for parameter EXTENSION1.

Testing the BAPIs and IDocs:

You cannot use the Function Builder (SE37) or the business object types (BOR) test tool to test the BAPIs since these tools do not set an SAP Commit after processing. Although the RETURN parameter reports that the document was posted successfully, no documents were updated in the accounting.
Use the test tools of the IDoc-processing (WE19) or a report in which you call the BAPI and set a COMMIT WORK afterwards to test the interfaces.
As of Release 4.6B, the following sample calls are available:

  • ACC_BAPI_TEST_BILLING
  • ACC_BAPI_TEST_GOODS_MOVEMENT
  • ACC_BAPI_TEST_INVOICE_RECEIPT


If you want to use the test environment of the Function Builder (SE37), proceed as follows:

  • Display the function module in SE37. (For example,
    BAPI_ACC_DOCUMENT_POST)
  • Go to 'Function Module -> Test -> Test Sequences'
  • In the dialog box that appears, enter the module that is to be tested (For example, BAPI_ACC_DOCUMENT_POST), and then module
    BAPI_TRANSACTION_COMMIT.
  • Confirm the dialog box


Only now do you receive the input parameter of the BAPI to be tested. After you have executed it, go back.
You get the input parameter of module BAPI_TRANSACTION_COMMIT. Execute this without changing the parameters.
By executing this module, the required COMMIT WORK is generated, which
posts documents which you have updated.

Quantity update to the accounting from the payroll (HR)

The AC interface uses the +/- sign of the amount to determine whether the line item is supposed to be posted to the debit or the credit of the specified account. If the quantity is to be updated in exactly the same way as the amount (with the same +/- sign), the AC interface expects the quantity without +/- signs.

Source link: https://websmp230.sap-ag.de/sap(bD16aCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0000306504&nlang=1

你可能感兴趣的:(Module,processing,interface,reference,extension,Components)