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. 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. 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: 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. 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. 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:
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. Note: remember to activate your code! 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. Click on “Display.” 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. 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. 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.What Is SAP Payroll?
Standard Configuration
Issues with the Standard
Issue 1 Fix: Cross-Company OBYA Through a Customization Via BAdI Enhancement
Issue 2 Fix: Profit Center Issue Through a Customization Via BAdI Enhancement
GET_SUBSTITUTION Method Code
Conclusion