Introduction
Please note that the feature of this blog post is only for SAP S/4HANA Cloud Public Edition.
When importing third-party payment files or return files via the Manage Incoming Payment Files app (F1680) the system parses the file and maps the raw data to internal structures using the Map Format data app. However, the default mapping may not always fit your specific business requirements.
Two Business Add-In (BAdI) extension points are delivered to adjust the mapped data at batch header and item level. Before the mapped data is written to the staging tables — you can change these values according to the business requirements.
The adjusted staging data is then consumed in the second step by the Process Imported Third-Party Payments app, which creates the actual Contract Accounting payment lots and return lots. Any changes you have made in the BAdI are therefore reflected in the final posted lot. This blog post introduces the procedure of importing and processing the external files. You can also learn about how to adjust the mapped data using the BadIs. For more information about the related blog posts, see the following links:
- Payment Lot Data Import via Third-Party Payments – SAP Community
- Return Lot File Import via Third- Party Payments – SAP Community
Where the Extension Point Runs
The diagram below shows the flow after you get the external files to the posting lots in Contract Accounting:
- The external file is first uploaded via the Manage Incoming Payment Files app, where the Map Format Data for Third Party Payments app transform the bank/collector-specific (external) format into internal structures.
- After this mapping, the corresponding Badi is triggered, when you can adjust the data, before the data is written to the staging tables.
- Then you use the Process Imported Third-Party Payments app to pick up the staging data and create the final Payment Lot or Return Lot.
Business Add-Ins
- BAdI for Payment Lot Import — BADI_FKKID_EXPC_PAYMENT_LOT
This BAdI is called during the import of third-party payment files in Contract Accounting. It allows you to modify the mapped payment data before it is stored in the staging area; the adjusted data is subsequently used to create a Payment (Order) Lot in Contract Accounting. - BAdI for Return Lot Import — BADI_FKKID_EXPC_RETURN_LOT
This BAdI is called during the import of third-party return files in Contract Accounting. It allows you to modify the mapped return data before it is stored in the staging area; the adjusted data is subsequently used to create a Return Lot in Contract Accounting.
Note:
The BAdI is called once per imported batch. It receives the complete lot header and the full table of items for that batch as changing parameters. This means you can modify any field on any existing item, but you cannot add or remove items and item numbers cannot be changed.
Implementation: Custom Logic App
As a key user, you can use the cloud business add-in (BAdI) to implement your own logic. Before using the cloud BAdI, ensure that you have assigned the business role SAP_BR_EXTENSIBILITY_SPEC.
Note: Regarding of extensibility options for developers, go to Business Accelerator Hub and search for Adjust Payment Data (for Customer).
- Open Custom Logic app. Select “Create”.
- In the search box, search for the BAdI name:
- For Payment Lot: BADI_FKKID_EXPC_PAYMENT_LOT
- For Return Lot: BADI_FKKID_EXPC_RETURN_LOT and search.
- The extension point appears in the list with its description. Select it using the radio button, then click Step 2.
- Click Add to add a filter row. Select “Add” in the pop-up window to apply filter condition.
- Set the connector THIRDPARTYPAYMENTFORMATTYPE equal to your format type value:
- For Payment Lot: THIRDPARTYPAYMENTFORMATTYPE = FICA-PAYMENT-LOT
- For Return Lot: THIRDPARTYPAYMENTFORMATTYPE = FICA-RETURN-LOT. Save the entries.
- After you save the condition, the filter with the format is visible. This ensures the BAdI is only triggered for files of the matching format type. Click Step3.
- Provide a meaningful description and a unique implementation ID (Create an implementation ID starting with YY1_):
- Click Review and Create.
- Select Publish. You can then Open Code Editor.
- You can select Show Sample Code and copy them to clipboard to better change the coding based on your business needs.
- Click Edit and write your implement the logic based on your business requirements, then select Save and Publish.
The implementation takes effect immediately on the next file import. It is not required to restart the system or transport.
Monitoring the Changes with Cloud BadIs
Upload the files after the Cloud BAdI Implementation
- Open the Manage Incoming Payment Files (F1680) app.
- Select Import and choose Third-party Payment to upload the files
- Select Payment Lot Data (Contract Accounting) as format.
- Upload the file and process.
- Open the Manage Incoming Payment Files (F1680) app.
View the changes in the Monitor Third-Party Payment app
- Open the Monitor Third-Party Payment app.
- Select row with imported file and here are results that are marked in yellow.
Is this blog post useful to you? Leave your comments below to let us know your thoughts.
Source link
