logo

Are you need IT Support Engineer? Free Consultant

Return Lot File Import via Third- Party Payments

  • By Sanjay
  • 18/09/2026
  • 10 Views



This blog post is a successive topic of the Payment Lot Data Import via Third-Party Payments for SAP S/4HANA Cloud Public Edition, introducing the process of importing the return files from the third party payment providers.

The Third-Party Payments framework in Contract Accounting can be used not only to import incoming payments, but also to import and process returned payments provided by banks, payment service providers, or other external partners. These files can be converted into the predefined file structure described below.

Instead of creating return postings manually in the Process Return Lots app, you prepare a semicolon-delimited text file containing the returned payments. The framework validates the file, resolves return reasons and posts defaults from customizing and creates ready-to-process return lots in Contract Accounting.

Follow the file structure format described below.

File specification

This section specifies the structure of the files. You have to follow the file structure, including the batch header (HDR), batch item(ITM) and configuration reference(CFG).

Batch Header (HDR)

Define the lot-level data. Each return batch header line is for a batch.

PositionField LabelMax Length Mandatory
1Record Type (always HDR)3Yes
2Component of Key8No
3Search Term40No
4Currency5Yes
5Posting Date10Yes
6Document Date10Yes
7Value Date10No
8Bank Country/Region Key3No
9Bank Number15No
10Bank Account Number18No
11Specified Debit Total18No
12Specified Credit Total (positive values only)18No
13Specified Number of Items6No

NoteThough positions 11-13 are optional, if any field of these is filled, the consistency check between the three fields needs to be conducted – header totals are compared against the actual sum of return amounts and item count of the batch. An error is raised and the batch is rejected if these values do not match. You can leave all three fields empty by using the value 0.00 for Debit and Credit Totals and 0 for Specified Number of Items to skip the consistency check.

Sample Value:

HDR;;Returns May with totals;EUR;15.05.2025;15.05.2025;15.05.2025;DE;10010010;1234567890;1650.50;0.00;2

Batch Item (ITM)

The batch item line represents one return within a batch. At least one return batch item is required for a batch.

PositionField Label Max Length Mandatory
1Record Type (always ITM)3Yes
2Selection Category1Yes
3Selection Short Value20Yes
4Return Amount16Yes
5Transaction Currency (falls back to HDR currency if blank)5No
6Return Reason of House Bank6Yes
7Note to Payee In Return80No
8Bank Country/Region Key3No
9Bank Number15No
10Bank Account Number18No
11IBAN34No
12SWIFT/BIC11No
13Profit Center10No
14Charge Amount from Bank 116No
15Tax Code for First Bank Charge2No
16Tax Amount of Bank Charge 116No
17Charge Amount from Bank 216No
18Tax Code for Second Bank Charge2No
19Tax Amount of Bank Charge 216No
20Return Charge 116No
21Tax Code for First Return Charge2No
22Tax Amount for Return Charge 116No
23Return Charge 216No
24Tax Code for Second Return Charge2No
25Tax Amount for Return Charge 216No

Note: Position 6 provides bank-specific return reason codes. You do not need to provide the SAP internal return reason because it is determined by the Assign Return Reasons to House Banks activity (ID: 101919).

Sample values:

ITM;G;1004567892;-100.00;EUR;AMBA;Note To Payee;DE;10010010;1234567890;DE89370400440532013000;COBADEFFXXX;PC1000;50.00;R1;0.50;25.00;R2;4.75

 Selection Categories

In the position 2 of the ITM structure holds a Selection Category code that identifies how the associated Selection Short Value (position 3) should be interpreted.

CodeDescription
BDocument
GBusiness Partner
VContract
ZPayment Order

Example:

ITM;G;100001;500.00;EUR;ACBL;Account closed ← Select by Business Partner
ITM;B;9000000001;750.25;EUR;AMBA;Insufficient funds ← Select by Document
ITM;Z;PO-00042;1200.00;EUR;AMBA;Bounced payment order ← Select by Payment Order

Configuration Reference (CFG)

This line identifies the payment recipient in the external system and is used for looking up the default posting parameter from the configuration. One configuration reference line is for a batch.

PositionField LabelMax LengthMandatory
1Record Type (always CFG)3Yes
2Payment Recipient Identifier30Yes
3Additional Identification10No

Note: Position 2 and 3 are used to retrieve the posting default parameters from the Define return Lot Specification activity (ID: 107256). For more information about this configuration, see the Prerequisite chapter.

Sample value:

CFG;RECIPIENT001;SUBKEY01

Summary of File Structure

A file contains 1 to N return batches. Multiple batches are linked to the same file.

2026-09-16_16-32-39.Png

A complete file example-

As follows is a file with three return batches:

  • The first one is without totals and with charges
  • The second one is with header totals validation
  • The third one is minimal

Sample code:
← Batch 1: 3 items, no header totals, last item has bank details + charges
← Batch 2: 2 items, header totals validation active HDR-level bank details
← Batch 3: 1 item, minimal

HDR;;Returns April;EUR;10.05.2025;10.05.2025;;;
ITM;G;1234567890;500.00;EUR;ACBL;Account closed – direct debit returned;;;;
ITM;B;1234567891;750.25;EUR;AMBA;Insufficient funds on account;;;;
ITM;G;1004567892;-100.00;EUR;AMBA;Credit note reversed;;;
DE;10010010;1234567890;DE89370400440532013000;COBADEFFXXX;PC1000;50.00;R1;0.50;25.00;R2;4.75
CFG;RECIPIENT001;SUBKEY01

HDR;;Returns May with totals;EUR;15.05.2025;15.05.2025;15.05.2025;
DE;10010010;1234567890;1650.50;0.00;2
ITM;B;9876543210;1200.00;EUR;AMBA;Account closed;
ITM;B;1234567891;450.50;EUR;AMBA;Insufficient funds;
CFG;RECIPIENT001;

HDR;;Returns June;EUR;20.06.2025;20.06.2025;;;
ITM;G;100005;1200.00;EUR;AMBA;Account closed;
DE;10010010;1234567890;DE89370400440532013000;COBADEFFXXX;PC1000;
CFG;RECIPIENT001;SUBKEY01

Prerequisite

Define Return Lot Specifications

Open the Define Return Lot Specification activity (ID: 107256).

  1. Select the Return Lot Data (Contract Accounting) (FICA-RETURN-LOT) as the format type.
    1.Png
  2. Create a new entry.
  3. Prepare configuration for Return lot processing and assign it to the ID in the external system. You can assign the attributes optionally to additional IDs. Both values are imported in “CGF” segment for the file. For more information, see the file specification configuration.
  4. Optionally, you can enter the house bank and account ID.
    2.Png

Configure Return Reasons

Open the Configure Return Reasons (ID: 102269) activity to create your own return reason. Choose the Bank Return as the return type.
3.Png

Assign Return Reasons to House Banks

Open the Assign Return Reasons to House Banks activity (ID: 101919). Map each House Bank Return Reason code (provided in the file) to the corresponding SAP Internal Return Reason. This lookup happens automatically during processing

See the examples as follows:
5.Png

Implementation

Business scenario

6.Png

  1. (Optional: if the custom logic is needed) Before importing any file, the relevant Cloud BAdI extension point is implemented and published via the Custom Logic app using the BADI_FKKIS_EXPC_RETURN_LOT for return lot import. This is where the logic changing the mapped data according to business needs is defined.
    Note: The BAdI is expected to be available in the upcoming releases. 
  2. You have received the external files from the third-party payment provider.
  3. Open the Manage Incoming Payment File app (F1680) to upload the external files.
    Select Import and Third-Party Payment.7.Png
    Select the Return Lot Data (Contract Accounting) as the format and upload your return file.
  4. Open the Process Imported Third-Party Payments app to schedule a return lot. Select Create.
    Select the following options:

    • Job Template: Third-Party Payment: Transfer data
    • Format Type: Return Lot Data (Contract Accounting) – FICA-RETURN-LOT8.Png
      Schedule a run and you can see the return log key number is created in the log.
  5.  You can use the Monitor Third-Party Payment app to view the imported files or processed files.
    Use the filter to find the files. You can use the View Logs to see the status of the application log or the error messages.
    9.Png

Is this blog post helpful to you? Leave your messages to let us know your thoughts.





Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with us on WhatsApp!