Skip to Content
Product Information
Author's profile photo Sharon Zhang

How to automate the determination of partner bank account when creating invoices?


The goal of this blog post is to show a step-by-step process of how to enable automatic determination of partner bank account when creating invoices. The process will be explained for you by an example.

Content Overview

The content of this blog post is as the following:

Business Background

Example Business Scenario

Step-by-Step Procedure

Business Background

During a business transaction, payments can be made into different bank accounts owned by the supplier, in different currencies, depending on the business needs. However, inappropriate payee bank account determination can happen due to unmatched payment currency and bank accounts. To avoid this case, Partner Bank Type is provided to identify a bank account and its transaction currency.

Previously during the invoice creation process, the partner bank type information has to be manually entered into the document via the field “Partner Bank Type”. How to save the repetitive manual effort for accounts payable accountants in this step? –Substituting “Partner Bank Type” with other fields (e.g. Supplier ID) can solve this problem.

By defining substitution rules for the field “Partner Bank Type” in the app: Manage Substitution/Validation Rules, the partner bank type information can be automatically derived into the invoice document via mapping to Supplier ID as defined in the substitution rules during invoice creation. The maintenance of substitution rules for this field is enabled in this app as of SAP S/4HANA Cloud 2202.

Example Business Scenario

As an AP accountant, I need to make payments to supplier S1730005 and S1730004, each has two bank accounts with different transaction currencies in different countries. My goal is to automate the determination of bank accounts based on the specific partner bank type to be used in the invoice.


Transaction Currency

Partner Bank Type













Step-by-Step Procedure

Step 1. Create a Custom Business Object

1. In the app Custom Business Objects, I create a new object PAYEEBANKACCOUNT-EG.

Role: administrator

2. Maintain fields of the object and publish it.

Step 2. Maintain a Business Catalog

Role: administrator

1. In the Features section, I choose Maintain Catalogs, which directs me to the Custom Catalog Extensions app. The aim of this step is to assign the user interface into a business catalog.

Make sure the User Interface and Back End Service fields are checked.

2. In the Custom Catalog Extensions app, I search for business catalog Accounts Payable-Invoices, choose the checkbox to add the business object into the catalog, and publish the business catalog.

Step 3. Create Substitution Rule for the Field

1.In the app: Manage Substitution/Validation Rules, I create a new substitution rule.

Role: Business configuration expert

2. Maintain the details for the rule.


  • Logged in user: the user ID of AP account
  • Journal entry is not posted
  • Financial account type: K (Supplier)


The target field “BP Bank Account Internal ID” in the Manage Substitution/Validation Rules app corresponds to the field “Partner Bank Type” in the journal entry item details in Manage Journal Entry Item app. This field can only use Table Lookup as its substitution type.


Substitution details

With Table Lookup, the source field “Partner Bank Type” is mapped with the supplier ID and transaction currency in the business object YY1_PAYEEBANKACCOUNTEG we maintained in step 1.

3. Choose Show Script to view the scripts after activating the rule (This action is optional).

Step 4: Maintain mapping table in the business object

  1. In App Finder, I find business catalog Accounts Payable-Invoices and within it open the business object PAYEEBANKACCOUNT-EGs I created in Step 1.

2. Maintain the mapping table

I define supplier ID, transaction currency and corresponding partner bank type in this table to create mapping among them.

Step 5: Achieve automatic determination of bank accounts

1. Create supplier invoices

In the app: Create Incoming Invoices, I create the following supplier invoices for the two suppliers and post them. In this step, the partner bank type will be automatically derived based on the mapping to supplier ID and transaction currency as defined the substitution rule.

Supplier  Transaction Currency Reference No. Amount
S1730005 USD 0501 100
S1730005 CNY 0502 200
S1730004 USD 0401 300
S1730004 AUD 0402 400

Example Invoice:

2. In the app: Manage Supplier Line Items, find the corresponding line items.

3. Open the journal entry item in the app: Manage Journal Entry Item to view the details.

In the item details, I can see that the Partner Bank Type in this journal entry item is 0001, same with the one I defined in the mapping table in Step 4.

In the same way, I can verify the Partner Bank Type information in the rest three journal entries. They are all consistent with the values defined in the mapping table. This proves that the substitution rule I defined in the app: Manage Substitution/Validation Rules is working, and the Partner Bank Type can be automatically derived into the journal entry during invoice creation, which can ensure proper bank account with effective transaction currency is used to receive the payment. As an AP accountant, I no longer have to repeatedly enter the partner bank type into the invoice by myself.


This blog post guided you through the process of automating the determination of Partner Bank Type via maintaining substitution rules. Would you like more processes description? Share your wishes in the comment section below.

If you have any question, you can find Q&A and post questions in the community for the topic addressed in this blog post, using the tag FIN Accounts Receivable and Payable.

More Information

Read more about maintaining substitution/validation rules in Rules for Substitution/Validation.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Vincent Zhang
      Vincent Zhang

      Hi Sharon,

      Thanks for the blog. I am glad to see the app: Manage Substitution/Validation Rules,can help in the process.

      Author's profile photo Manjunath Venkatesh
      Manjunath Venkatesh

      Hi Sharon,

      Thanks for the nice blog. We have a similar requirement for S/4HANA On-premise.How to implement this functionality in S/4HANA OP 2021 version ?

      is there a plan to extend "Maintain a Business Catalog" to S/4HANA on-premsie version ?