cancel
Showing results for 
Search instead for 
Did you mean: 

Specific requirement - Emailing/Printing Remittance Advices to vendors from F110

Former Member
0 Kudos

Hi,

We have a requirement to email remittance advices to vendors from transaction F110.

I have configured Process 2040 as per notes and threads in the forums and have emailing of remittances working correctly.

What my problem is that some of our vendors specify a different email address to be used for remittance advices than for purchase orders. i.e. Purchase Orders go to one email, Remittances to another email.

Is it possible to do this?

I would also like to only print remittance advices where the vendor does not have a remittance advice email address. Currently the F110 payment run is printing the remittances advices and also sending them via email, i would like it to do one or the other, not both.

Attached is my code for sending remittance advices.

Any help in finding a solution to my problem would be appreciated.

Regards,

Martyn Ryan

FUNCTION ZFI_PROCESS_00002040.

*"--------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(I_REGUH) LIKE  REGUH STRUCTURE  REGUH

*"  TABLES

*"      T_FIMSG STRUCTURE  FIMSG

*"  CHANGING

*"     VALUE(C_FINAA) LIKE  FINAA STRUCTURE  FINAA

*"--------------------------------------------------------------------

* data declaration for address routines

  TYPE-POOLS szadr.

  DATA: l_addr1_complete TYPE szadr_addr1_complete,

        l_adsmtp_line    TYPE szadr_adsmtp_line.

* default: print payment advice

  c_finaa-nacha = 'I'.

* check that address number is available

  IF NOT i_reguh-zadnr IS INITIAL.

*   read complete address of vendor/customer

    CALL FUNCTION 'ADDR_GET_COMPLETE'

         EXPORTING

              addrnumber     = i_reguh-zadnr

         IMPORTING

              addr1_complete = l_addr1_complete

         EXCEPTIONS

              OTHERS         = 4.

    IF sy-subrc EQ 0.

*     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.

      ENDIF.

    ENDIF.

  ENDIF.

* if email was not possible: try fax (message type 2)

  IF c_finaa-nacha NE 'I'.

    IF NOT i_reguh-ztlfx IS INITIAL.

      c_finaa-nacha      = '2'.                 "Fax

      c_finaa-tdschedule = 'IMM'.               "Sofort

      c_finaa-tdteleland = i_reguh-zland.           "Land der Faxnummer

      c_finaa-tdtelenum  = i_reguh-ztlfx.           "Faxnummer

      c_finaa-formc      = 'FI_FAX_COVER_A4'.   "SAPscript Deckblatt

    ENDIF.

  ENDIF.

ENDFUNCTION.

Accepted Solutions (0)

Answers (1)

Answers (1)

sanilbhandari
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi

You can create a new communication method in the path below:

IMG>SAP Netweaver> Application Server> Basis Services> Communication Interfaces>SAP Connect: Client Wide Settings> General Settings> Communication Method

There after, implement the BADI

VENDOR_ADD_DATA under method SAVE_DATA to add z fields to save the methods of communication and email address. Save the Email address under the new communication method to record the email id for sending the remittance advise.

Now call this payment method in the process implemented by you above.

Thanks & Regards


Sanil Bhandari