Product Information
Instant Payments in Brazil (PIX) in SAP S/4HANA Cloud
Instant payments represent a new arrangement within the Brazilian financial system that allows 24/7 transactions in real-time between different institutions without the need for intermediaries such as card schemes, acquirers, or issuers. This blog post helps you understand the individual functionalities and solutions regarding Brazilian Instant Payments in SAP S/4 HANA Cloud.
This blog is divided into 2 parts:
Accounts Payable
After you purchased any goods or services, the supplier sends you the invoice that contains a QR code information with the PIX link and the transaction ID which you need during the payment process.
The following process explains to you the steps of configuring the system and the PIX data transfer from the master data through document posting and payment run to the payment media. When you create the payment media, the system fills out segments J and J52 PIX or segments A and B with the PIX key in the payment file, depending on how you enter the PIX keys for document posting.
Bank Master Data
Create a technical bank in the Manage Banks app. To maintain multiple aliases, each entry needs the complete key filled out in database tables Customer Master (Bank Details) (KNBK table) and Vendor Master (Bank Details) (LFBK table).
- Enter the bank country/region, which is the same as the payment system country.
- Choose a bank key, the bank number, and a bank name.
- Choose Payment System as the bank category.
Define Alias Types
Examples of regular expression used for validation:
- Email with limited length to 77: ^(?=.{6,77}$)\w+(\.\w+)*@(\w+\.)+(\w{2,4})
- Any string of length 32 characters: ^[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}
- Phone: ([0,+]{0,1}\s*[0-9]{2,3})?\s*\(?[0-9]{2}\)?\s*[0-9]{4,5}[- ]*[0-9]{4}
Define Payment System
- Define payment system
- Define country in which the payment system is valid
- Assign Alias types to payment system
Business Partner Master Data
Define the alias type and the payment system in the business partner master data in the Manage Business Partner Master Data app.
You can also assign the alias type, payment system, and the alias itself to the business partner in the Maintain Business Partner app.
Posting Supplier Invoice
There are two types of payment that can be performed via posting of supplier invoices:
1. PIX Transfer (PIX key defined by Partner Bank Type)
2. QR code information received via incoming invoice
When the company receives the PIX invoice with QR code, the payment is done via CNAB 240 with segments J and J52PIX. The information from the QR Code must be stored in the Supplier Invoice and then read during payment media creation.
To enter QR Code information, select the button Pix Info.
In the pop-up window, you can enter either:
- the URL Link (Dynamic QR) – 77-character long string
- or the Transaction ID (Static QR) – up to 35-character long string, and select PIX key via Partner Bank Type Field
Adding QR Code to an Existing Invoice
Payment Method for Outgoing Payments
The payment method for outgoing payments must have the following parameters:
Payment method for | Outgoing Payments |
Payment method classification | Bank transfer |
Required master record specifications | Bank details (Alias Required) |
Payment medium | Format: BR_FEBRABAN_A |
Format Supplement: PIX |
CNAB240 Return File Processing
After the bank executes the payment according to the information in the payment file, it sends back a return file. The return file contains payment confirmation or rejection data. To clear the relevant data, you need to import the received return file into your system.
Confirmation Return File
When the system processes the Confirmation Return File, it clears the Bill of Exchange Payment Request and the invoice.
Rejection Return File
Rejection Return File contains up to five rejection error codes that explain the reason of the rejection. To upload the file, open the Manage Incoming Payment Files app and choose Import. In the File Type field, choose Bank Statement, and in the Format field, select the CNAB240 Payment Format (BRAZIL). Upload the file you received from the bank and choose Process.
Accounts Receivable
When you sell any goods or services, you execute a payment run and send the payment data in a payment file (in format CNAB750) to the bank or payment system to request a dynamic or use a static QR code. The payment system generates a QR code and sends the data back to you. You print the invoice containing the QR code and send it to your customer.
Unique transaction IDs are generated automatically containing the company code, document number, and year. The transaction ID is inserted in the incoming payment file (BR_FEBRABAN_750) that you send to the bank. The transaction ID is mandatory in the case of dynamic QR codes. As soon as the payment is completed, you receive the payment status information from the bank.
The following process explains how to configure the system.
House Bank Master Data
Assign ISPB Code for House Bank
Assign the relevant ISPB code to Company Code and House Bank in the view Assign ISPB Codes to Bank Codes configuration activity in settings for Payment Formats.
Correspondence Setup
To display or print the received QR code in the invoice, you must first set up correspondence by assigning a correspondence program and variant to your company code.
- Add Correspondence SAPBR in the configuration activity Define Variants for Correspondence Types.
- Add Identifier SAPBR in the configuration activity Assign Labels and Company Codes to Correspondence Type Variants
- Assign form template FIN_FO_CORR_INTDOC_PIX_BR to application object FFO_CORR_INTDOC in the Assign Form Templates configuration activity.
- Maintain Form Derivation Rule ID FORM_MASTER_BR_PIX in configuration activity Define Rules for Determination of Master Form Template
QR Code Form Output
In Display Correspondence History app, you can display the PDF Form with QR Code.
Posting Customer Invoice
No special handling is needed. When you post customer invoices, use the payment method you created with the payment medium format BR_FEBRABAN_750.
Payment Method for Incoming Payments
The payment method for incoming payment must have the following parameters:
Payment method for | Incoming Payments |
Payment method classification | Bill/exch.pyt.req |
Posting details | Value ‘R’ in the Sp. G/L Ind. B/Ex. B/Ex.Pmt.Req field |
Payment medium | Format: BR_FEBRABAN_750 |
You can do the changes to the payment method in the configuration activity Set Up Payment Methods for Each Country/Reg.
Payment Media Creation for DMEE Payment Format CNAB750
Execute the payment run for customer invoice with incoming payment method for format BR_FEBRABAN_750 in the App Manage Automatic Payments.
After you have executed payment run, Bill-of-Exchange (BoE) payment request is created and updated in the customer invoice.
CNAB750 Return File Processing
After the bank executes the payment according to the information in the payment file, it sends back a return file. The return file contains payment confirmation or rejection data. To clear the relevant data, you need to import the received return file into your system.
Confirmation Return File
When the system processes the Confirmation Return File, it clears the Bill of Exchange Payment Request and the invoice.
Rejection Return File
Rejection Return File contains up to five rejection error codes that explain the reason of the rejection. To upload the file, open the Manage Incoming Payment Files app and choose Import. In the File Type field, choose Bank Statement, and in the Format field, select the FEBRABAN CNAB 750 (BRAZIL) format. Upload the file you received from the bank and choose Process.
The error codes are displayed in the Memo Line of the Bank Statement Item.
Do you have any further comments regarding this topic? Do not hesitate to share them in the comment section below. You are also welcome to ask any questions about SAP S4/HANA Finance in the Community Q&A section.
That's great. I was impressed by your writing. I am happy to see such a topic. I must say you have written a great article. The way you have described everything is phenomenal. Please come to my blog and read it. alaskasworld.com
Good job!