Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
GOWRESHANHARAN
Explorer
56,059

Introduction:

The payment run process is an accounts payable process that is used to handle payments to vendors. The process is called an automatic payment program.

The autmatic Payment Program (F110) is used to clear the open invoices and post the payments against the invoices. F110 is the standard t-code or Manage Automatic Payment Application is also used to do the same.

In addition to the above, there are also forms sent to customers and vendors about the Payments done called Remittance Advice and Payment Advice based on the payment method configured.

Payment Advice:

A payment advice note is a document or letter of communication sent by a customer or buyer to businesses that states that an invoice has been paid to cheque, NEFT, RTGS, or by any means of electronic transfers, etc.,

It is a letter of communication that acknowledges the seller as to which outstanding invoices have been cleared by the buyer and by what means. Therefore, a payment advice note can be handy when it comes to matching payments to an invoice.

BTE Configuration steps:

From here you can isolate the specific business process you want to enhance/customize.

SAP sample function module SAMPLE_PROCESS_00002040 is available for emailing vendor Remittance Advice. This must be copied as a Zfunction module and make your customization and then save it as ZFM_VENDOR_REM.


The ABAP team can help to copy the function module. You can also use the sap standard function module if no change is required.

 

FUNCTION zsample_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,
        ls_regup         TYPE regup,                        "2917863
        l_koart          TYPE koart,                        "2917863
        l_adrnr          TYPE adrnr,                        "2917863
        l_lifnr          TYPE lifnr,                        "2917863
        l_kunnr          TYPE kunnr.                        "2917863

  TYPES: BEGIN OF t_tvarvc,
           sign TYPE tvarv_sign,
           opti TYPE tvarv_opti,
           low  TYPE tvarv_val,
           high TYPE tvarv_val,
         END OF t_tvarvc.

  DATA: wa_ssender TYPE t_tvarvc.
  CONSTANTS: c_ssender(30) TYPE c VALUE 'ZRTR_XXXX_H2H_PAYADV'.

  IF i_reguh-zbukr = 'XXXX'. 
* default: print payment advice
    c_finaa-nacha = '1'.

* Begin of 2917863
    l_adrnr = i_reguh-zadnr.
* get address number for payment request clearings
    IF i_reguh-dorigin EQ 'FI-AP-PR'
    OR i_reguh-dorigin EQ 'FI-AR-PR'.
      SELECT SINGLE * FROM regup INTO ls_regup
        WHERE laufd = i_reguh-laufd
        AND   laufi = i_reguh-laufi
        AND   xvorl = i_reguh-xvorl
        AND   zbukr = i_reguh-zbukr
        AND   lifnr = i_reguh-lifnr
        AND   kunnr = i_reguh-kunnr
        AND   empfg = i_reguh-empfg
        AND   vblnr = i_reguh-vblnr.
      IF sy-subrc = 0.
        IF i_reguh-dorigin EQ 'FI-AP-PR'.
          l_koart = 'K'.

          SELECT SINGLE lifnr FROM bseg INTO l_lifnr
            WHERE belnr = ls_regup-belnr
            AND   bukrs = ls_regup-bukrs
            AND   gjahr = ls_regup-gjahr
            AND   koart = l_koart.

          IF sy-subrc = 0.
            SELECT SINGLE adrnr FROM lfa1 INTO l_adrnr
              WHERE lifnr = l_lifnr.
          ENDIF.
        ELSE.
          l_koart = 'D'.

          SELECT SINGLE kunnr FROM bseg INTO l_kunnr
            WHERE belnr = ls_regup-belnr
            AND   bukrs = ls_regup-bukrs
            AND   gjahr = ls_regup-gjahr
            AND   koart = l_koart.

          IF sy-subrc = 0.
            SELECT SINGLE adrnr FROM kna1 INTO l_adrnr
              WHERE lifnr = l_kunnr.
          ENDIF.

        ENDIF.
      ENDIF.
    ENDIF.
* end of 2917863

* check that address number is available
    IF NOT l_adrnr IS INITIAL.                              "2917863

*   read complete address of vendor/customer
      CALL FUNCTION 'ADDR_GET_COMPLETE'
        EXPORTING
          addrnumber     = l_adrnr                "2917863
        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-namep = 'ZFI_VENDOR_PAYMENT_ADVICE_XXXX'.
          c_finaa-intad = l_adsmtp_line-adsmtp-smtp_addr.

          IF NOT c_finaa-intad IS INITIAL.

            SELECT SINGLE sign opti low high
            INTO CORRESPONDING FIELDS OF wa_ssender
            FROM  tvarvc
            WHERE name = c_ssender
            AND type = 'P'
            AND numb = 0.

          ENDIF.

          IF sy-subrc = 0 AND wa_ssender-low IS NOT INITIAL.
            c_finaa-mail_send_addr = wa_ssender-low.
          ENDIF.

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

ENDFUNCTION.



Configuration Path : SPRO > SAP Customizing Implementation Guide > Financial Accounting >

Financial Accounting Global Settings > Business Transaction Events  (or)

Transaction code: FIBF

Link the newly created custom function module(ZFM_VENDOR_REM.) to the BTE.

The custom function module can be specified following the steps below.

Create A Product:

Navigate as shown below: -

In FIBF > Settings > Products > Of a customer.


Click On New Entries to create new customer products:


Update the following And Click Save :

In the image below, I created a new product called “ZPMYADV” described as “Email Payment Advice for Vendor”. Note that you can leave the A or Active checkbox blank if you are not yet testing.


For RFC destination, keep that field blank. You do not need to make an entry in this field unless the additional component in question is not in the local system.

If the additional component does not run in the local system, you should enter the standard name of an RFC destination. You can read more about this by clicking on the field and pressing F1 on your keyboard.

Email Subject Line:

Configuration Path : SPRO > SAP Customizing Implementation Guide > Financial Accounting >

Financial Accounting Global Settings > Business Transaction Events  (or)

Transaction code: FIBF

GOWRESHANHARAN_0-1716224035967.png

Click On New Entries to create new customer products:

GOWRESHANHARAN_1-1716224075007.png

Update the following And Click Save :

GOWRESHANHARAN_2-1716224112371.png

In the image below, I created a new product called “ZPAYADSU” described as “payment advice subject line”. Note that you can leave the A or Active checkbox blank if you are not yet testing.

Link product and Zfunction module to the BTE process:

Go to Transaction code: FIBF

Navigate as shown below: -

In FIBF > Settings > Process Modules> Of a customer.


Click on New Entries:


Update the following update process 00002040 with the zfunction module(ZFM_VENDOR_REM) or function module(SAMPLE_PROCESS_00002040) and the product we created in the earlier step:


Above, we see that New Product “ZPMYADV”, the custom function module, and the BTE process was entered as new entry. Thus, linking the custom functionality to the BTE.

Click Save.

Email Subject Line:

SAP sample function module SAMPLE_PROCESS_00002050 is available for emailing vendor Remittance Advice subject line. This must be copied as a Zfunction module and make your customization and then save it as Z_PAYMENT_ADVISE_TITLE.

The ABAP team can help to copy the function module. You can also use the sap standard function module if no change is required.

 

 

FUNCTION z_payment_advise_title.
*"--------------------------------------------------------------------
*"*"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_country         TYPE adrc-country.

  IF i_reguh-zbukr = 'XXXX'.
    SELECT adrc~country
      UP TO 1 ROWS
      INTO lv_country
      FROM lfa1 INNER JOIN adrc ON lfa1~adrnr = adrc~addrnumber
      WHERE lfa1~lifnr = i_reguh-lifnr.
    ENDSELECT.
    IF lv_country = 'FR'.
      c_itcpo-tdtitle = 'XXXXXXXXXXXXXXXXXX'(001).
    ELSE.
      c_itcpo-tdtitle = 'XXXXXXXXXXXXXXXXXX'(002).
    ENDIF.
  ENDIF.
ENDFUNCTION.

 

 

Go to Transaction code: FIBF

Navigate as shown below: -

In FIBF > Settings > Process Modules> Of a customer.

GOWRESHANHARAN_3-1716224210243.png

Click on New Entries:

GOWRESHANHARAN_4-1716224210268.png


Update the following update process 00002050 with the zfunction module(Z_PAYMENT_ADVISE_TITLE) or function module(SAMPLE_PROCESS_00002050) and the product we created in the earlier step:

GOWRESHANHARAN_6-1716224337040.png

Above, we see that New Product “ZPMYADSU”, the custom function module, and the BTE process was entered as new entry. Thus, linking the custom functionality to the BTE.

Click Save.
RFFOAVIS Program:

RFFOAVIS_FPAYM is by default used by SAP for payment advice generation. You just need to give the appropriate variant in the F110 > Printout tab for this program.

Program (RFFOAVIS_FPAYM) generates the vendor payment advice which will be either emailed to the vendor (if the vendor email address is maintained) or will generate a spool request (in case no email address is maintained in vendor master).

Create variant for the program - RFFOAVIS_FPAYM :

Go to Transaction code: SE38 => Update the following and Execute :

Program Name: RFFOAVIS_FPAYM


Forms:

There are three kinds of forms that can be used in SAP:

    1. SAP scripts - F110_US_AVIS (or)
    2. SMART FORMS (or)
    3. Adobe Forms - F110_AVIS_INT

For payment advice, we can use all three kinds of forms.

SAP SCRIPTS:

    • This is the default configuration provided by SAP.
    • Standard script for the payment advice: ‘F110_US_AVIS’

SMARTFORMS:

    • There is no standard way of customizing smart forms in SAP for Payment advice.
    • So maintain the form names in one table based on the company code and the payment method. In the program call the form name and in the part of the code in the standard include call the form name and smart form name.
    • In case of the classic payment medium program we can custom a Z Program.
    • In case of the Payment medium work bench always the program RFFOAVIS_FPAYM is called.

Adobe Forms:

    • Adobe forms configuration can be done only in the Company code level not on the payment method level.
    • SAP has already provided standard Adobe forms for the Payment advice.

variant for the program :

Update the following:

    • Printer: LP01
    • SAP-script P Advice Form: F110_US_AVIS
    • Print Immediately: Checked


Click Save as Variant.

Update the following and Click Save:

    • Variant Name: Paym_ADV1
    • Description: Payment Advice


Above , Variant for the program is successfully created in the name of "PAYM_ADV1" with description "Payment Advice"

Copy FI_PAYMEDIUM_SAMPLE_41 AS ZFI_PAYMEDIUM_SAMPLE_41:

You can sometimes use the event module 41 for the automatic creation of the payment medium correspondence.

To do so, copy the example module FI_PAYMEDIUM_SAMPLE_41 to a customer module and use the source code defined in this below.

Replace <PAYM_ADV1> in the example source code with a valid variant for the report rffoavis_fpaym.

Code:

 

FUNCTION zfi_paymedium_paymadv_41 .

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

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(I_FPAYH) LIKE  FPAYH STRUCTURE  FPAYH

*"     VALUE(I_FPAYHX) LIKE  FPAYHX STRUCTURE  FPAYHX

*"  TABLES

*"      T_FILE_OUTPUT STRUCTURE  FPM_FILE

*"  CHANGING

*"     REFERENCE(C_WAERS) LIKE  FPAYH-WAERS

*"     REFERENCE(C_SUM) LIKE  FPAYH-RWBTR

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



  DATA : lc_jobname     LIKE tbtcjob-jobname,

         lc_jobcount    LIKE tbtcjob-jobcount,

         lc_jobreleased LIKE btch0000-char1.



  CONCATENATE 'PAYM_ADVICES:' i_fpayh-laufd '/' i_fpayh-laufi

  INTO lc_jobname.

  CALL FUNCTION 'JOB_OPEN'

    EXPORTING

      jobname  = lc_jobname

    IMPORTING

      jobcount = lc_jobcount

    EXCEPTIONS

      OTHERS   = 1.

  IF sy-subrc NE 0.

    CALL FUNCTION 'FI_PAYM_MESSAGE_COLLECT'

      EXPORTING

        i_msgid     = sy-msgid

        i_msgty     = 'E'

        i_msgno     = sy-msgno

        i_msgv1     = sy-msgv1

        i_msgv2     = sy-msgv2

        i_msgv3     = sy-msgv3

        i_msgv4     = sy-msgv3

        i_probclass = 'E'.

    EXIT.

  ENDIF.



  SUBMIT rffoavis_fpaym

  USING SELECTION-SET 'PAYM_ADV1'

        USER sy-uname VIA JOB lc_jobname NUMBER  lc_jobcount

        WITH zw_laufd = i_fpayh-laufd

        WITH zw_laufi = i_fpayh-laufi

        WITH zw_xvorl = i_fpayh-xvorl

        AND RETURN.



  CALL FUNCTION 'JOB_CLOSE'

    EXPORTING

      jobcount         = lc_jobcount

      jobname          = lc_jobname

      strtimmed        = 'X'

    IMPORTING

      job_was_released = lc_jobreleased

    EXCEPTIONS

      OTHERS           = 1.



  IF sy-subrc NE 0.

    CALL FUNCTION 'FI_PAYM_MESSAGE_COLLECT'

      EXPORTING

        i_msgid     = sy-msgid

        i_msgty     = 'E'

        i_msgno     = sy-msgno

        i_msgv1     = sy-msgv1

        i_msgv2     = sy-msgv2

        i_msgv3     = sy-msgv3

        i_msgv4     = sy-msgv3

        i_probclass = 'E'.

  ENDIF.

ENDFUNCTION.

 


Activate the new module - ZFI_PAYMEDIUM_SAMPLE_41.


Define the customer module in event 41:

    1. Call transaction OBPM1 (display mode).
    2. Select the format used.
    3. Click "Customer settings for Format" (TA OBPM3).
    4. In the dialog structure: Choose "Event modules"


Payment advice notes by mail: Introductory text with attachment:

If you want to send the payment advice note in the mail attachment and an introductory text is supposed to appear in the mail.

Maintain Introductory Text:

SO10 is used to create Standard texts for use in SAP scripts. This basically permits reusability of standard texts across many SAP scripts. These also can be defined in different languages & can be used by specifying the language option in a SAP script.

Go to Transaction code: SO10

Specify an introductory text (language-dependent) for the text ID FIKO. Select your text Name

Text Name: ZFI_VENDOR_PAYMENT_ADVICE

Text ID: FIKO

Language: EN

And click on create. Maintain the text and save it.


Updating Text Name in  SAMPLE_PROCESS_00002040 :

Go to Transaction code: SE37

Edit the ZFM_VENDOR_REM. Which is Z copy of SAMPLE_PROCESS_00002040.


Enter it in uppercase letters in the field FINAA-NAMEP in the process exit 2040 (call from include RFFORI06).

Update the Text Name.

c_finaa-namep: ‘ZFI_VENDOR_PAYMENT_ADVICE’

Save the Change and Activate the Zfunction Module.


Master data requirements:

Vendor Master

Transaction code: BP:

Fiori Application: Maintain Business Partner

Email address should be updated as shown below in the vendor master:

    • BP Role: Business Partner (Gen.)
    • Tab: Address > Communication
    • Email: XXX@gmail.com
    • Standard Method: INT Email

Make the changes and save the bp.


Manage Automatic Payments:

Payment run process is an accounts payable process that is used to handle payments to vendors. The process is called automatic payment program.

With the transactional app Manage Automatic Payments, you can schedule payment proposals or schedule payments directly and get an overview of the proposal or payment status. The app identifies the overdue invoices and checks whether all the required payment information is complete.

The Payment Process includes the Following Steps

    • Invoices are Entered
    • Pending Invoices are analysed for due date
    • Invoices due for payment are prepared for review
    • Payments are approved or modified
    • Invoices are paid

Start fiori app “Manage Automatic Payments” and Click Create Parameter.


On the first screen, you need to enter run date and identification. In the identification field, give a five-characters alphanumeric code that will be used to identify the payment program. A combination of the run date and identification is used to identify the program in SAP system.

Fill the Run date and identification and click Create:


In the Parameters Tab, We have to define the following and Click Save

    • What is to be paid – Docs. Entered Up to
    • What payment methods will be used – Payment Methods
    • When will the payments be made – Posting Date?
    • Which company codes will be considered – Company Codes?
    • How are they going to be paid – The payment Method Sequence decides the Priority of the Payment Method
    • Enable Additional log – To get some additional log information.


You can see the payment parameter created :

Create Payment Proposal:

Selected the Parameter and click schedule Proposal:

When you click on Proposal the system is going to ask whether you want to create it immediately or want to schedule it for a time in the future. For this demo, we are going to run it immediately. You should tick the checkbox for creation of payment medium.

Make sure you select “Start Immediately” and then click on Schedule.


You can see the payment proposal in the respective tab.

A payment proposal is generated based on the parameters.


Review Payment Proposal:

    • Click on the arrow button to review the document selected in this run.
    • The system will list all the vendors that have been included in the payment proposal.
    • We can view the Proposal Log for possible errors by Pressing the Proposal Log Button.
    • We can edit the proposal to block the some payments if we want, Press the Edit Proposal Button.


Payment Run:

Go to Proposal and click on Schedule Payment to run Payment.


Check “Start Immediately” to start the payment run instantly and then click on Schedule.


Go to “Payments Processed” and You can see the payment posted.

We can check the status of the Payment run on the Status Tab.


You can also select the posted payment to see the log:


Note: If you have approvers for the payment, then the batch will be generated. Email will get triggered after the Payment approvals.

To check whether the advice is sent to the vendor by Email:

Transaction code SOST is used to display and administer of all messages sent using SAP connect. The program displays send requests that are being sent, or have already been sent by using SAP connect. In this transaction, a send request always contains just one recipient.

Transaction code: SOST

    • You can see the email that is being triggered / delivered in Transaction code SOST.
    • We can found the email send with respect to our payment time and date.


Review Email:

Select the Email Log and Click Display Document Icon:


You can see the body of the mail:

The body of the email is coming from the text we maintained in SO10 i.e. ZFI_VENDOR_PAYMENT_ADVICE.


Click on the PDF icon to see the attachment (Payment Advice) send:


Review Payment Advice :


Review Spool Request:

The spool system uses a spool request to store the print data temporarily and to be able to access it. The data is stored in a temporary format. You can also display the print document. The system automatically assigns a 10-digit ID number to a spool request.

Vendor payment advice will either be emailed to the vendor (if email address is maintained in the vendor master) or will generate a spool request if email address is not maintained. The spool request can be viewed and printed through transaction code sp02.

You can also see the Payment output in spool request:

8 Comments
Labels in this area