You are on page 1of 7

Sending Payment Advice to Multiple E-Mails Ids and

Changing Subject line of payment advice using BTEs


Introduction

This article is intended to discuss 2 items on payment advice to Vendor-

1) How to send payment advice to multiple e-mail ids.

2) How to change Subject line of the payment advice.

When Accounts Payable team comes up with the requirement of sending payment advice to vendor above
mentioned 2 points will be the first priority of requirements.

Based on SAP Note-1033893 we can achieve them by implementing BTEs 2040 & 2050

Pre-Requisites : All FBZP configuration to send Payment Advice needs to be maintained.

Note Please see the below mentioned link on how to implement BTE through FIBF in detail.

Step-by-Step Procedure to achieve

Step-1 Implementing BTE-2040 to send Payment Advice to Multiple E-Mail Ids

Go to T-Code FIBF

Menu -> Settings -> Products -> of a customer


Create a New Entry as shown below

Menu -> Settings -> Process Modules -> of a customer

Create a New Entry as shown below

Through SE37 we need to copy the standard function module SAMPLE_PROCESS_00002040 to Z.


Source Code in the Function Module

function zsample_process_00002040.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_REGUH) LIKE REGUH STRUCTURE REGUH OPTIONAL
*" TABLES
*" T_FIMSG STRUCTURE FIMSG OPTIONAL
*" CHANGING
*" VALUE(C_FINAA) LIKE FINAA STRUCTURE FINAA OPTIONAL
*"----------------------------------------------------------------------

* data declaration for address routines


type-pools szadr.
data: l_addr1_complete type szadr_addr1_complete,
l_adfax_line type szadr_adfax_line,
l_adsmtp_line type szadr_adsmtp_line.

DATA: lv_email(130) type c.


* default: print payment advice
c_finaa-nacha = '1'.

* check that address number is available


if not i_reguh-zadnr is initial.

* read complete address of vendor


call function 'ADDR_GET_COMPLETE'
exporting
addrnumber = i_reguh-zadnr
importing
addr1_complete = l_addr1_complete
exceptions
others = 4.

if sy-subrc eq 0.
* Email to Vendor As Default.
* check that internet address is available
read table l_addr1_complete-adsmtp_tab into l_adsmtp_line index 1.
if sy-subrc eq 0
and not l_adsmtp_line-adsmtp-smtp_addr is initial.
*
* choose message type 'I'nternet and fill email address
c_finaa-nacha = 'I'.
c_finaa-intad = l_adsmtp_line-adsmtp-smtp_addr.
c_finaa-namep = 'PAYMENT ADVICE'.
concatenate l_adsmtp_line-adsmtp-smtp_addr 'test@abcde.com'
into lv_email
separated by space.
c_finaa-intad = lv_email.
elseif sy-subrc <> 0.
* FAX communication Uncomment if Payment Advice needs to sent by FAX
** Check if Fax number exists.
** Fax for payment Advice(2nd fax)
* clear l_adfax_line.
* read table l_addr1_complete-adfax_tab into l_adfax_line index 2.
* if sy-subrc <> 0.
* read table l_addr1_complete-
adfax_tab into l_adfax_line index 1.
* endif.
** Fax End
* if sy-subrc eq 0
* and not l_adfax_line-adfax-fax_number is initial.
* c_finaa-nacha = '2'. "Fax
* c_finaa-tdschedule = 'IMM'. "Sofort
* c_finaa-tdteleland = l_adfax_line-adfax-country.
* c_finaa-tdtelenum = l_adfax_line-adfax-fax_number.
** c_finaa-formc = 'FI_FAX_COVER_A4'. "SAPscript Deckblatt
* endif.
endif.
endif.
endif.

endfunction.

Note With the above code Payment advice is sent through E-Mail only, if both E-Mail and Fax is
maintained for a vendor in vendor master then E-Mail will be given first preference.

Go to transaction SO10.

In the source code of the function module for the parameter namep it is maintain as PAYMENT ADVICE,
So standard text needs to be created by 'Payment advice' in order to call the E-mail body.
c_finaa-namep = 'PAYMENT ADVICE'.

By clearing Payments through F110 transaction code then the payment advices will be sent to Vendor and
also to the id maintained in the function module.

Checking E-Mails through SOST

This confirms Payment Advice is sent to 2 email ids simultaneously.

E-Mail Body
Step-2 Implementing BTE-2050 to change Payment Advice subject line

Before Implementing in SOST Subject line of Payment Advice -

After Implementing BTE-2050

Follow the same steps to create product and process module same as BTE-2040.

Create the product and Process Module

Copy function module SAMPLE_PROCESS_00002050 to ZSAMPLE_PROCESS_00002050.


Source Code in the Function Module

FUNCTION ZSAMPLE_PROCESS_00002050.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_REGUH) LIKE REGUH STRUCTURE REGUH
*" VALUE(I_GJAHR) LIKE REGUD-GJAHR
*" VALUE(I_NACHA) LIKE FINAA-NACHA
*" VALUE(I_AFORN) LIKE T042B-AFORN
*" CHANGING
*" VALUE(C_ITCPO) LIKE ITCPO STRUCTURE ITCPO
*" VALUE(C_ARCHIVE_INDEX) LIKE TOA_DARA STRUCTURE TOA_DARA
*" DEFAULT SPACE
*" VALUE(C_ARCHIVE_PARAMS) LIKE ARC_PARAMS STRUCTURE ARC_PARAMS
*" DEFAULT SPACE
*"----------------------------------------------------------------------

DATA: lv_date(10) type c,


lv_Subline type string.

lv_date = C_ITCPO-TDTITLE+25(10).

Concatenate 'Payment Advice from XXXXX' Added XXXXX to the subject line
lv_date
into lv_Subline
separated by space.

IF I_NACHA EQ 'I'.
C_ITCPO-TDTITLE = lv_Subline.
ENDIF.

ENDFUNCTION.

After clearing payments through F110 in SOST E-mails will be with added subject line.

You might also like