Professional Documents
Culture Documents
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
Note Please see the below mentioned link on how to implement BTE through FIBF in detail.
Go to T-Code FIBF
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
*"----------------------------------------------------------------------
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.
E-Mail Body
Step-2 Implementing BTE-2050 to change Payment Advice subject line
Follow the same steps to create product and process module same as BTE-2040.
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
*"----------------------------------------------------------------------
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.