Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Viola
Advisor
Advisor

In recent months we have received several requests for support with setting up reason codes for communication with external entities, such as banks. We realize that this is still an issue for our customers. So, we decided why not describe the general process in a blog post? If the description in this post still leaves you with questions, don't hesitate to ask them in the comments. We'll try to address them in a timely fashion.  

Use 

Reason codes are codes that contain additional information regarding the status of a payment. You can assign descriptions to internal reason codes and map the external reason codes to internal reason codes. The external reason codes are received from external entities, such as banks. You use reason codes to keep a better overview of the statuses of your payments. This way you can react more quickly if issues arise, such as rejected payments or only partially accepted payments. 

Your reason codes could look like this: 

Status Reason Code Reason Reason Description 
ACCC ACC Credited 
G001 GLT Has left gpi 
G005 GDB Delivered to ABC bank as gpi 
G006 GDN Delivered to ABC bank as non-gpi 
RJCT RJT Rejected 

In this table the "Status Reason Code" refers to the external reason code, the "Reason" to the internal reason code and the "Description" is the description you configured in your back-end system. Corresponding statuses would be accepted, rejected, partially accepted and so on. 

Prerequisites 

If you want to work with reason codes, process the following SAP Notes in your back-end system: 

  • 2793365 - BNK_MONI: GPI Reason Codes  
  • 2827208 - FIN_FSCM_GPI_Reason Codes Correction 1  
  • 3002631 - CPON BCM: Rejection Reason with Proprietary (Prtry) Node in Pain.002  
  • 3035754 - CPON BCM: Missing Reason Code Node (Rsn) not Considered in Pain.002 


Setting Up Reason Codes 

Let's look at some examples to determine how to set up reason codes in your back-end system. 

Use Case 1: Displaying Reason Codes for a Payment Batch 

Let us assume you have sent a payment batch with four payments. Your payment data looks like this: 

FI Document Batch Number Message ID Payment Amount UETR 
SHE119000006232020 1894 1001576525 01 111.11 EUR ce83d36f-2168-4072-9454-50f28f8f0739 
SHE119000006242020 1894 1001576525 02 98.80 EUR 3f54cc62-59a7-47b1-affb-20956a85c541 
SHE119000006252020 1894 1001576525 03 107.00 USD 5283840c-0a0b-4e36-80d3-cc87120bc116 
SHE119000006262020 1894 1001576525 04 55.50 USD 916b4afc-6422-410d-88e1-891781ceb61f 


In the payment status report (pain.002) from the bank, we can see that two payments have been accepted and two payments have been rejected. The overall status for the payment batch is PART, which stands for "Partial", meaning partially accepted. Additionally, reason code G005 is assigned in the status reason information section of the report. This reason code contains additional information. 

Based on this information, we can now check our maintained reason codes in transaction SM30 with maintenance view V_TBNK_RSN_EXT. Here, we see the following: 

Status Reason Code Reason Reason Description 
ACSC ACC Credited 
G001 GLT Has left gpi 
G005 GDB Delivered to ABC bank as gpi 
G006 GDN Delivered to ABC bank as non-gpi 
RJCT RJT Rejected 

Reason code G005 has the description "Delivered to ABC bank as gpi" assigned, meaning the payments were delivered to the bank as SWIFT gpi. Since we now received a payment batch with this code, but a different meaning, we'll change the description to match the payment status report and make sure that our back-end system correctly displays the data in transaction BNK_MONI. 

We can check the reason codes for past payments in transaction BNK_MONI in the back-end system or on the SAP Fiori launchpad using the Monitor Payments app depending on the set-up of your SAP system. 

Option 1: Checking Reason Codes in BNK_MONI 

Go to transaction BNK_MONI and search for payment batch 1894. It should display "Partially Accepted by Bank" as the status, since these are the details provided in the payment status report from the bank. The batch could look like this in the back-end system:

You can also double-click the payment batch to see the details for each payment. The status for the individual payments is either "Accepted by Bank" or "Rejected by Bank" as indicated in the payment status report: 

Going back to the main screen, we can now check the reason codes provided in the report. For this, right-click the payment batch and select "Recent Status Reason Codes". The next screen displays the recent status reason codes. The reason codes could look like this: 

Option 2: Checking Reason Codes in Monitor Payments 

Go to the Monitor Payments app and search for payment batch 1894.  Double-click the payment batch to display the details. In the details screen you see the overall status of the payment batch, which in this case is "Partially Accepted by Bank": 

Below the status is a link to the status reason codes. Select the link to open the overview of the most recent status reason codes. The reason codes could look like this: 


Use Case 2: Add More Information with XSL Transformation 

Note: Use case 2 is an exceptional use case that is usually not needed by customers. If you still want to make changes such as the ones described, use the description provided. 

You want to include more information into your payment status reports by leveraging XSL Transformation. This allows you to add more information in the status reason information section <StsRsnInf> of the report. This might come in handy especially if you want to include longer descriptions, since the reason code is restricted to only 4 characters. Here's how to set this up. 

Use the template PAIN002_V3_TO_CPON for adding the status reason information section. The template looks like this: 


To display the status reason info section, you first need to process such files with the connector for SAP Multi-Bank Connectivity. Afterwards you can match the values between the outgoing file and the payment status report and the status reason information section <StsRsnInf> is displayed:  

And again, we can check the most recent status reason codes in the BNK_MONI transaction. The reason codes could look like this:  

Here the column "Status Info" corresponds to the status reason information section <StsRsnInf> in the payment status report. 
The same works on payment item level. Right-click the payment and select "Recent Status Reason Codes". The reason codes could look like this:  

Use Case 3: Processing pain.002 files without Status Reason Codes 

Note: Use case 3 is an exceptional use case that is usually not needed by customers. If you still want to make changes such as the ones described, use the description provided. 

You receive a payment status report in which the status reason section <Rsn> is missing and only the additional information section <AddtInf> is included. For this, use the XSL transformation template PAIN002_V3_TO_CPON. After processing the file with the connector for SAP Multi-Bank Connectivity, you can match the values from the outgoing file to the payment status report, in which you can see the status reason information section <StsRsnInf> starting with line 44:  

Checking the "Recent Status Reason Codes" in BNK_MONI provides reason codes that could look like this:  

This means that while no status reason codes were provided, the status information provides all the necessary information about the payments, such as whether the payment was rejected, completed or is still being processed. 

Do you have questions or comments?

Don't hesitate to post them in the comments. We'd love to hear from you!