How to Post from SAP Payroll to Multiple General Ledgers

14 hours ago 2

Posting transactions from SAP Payroll to more than one general ledger can be quite complex.

While SAP provides standard functionality to post general ledger transactions via Application Link Enabling (ALE) and Intermediate Document (IDoc) messages, this approach assumes that the payroll system interfaces with only one finance system.

This blog post explores a methodology to overcome this limitation and successfully post to multiple SAP finance systems, whether in SAP ERP or SAP S/4HANA Finance.

What Is SAP Payroll?

SAP Payroll is a robust module designed to handle a variety of payroll processing tasks, including the generation of general ledger postings. Generally, these postings are directed to a single ledger SAP finance system using the message type ACC_EMPLOYEE_EXP and IDoc type ACC_EMPLOYEE_EXP02. To post general ledger transactions to multiple finance systems, additional enhancements and configurations are required.

Standard Configuration

Before delving into the customization needed to enable multi-system postings, it is crucial to ensure that all standard configurations in SAP Payroll are correctly set up.

The primary configurations include the following:

  • Mapping wage types to symbolic accounts: This involves assigning each wage type to a specific symbolic account, which serves as an intermediary between wage types and general ledger accounts.
  • Mapping symbolic accounts to general ledger accounts
  • Setting up ALE filters: ALE filters must be established as you would typically configure for a single Finance system. These filters determine what data is exchanged between the SAP systems. The most common object in this scenario that is used for filtering is the company code.

By default, SAP sends all expenses to the same cost center and company code available in the organizational data (infotype 0001) for the employee. The expense can be sent to a different finance system based on the company code by using a cost override infotype (0027). This is standard functionality.

The system then uses the ALE filter to determine which system to post the expenses based on the company code.

Issues with the Standard

The standard configuration has two main issues: it takes the cross-company configuration (OBYA) from the target system, and uses the expense company code and cost center to determine the liability profit center.

The first issue is a problem because company codes are mutually exclusive between systems, and determining the cross-company account needs to be done in a system that has both company codes—this is generally the payroll system and not the target system.

The second issue causes a problem with the liability profit center because it is posted in a system that does not have the expense company code.

Issue 1 Fix: Cross-Company OBYA Through a Customization Via BAdI Enhancement

To enable general ledger postings to multiple SAP finance systems, a business add-in (BAdI) enhancement is necessary:

Class : CL_HRPP_WS_SERVICE_MANAGER

   Method: HRPP_FI_ACCT_DET_CROSS_COMP

In the post exit, the method return tab is cleared and FM FI_ACCT_DET_CROSS_COMPANY is called again without the receiver system; here, validation and data fetching is done in the default system by following these steps:

  1. Use transaction code SE24 to find the method.
  2. Click the “Enhance” button in toolbar.

Enhance button

  1. Fill in the first two fields of the popup.

Fields to fill in

  1. Enter the package name and save.

Package name

  1. Click on the method name and choose “insert post method.”

Insert post method

  1. Click the post exit button on the bottom right of the page. This will take you to the code page. 

ABAP editor

  1. Insert your code.

Insert code

The “clear return tab” shown in the figure above clears the error from the standard execution. Then it executes some post-exit code and function module FI_ACCT_DET_CROSS_COMPANY in the default system, because the destination field is not set in this code.

The standard method would have called the function as below, with the remote destination.

Function call

Note: remember to activate your code!

Issue 2 Fix: Profit Center Issue Through a Customization Via BAdI Enhancement

To derive the correct profit center, BAdI enhancement is once again necessary. The specific enhancement involves using BADI_HRPP_ACCOUNT_ASSIGNMENT and the associated method GET_SUBSTITUTION.

Follow these steps to implement the fix.

  1. Use transaction code SE18. Identify the enhancement spot (HRPP).

    T-Code SE18

Click on “Display.”

  1. Select the relevant BAdI: BADI_HRPP_ACCOUNT_ASSIGNMENT.
  2. Right click and select “Create BAdI Implementation.”

Create BAdI implementation

  1. Fill in the name of the implementation.

    Name

Description

  1. Go to the Enhancement Implementation tab and double click on the implementation that was created.

Enhancement implementation

  1. Select and activate the BAdi.

Activate the BAdI

  1. Double click on “Implementing Class.”

Implement class

  1. Double click on IF_HRPP_DETERMINE_SUBSTITUTION~GET_SUBSTITUTION and then click on the display/change button circled in the following figure.

Display/change button

  1. Replace the code block with the code needed to facilitate this substitution. More details on this code are in the next section. Save and activate. The BAdI is now implemented.

Replace the code block

GET_SUBSTITUTION Method Code

The GET_SUBSTITUTION method involves customizing the general ledger posting logic based on specific criteria such as company code and country. Below is a detailed description of the steps involved in this method.

  • Overwrite Expense Company Code: If the company code of the export structure is not equal to the expense company code, overwrite the expense company code with the actual company code from the export structure (infotype 0001).
  • Overwrite Cost Center: Similarly, overwrite the cost center of the line item with the cost center from the export line item (infotype 0001).

The following code can be used to do this:

METHOD if_hrpp_determine_substitution~get_substitution

   DATA : 1v_cntry TYPE 1and1.

   CONSTANTS : 1c_1and1_us TYPE 1and1 VALUE ‘US’,

                             1c_1and1_ca TYPE 1and1 VALUE ‘CA’.

   SELECT SINGLE 1and1 FROM t001 INTO 1v_cntry WHERE bukrs = item-bukrs.

   IF sy-subrc = 0 AND ( 1v_cntry = 1c_1and1_ca OR 1v_cntry = 1c_1and1_us ).

       CLEAR item_part-gsber.

       IF lv_cntry EQ lc_1and1_us.

           IF item_part-bukrs NE item_part-expense_bukrs.

               item_part-expense_bukrs = item_part-bukrs.

               item_part-kost1 = item-ackst.

           ENDIF.

       ENDIF.

Conclusion

Posting general ledger transactions from SAP Payroll to multiple finance systems requires both standard configuration and custom enhancements. By implementing a BAdI enhancement as illustrated in this post, organizations can overcome the default limitation of interfacing with a single ledger finance system.

This approach ensures that payroll data is accurately and efficiently posted to the respective general ledger systems, maintaining financial integrity and compliance. This also relieves manual tasks for journalling and reconciling ledgers between two finance systems when the expense account for payroll is in multiple systems.

By following the steps outlined in this post, SAP users can achieve a seamless multi-system general ledger posting process, enhancing the overall flexibility and functionality of their financial operations.

Read Entire Article