Skip to Content
Product Information
Author's profile photo Michal Pandoscak

Instant Payments in Brazil (PIX) in SAP S/4HANA

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.

This blog is divided into 2 parts:

Accounts Payable

After you purchase 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

Run the report IDFI_PIX_CREATE_BANK to create the internal banks of type 5 – Payment system

Report will create the master data of the following technical banks:

  • PIX_CPF
  • PIX_CNPJ
  • PIX_EMAIL
  • PIX_PHONE
  • PIX_RANDOMKEY

and insert them into the table BNKAIN with the field BINTK = 5 (Payment System).

Supplier Master Data

Maintain PIX key in the Supplier Master Data in the field Account Holder (BUT0BK\LFBK\KNBK-KOINH).

Fields that are required to maintain a bank detail with alias are:

  • Bank Country
  • Bank Key (Internal Bank with category type 5)
  • (technical) Bank Account with mandatory prefix <ALIAS>
  • Account Holder (contains PIX key)
    • Reference Details

The field Account Holder has maximum length of 60 characters. If Bank Key PIX_EMAIL is used and the email entered in the field Accounts Holder exceeds 60 characters, the additional 17 characters can be maintained in the field Reference Details.

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)

In this scenario, the proper PIX key used for the payment is defined by the Partner Bank Type (BSEG-BVTYP). You choose the relevant partner bank type that already contains the PIX keys in the Part. Bank field.

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 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:

  1. the URL Link (Dynamic QR) – up to 77-character long string
  2. or the Transaction ID (Static QR) – up to 35-character long string, and select PIX key via Partner Bank Type Field

In SAP S/4HANA 1909+ releases, the URL Link or Transaction ID in the Supplier invoice can also be specified in the Fiori App Manage Journal Entries. To do that, select Manage Additional Payment Attributes for the specified Journal Entry.

In this view, you can enter URL Link (Dynamic QR Code) or Transaction ID (Static QR Code).

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 (Account Number Required)
Payment medium Format: BR_FEBRABAN_A
Format Supplement: PIX

Payment Medium File

As there are two ways of the PIX document posting, there are also two possible outcomes for the payment medium file.

  • When posting a document with a PIX key defined by Partner Bank Type, the CNAB240 file contains segments A and B. Segment A contains all information needed for clearing, while segment B contains the alias.

  • For documents posted with the QR code information, the CNAB240 file contains segments J and J52. Segment J contains all information needed for clearing, while segment J52 contains:
    • URL Link for Dynamic QR Code
    • Transaction ID and PIX Key for Static QR Code

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.

Rejection Return File

Rejection Return File contains up to five rejection error codes that explain the reason of the rejection.

To upload the file, run transaction FF_5 and select Electronic bank statement format B Cobrança/Pagar Itau – Brazil and the Statement File.

If the program finds an error in the return file, the screen will look like this:

Error codes are maintained in the view J_1B_ERROV:

You can also access the view through Customizing for Financial Accounting under Bank Accounting > Business Transactions > Payment Transactions > Electronic Bank Statement > Error Codes.

When the system processes the Rejection Return File, it calls an external transaction to display the error code/codes. For CNAB240, the Error Codes are 2-character long.

Confirmation Return File

Confirmation Return File contains payment confirmation. To upload the file, run transaction FF_5 and select Electronic bank statement format B Cobrança/Pagar Itau – Brazil and the Statement File.

When the system processes the Confirmation Return File, it clears the Bill of Exchange Payment Request and the invoice.

 

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

The PIX Key for the relevant House Bank Account can be maintained in the field Alternative Bank Account Number.

Assign ISPB Code for House Bank

Assign ISPB code to Company Code and House Bank in the view FIAPBRD_ISPB. You can make the assignment in Customizing for Financial Accounting under Bank Accounting > Bank Accounts > Country-Specific Functions > Brazil > Assign ISPB Codes to Bank Codes.

Correspondence Setup

To display or print the received QR code in the invoice, you must set up correspondence by assigning a correspondence program and variant to your company code.

  1. Allocate the RFKORDPIX_PDF correspondence program and the BR_PIX_QR variant to your company code with correspondence type SAPBR.

To do that, go to Customizing for Financial Accounting under Accounts Receivable and Accounts Payable > Business Transactions > Closing > Count > Balance Confirmation Correspondence > Make and Check Settings for Correspondence > Assign Programs for Correspondence Types (transaction OB78).

  1. Define trigger points for call options when correspondence is called.

To define trigger points, go to Customizing for Financial Accounting under Accounts Receivable and Accounts Payable > Business Transactions > Closing > Count > Balance Confirmation Correspondence > Make and Check Settings for Correspondence > Determine Call-Up Functions (transaction OB79).

  1. Assign the PDF form to the RFKORDPIX_PDF print program.

To assign it, go to Customizing for Financial Accounting under Financial Accounting Global Settings > Correspondence > PDF-Based Forms > Define Form Names for Correspondence Printing.

SAP Standard delivered form is IDFI_PAYM_BR_PIX_PDF.

SAP Standard delivered interface is IDFI_PAYM_BR_PIX.

QR Code Form Output

Print out will be automatically triggered and sent to spool (transaction SP01) upon the return file upload. If needed, print out can be repeated in the transaction F.64 (correspondence maintenance).

See the example of QR Code form output below:

 

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

Payment Media Creation for DMEE Payment Format CNAB750

Execute the payment run using transaction F110 for customer invoice with incoming payment method for format BR_FEBRABAN_750.

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.

Rejection Return File

Rejection Return File contains up to ten rejection error codes that explain the reason of the rejection.

To upload the file, run transaction FF_5 and select Bank Specific Format FEBRABAN CNAB 750 and the Statement File.

If the program finds an error in the return file, the screen will look like this:

Error codes are maintained in the view J_1B_ERROV:

You can also access the view through Customizing for Financial Accounting under Bank Accounting > Business Transactions > Payment Transactions > Electronic Bank Statement > Error Codes.

When the system processes the rejection return file, it calls an external transaction to display the error code/codes. For CNAB750, the Error Codes are 3-character long.

QR Code Update Return File

When QR code update return file is returned by bank, it contains EMV QR Code in the segment 4.

To upload the file, run transaction FF_5 and select Bank Specific Format FEBRABAN CNAB 750 and the Statement File.

When the system processes the QR code update return file, it updates the Bill of Exchange Payment Request and Customer invoice FI documents with this QR code. QR Code form will be generated and sent to spool (which can be accessed via transaction SP01).

Confirmation Return File

Confirmation Return File is returned by bank and it contains confirmation of payment in the segment 5.

To upload the file, run transaction FF_5 and select Bank Specific Format FEBRABAN CNAB 750 and the Statement File.

When the system processes the Confirmation Return File, it clears the Bill of Exchange Payment Request and the invoice.

 

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.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.