With SAP Risk Management – Preference Processing, you can request long-term vendor declarations from your vendors, for each administrative unit and for a specified period of time.
- In the SAP GTS area menu, choose SAP Risk Management ® Preference Processing ® EU or NAFTA ® Vendor-Based Long-Term Vendor Declaration ® Request/Reminder ® Request Vendor Declaration
- Enter the selection criteria like Administrative Unit, Validity Period etc.,
- Under Program Control, specify whether you want to perform a simulation run and create a log, by setting the appropriate indicators
- If, before printing the requests, you want to display a list of all the vendor-material relationships for which you want to request a long-term vendor declaration based on your selection criteria, you have to set the Output List indicator
- Choose Execute
- If you have set the Output List indicator, you can select the lines in the vendor-material-relationships
- You can perform the following functions for the lines that you select: a. Print Preview b. To print the request, choose Request and Save.
- The system prints all the long-term vendor declaration requests that match your selection criteria
In GTS, SAP evidently supports the printing of the NAFTA Certificates. But there may be a need to email these NAFTA Certificates directly to the Business Partner, there by reducing the paper cost and obviously to speed up the process. With the above process a spool is generated and one would have to code a custom program to pick up the spool and convert it to PDF document and send as an email attachment. To automate this process and enable the email functionality upon Request and Save, some additional steps have to be drafted as below:
For the Business Partner, maintain an email Id, which is where the emails will be sent to:
Identify the include where the enhancement can be developed to incorporate the logic to send the email
In Include “/SAPSLL/LPRE_VD_PRINTOUTF01”, create an Implicit Enhancement.
Add the below logic to populate the email Id of the Business Partner:
Get the communication data dynamically
pi_comm_values-adsmtp-consnumber = ‘001’.
pi_comm_values-adsmtp-flgdefault = ‘X’.
pi_comm_values-adsmtp-flg_nouse = ‘X’.
pi_comm_values-adsmtp-home_flag = ‘X’.
pi_comm_values-adsmtp-smtp_addr = BP email ID.
pi_comm_values-adsmtp-smtp_srch = BP email ID.
CALL FUNCTION ‘CONVERT_COMM_TYPE_DATA’
pi_comm_type = ‘INT’
pi_comm_values = pi_comm_values
pe_mail_recipient = gs_recipient
comm_type_not_supported = 1
recipient_creation_failed = 2
sender_creation_failed = 3
others = 4.
IF sy-subrc = 0.
MOVE-CORRESPONDING: gs_recipient TO l_params-mail_recipient.
Call Job Open function module, the dynamic function module and Job Close function module:
call function ‘FPCOMP_JOB_OPEN’
ie_outpar = l_params
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4.
*—- Determine function module via PDF form name
CALL FUNCTION ‘FP_FUNCTION_MODULE_NAME’
i_name = FORM NAME
e_funcname = l_fnam
OTHERS = 1.
*—- call PDF form
CALL FUNCTION l_fnam
/1bcdwb/docparams = l_fp_docparams
is_prn = is_vdc
is_prn_ctrl = is_print_cntrl
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
call function ‘FPCOMP_JOB_CLOSE’
e_jobresult = l_result
usage_error = 1
system_error = 2
internal_error = 3.
if sy-subrc = 0.
- This will enable the email option when the long term vendor declaration is requested.