BAPI configuration for posting

We have identified a list of BAPI processes that we have heard that our customers use. Most of these are working well with our integration with a few exceptions which we have addressed for customers based on their work with our Professional Services team. Some however require additional adjustments for them to work well with our Integration logic.
The use of BAPI_ACC_DOCUMENT_POST requires some additional adjustments to provide a complete calculation and post process. Support for this BAPI can be quite convoluted and complex given the many additional checks it makes and the different scenarios that customer wish to apply to the system with their use in various applications. Our Professional Services team has provided support for this BAPI in the past with additional includes and enhancements within the BAPI itself for the call that is standard within this BAPI as a pricing call. We have elected to provide a new option that involves the use of a separate utility to do the tax call and calculation/population ot the tax data for the posting of the document. This utility could be applied to a batch job process as a separate first step which then initiates the BAPI within the utility, however, for some needs this will not be possible and an enhancement include statement is needed within the BAPI to call this new utility early before the rest of the BAPI processes. This insert at the beginning of the BAPI is separate from the pricing call that is made later in the program. The later pricing call and audit call can then be separately controlled as we will speak to shortly with the use of two configuration tables. This is an optional process as it is not required that you use these two configuration tables or the call utility, if you already have a solution in place from Professional Services.
Along with the need to make a separate tax call (use of the utility), there are times when a user may wish to avoid the need for the internal pricing call when the tax is already present within the data file being used with the BAPI (Possibly for vendor charged tax invoices). Other times the user may wish to post the item to the ledger however because of upstream processes, may want to avoid any additional posting to the Audit database in Determination (example of Ariba OK-2-Pay files where the audit call was already applied prior within the Ariba Integration). We have addressed this need with two additional tables for configuration that can be used to control these two Integration processing steps. This will give the customer maximum flexibility for such scenarios as Ariba system postings, transfer of data to a S4/HANA Central Finance environment, and other special cases such as payment card systems, batch entry of invoices, month end G/L entries, etc.

BAPI Configuration Table

Transaction Code:
/IDT/BAPI_CONFIG
This table is used with only the BAPI_ACC_DOCUMENT_POST at this time:
The purpose of this table is to identify any given batch job that is used to post documents to the G/L using BAPI_ACC_DOCUMENT_POST. Depending on the given scenario and purpose of this batch job, the user may need for this batch posting to the G/L to happen without a pricing procedure tax call being performed within the BAPI or (not the same as the utility included at the beginning of the BAPI) , perhaps without a subsequent posting to the Determination Audit database being generated. This may be needed for some scenarios such as Ariba postings that have already calculated tax and performed Audit updates via upstream processes prior to the G/L post. The table controls the pricing call and audit call based on the two columns of this table
Stop TaxCal
, and
StopAudUpd
. Use the drop down on these two columns to stop the tax call within the BAPI, or the audit update. Leave the field blank if you wish to have the process complete the call or audit update.
Sender ID
is a unique identifier that we are using to give a name or label to the specific job function that you are performing with the background batch job process. For example, the Sender ID may be something like: Ariba, OK2pay, AP invoice, P-Card, Transfer, Billing transfer, FI post, etc. Each scenario of batch processing should have its own Sender ID name so that the Tax Call and audit options can be applied to it based on a matchup of the Sender Id, Document type, and Company Code per this table configuration.
The
BAPI Sender Table
is used in tandem with the configuration table to label your specific batch background job with the desired Sender ID name based on several key fields within the batch job program. Use of this table is discussed further in the next section.
Use of the Asterisk
(*). An asterisk can be used as a wild card in the company code field or the document type field so that you can specify all company codes or all document types as applicable in the line. Do Not use * in the Sender Id column or Sort Order column. The Active box is used with this table so that you can turn on or activate this line on the table or opt to turn it off but keep the line for later use.
Use of Sort Order
. The use of the sort order column follows the same logic as the use in other tables such as Field Mapping. When there is a higher sort order number the program will look to see if the selection criteria meets the criteria of the higher sort order, and if so will perform the highest line level that applies. In the example screen above, the first line is a larger set of the second line (sub-set), so for company code 1000 and doc type KR, the second option will be used. All others that match the first line but not the second, will follow the shut off logic listed in the first line.

BAPI Sender Table

Transaction Code:
/IDT_SENDER
In this table you are telling the system the specific traits of a specific batch job process will be used in combination to identify a sender ID for the BAPI Configuration table. The Logical System, Program Name, and the User ID columns are used to identify this batch process as the selected Sender ID. The first three columns in combination cannot be the same as another line on the table as they are key fields to the table.
If this is a batch job that is being scheduled for EDI/IDOC and run in background, you should populate the first three columns for each of your batch processes that use these two BAPI for G/L posting. The program name, the logical system it is coming from as the source system, and the User ID that is used for this batch process should be identified, however a blank or asterisk “*” will also work. If you have several such jobs and need for them to be treated differently on the BAPI configuration table (on and off switches), then you will need to either copy and create a new program name or create and assign a different User ID to the job so that a different Sender ID can be used and drive the BAPI Configuration to a different line and outcome. If the Job is IDOC or EDI then the logical system would be populated. If it is not IDOC or EDI, then the logical system column would not be used and is left blank.
If this is a manually entered job that is not run as a scheduled batch job, then the input is a bit different. The logical system name would not be entered and would not be input in the BAPI field OBJ_SYS as there is no way to confirm this against the logical system field in the Sender Table. In this case the user should leave the logical system field blank and input the user ID that was used and entered in the BAPI for field USERNAME. BAPI header fields would not be populated for the first four and only populate the USERNAME at the start of the header for a manually entered job.

New Tax Calculation Utility for BAPI

For some application needs, the user may require the document that is to be posted to make a tax call and calculate the taxes prior to the BAPI posting the document. Our Professional services team has been able to assist many customers with this process with the addition of several program modification and user exits within the BAPI itself. In our attempt to productize this need we have elected to make this process a separate utility that can be run either prior to the BAPI being called or with an include statement within the BAPI so it can be utilized, and tax calculated within the BAPI. Using a separate utility along with the use of the new configuration tables we hope will provide a flexible model that can adapt for many separate uses for a variety of needs.
The new utility is
/IDT/TAX_CALC_UTILITY_BAPI
This table gives you a visual guide to what we have described above.

New Optional Include Statement for BAPI

There is an optional user exit/ include statement that can be placed at the beginning of the BAPI program is the situation calls for the tax calculation utility to be called within the Post BAPI rather than a run of the utility prior to the BAPI being called. This is also outlined in the Installation and Programmers Guide as part of the install of the product. A copy of that include is also shown below:
An Include is also required in the BAPI within this function to avoid an error with the assigned account key for the line-item. See Installation and Programmers Guide for further instructions.

List of BAPI Supported

The list of the various BAPI that we are testing and supporting through the product is now a section within the Installation and Programmers Guide.