Aug 5, 2021

How to send the different Finance outputs via email ?

A typical Business requirement now a days in today's world is to send certain Finance Outputs via email automatically from SAP as soon as you generate them. In S/4 HANA on-premise (and ECC as well), to be able to achieve this you need to deal with a little bit of custom code that needs to be added and managed in BTE's (Business Transaction Events). These ones are similar to any other User Exit.

As you might know already, there are different automatic processes in SAP that trigger outputs and when these are created, these BTEs will be called and eventually the generated outputs will be sent via email by SAP automatically if you put the appropriate code on them.

I will be talking in these post about 4 different important and key Finance Outputs:

    • Vendor Payment Advice
    • Customer Statement
    • Dunning Notice
    • Interest 

In this post I will NOT explain you how to execute the programs that generate them, what options and/or values to put in the screens. As a Consultant you should know how to run these "user" steps already. There are plenty of content about this on the Internet already. This Blog post is not for that, is to explain you the technical side of what you need to do to achieve sending these Outputs via email.

Each one of these Outputs have at least 1 (some even 2) Function Modules that need to be coded to be able to control if the output goes to the Spool, Email / Internet or Fax (nobody uses a Fax anymore). Other things that you can control too are the Sender email, Recipient email, email Subject and email body text. All of these can be managed as part of your custom code.

These FMs get assigned in Tcode FIBF and are based on a Transaction Event number that corresponds to each one of these different outputs. You cannot reuse the same code for all of them, but the idea and logic can be replicated for all of them.



1st you need to start by "registering" your Product / Output for the ones you will be dealing with. In my case, ZDUN, ZPADV_EM, ZPADV_SJ. But you can put any Product name / code that you want, then you need to flag the "Active" field as well; otherwise it will not be called.




Then once you have your Function Modules with your Custom code, you need to enter the FMs.



You go into Process Modules -> of a customer to assign them.


You make entries in this table to assign here the FMs that you have coded to manage the different options like (sender / receiver email, subject and body text). As you can see, the Process numbers represent the individual outputs.


Payment Advice

Payment Advice has 2 processes 2040 and 2050. 

Process 2040, allows you to manage Sender email address, Recipient email address, Mail Body Text and the type of Transmission Method 

  • c_finaa-nacha = '1'  - Spool
  • c_finaa-nacha = 'I'  - Internet / Email

For this SAP gives you a "Sample" FM that you can use as a base to copy and insert you own custom code. This is SAMPLE_PROCESS_00002040

Process 2050, allows you to manage email Subject

For this SAP gives you a "Sample" FM that you can use as a base to copy and insert you own custom code. This is SAMPLE_PROCESS_00002050

Customer Statement

Process 2310. This one allows you to manage Transmission method, Format (PDF), Mail Body, Mail Subject, Sender and Recipient email address.

For this SAP gives you a "Sample" FM that you can use as a base to copy and insert you own custom code. This is SAMPLE_PROCESS_00002310

Dunning Letter

Process 1040. This one allows you to manage Transmission method, Format (PDF), Mail Body, Mail Subject, Sender and Recipient email address.

For this SAP gives you a "Sample" FM that you can use as a base to copy and insert you own custom code. This is SAMPLE_PROCESS_00001040.

Interest Output

For the Interest Calculation done out of FINT Tcode, I will refer you to the below Blog post where it explains Badi FI_INT_CUS01 that needs to be implemented to manage all the same things that we did for the other Outputs. 

By the way, excellent Blog this one for Abap resources. 


The specific Abap code of each one of these Function Modules need to be done based on your particular case. I am not providing you the code in this Posting. Maybe this will be the subject of a subsequent Post.


** Note: This process applies to S/4 HANA On-Premise (ECC as well) only. For S/4 HANA Cloud the solution is completely different and based on the new Output Management Solution that works with BRF+ technology. I am not aware that this has changed for S/4 HANA 2020 version either. If you know, please let me know ...


Some Reference OSS Notes:

◈ Payment Advice: OSS 1033893, 836169
◈ Dunning: OSS 1042992
◈ Customer correspondence (Ex. Statement): OSS 1360070
◈ Interest : OSS 956981


If your Company and/or Project needs to implement this, or any of the functionalities described in my Blog, or advise about them, do not hesitate to reach out to me and I will be happy to provide you my services.