Professional Documents
Culture Documents
The document provides an overview of the feasibility of multiple mail option for SAP
scripts. The challenge in SAP scripts is that the numbers of recipients in the external send
transmission medium is limited to one. So enhancing the standard functionality is required.
A general knowledge of SAP script and enhancements is required for understanding the
document.
Solution
Below is an overview of the solution and then a detailed step by step procedure with
an example.
Overview
The SAP script creates an OTF format of the Form data, this data can be imported to
the program through CLOSE_FORM. The imported data is sent to the required mail
recipients. To be able to obtain the OTF format in CLOSE_FORM, the field ITCPO-TDGETOTF
has to be checked in the Importing parameters of OPEN_FORM.
Detailed example
Consider the following Business scenario.
If the Mail was to be sent only to the vendor then no enhancement of standard would have
been required.
During Purchase Order creation, the SAP script is called through FM ME_PRINT_PO. The
OPEN_FORM is called in the include LMEDRUCKF10.
Before the OPEN_FORM is called, in the structure ITCPO fill the field TDGETOTF = X to get
the OTF form as an importing parameter in CLOSE_FORM when External send is triggered
(NAST-NACHA = 5).
The CLOSE_FORM which was already implemented by Standard SAP is over written as the
OTF data has to be imported. The enhancement-point ENDE_02, enhancement-spot
ES_SAPLMEDRUCK is used for the same. Refer below screen shot.
The OTF file is obtained in the TABLES parameter. Refer below screen shot.
When the OTF data is imported then standard SAP does not send mail to the
partner mentioned in External Send! Thus in
this case we will have to send mail to both the Vendor and PO creator. To determine the
mail address of the vendor use the FM ADDR_GET_NEXT_COMM_TYPE. Refer below screen
shot.
The OTF file format has to be converted to PDF. There are many ways to do the same.
Below mentioned is one method. The FM CONVERT_OTF input the OTF file obtained and
import the Hexadecimal PDF file.
We can use the Class CL_BCS to send the mail to more than one recipient and the PDF is
attached in the mail. Below screen shots show a sample of filling the data for the class. We
can check if the mail has been sent from SAP using the Transaction SOST.