To populate the custom reference field ZREF01, which you used in the format mapping, with the email address of the accounting clerk, you need to set up an extension point in the Custom Logic application. This exercise will walk you through the necessary steps.
To start creating a custom reference field, ensure you have already set up the Payment Medium Format and the Payment Method. For detailed guidance on these preliminary steps, see the lesson Setting up the Payment Process.
Note
FORMAT refers to the name of the payment medium format in 'Create Payment Medium Formats' not the format mapping in 'Map Format Data for Payments’.
You can find the code that was used in the previous exercise here.
123456789101112131415161718* get the email address of the accounting clerk maintained in the Supplier
* This attribute is company code dependent for which the I_SUPPLERCOMPANY CDS will be used
DATA: ls_supplier type i_suppliercompany.
*all PAYMENTCUSTOMERFIELDS-ZREFxx are empty
*we assume that we work only with supplier otherwise the supplier is identified as paymentdata-gpa1t = '11'
SELECT SINGLE * FROM i_suppliercompany
INTO @ls_supplier
WHERE supplier = @paymentdata-gpa1r
AND companycode = @paymentdata-zbukr.
IF sy-subrc EQ 0.
paymentcustomerfields-zref01 = ls_supplier-accountingclerkinternetaddress.
ENDIF.