Skip to Content
Technical Articles
Author's profile photo Ravi D

Email Output to Multiple Recipients Functionality in SAP

Introduction:

In most of the industries it is common practice to send the copy of Delivery Note along with the Goods and also a Copy to the Customer’s Mail ID prior the Goods are received. This email copy will help the customer to be prepared in allocating the Warehouse Space for the Goods that are expected and also to arrange for the Funds to make payment, in case of Payment against Delivery terms.

 

We have a possibility in Standard SAP for sending the Delivery Output automatically to the mail ID maintained in the Customer Master. However, this is restricted only to one mail ID and will not allow you to send to more than one mail ID. As now-a-days, it is required to send the communication of any official information like Delivery Output to more than one mail ID in Customer side (“TO” and “CC” Address mail Format), as each person may have to follow up different activities of Delivery.  Fortunately there was a similar requirement from our client and the same has been achieved using Techno – Functional enhancements.

Requirement:

  • Delivery Output must be sent automatically to multiple recipients in PDF Format when Delivery Document is Created – T. Code “VL01N”.
  • Repeat Delivery Output must be triggered only if there are changes to certain specific fields in the Delivery Document – T. Code “VL02N”.
  • Must fetch email IDs in “TO” address and “CC” address format while sending the Email Delivery Output automatically.

Standard SAP Functionality for Sending Email Output:Even though we have the possibility of maintaining more than one Mail ID in Customer Master of Sold to Party, Standard SAP will allow you to send the Email Delivery or Order Output automatically only to one Mail ID, for which the Radio Button is enabled as shown in the Screenshot:

Transaction Code – XD02:

 

image

image

 

In the above Screenshot, you can see that more than one Mail ID has been maintained for this customer however the Standard SAP functionality is restricted to send auto email output only to the mail ID for which the Radio button is enabled / checked. No mail will be sent to the other 2 Mail IDs maintained in the Customer Master, as the Radio Button is not enabled for these 2 IDs.

 

Hence, if we need to send the Email Delivery Output to viswa@infosys.com in “TO” address and the other 2 mail IDs in “CC” address of the email, we need to do appropriate Configuration and technical changes to achieve the above requirements.

Let us see the Functional and Technical requirements to achieve this functionality.

 

 

 

Functional Configuration Settings:

For this requirement, it is better to create a new Delivery Output Type for sending Email Delivery Output to multiple Recipients (Mail IDs). This new Delivery Output Type can be used exclusively for this particular Functionality with Transmission Medium as “External Send”.

Define Delivery Output Type

The new Delivery Output Type can be defined from the below menu path:

IMG – Logical Execution – Shipping – Basic Shipping Functions – Output Control Output Determination Maintain Output Determination for Outbound Deliveries Maintain Output Type:

 

image

 

 

For example, we have maintained New Delivery Output Type “ZSPM” with appropriate Access Sequence “ZSPL” with required Fields.

Also enabled “Multiple Issuing” field for this Output Type, as the requirement is to repeat sending the Delivery Output vide email if there is Changes made to the specific fields in the Delivery Documents. However, no need to select this “Multiple Issuing” field if no such requirement.

 

image

 

Dispatch Time: You can maintain the value of this field depending upon the requirement. In the above screenshot, we have maintained “Send Immediately (when saving the application)” which will trigger the Output Type immediately upon saving the Delivery Document.

 

Transmission Medium: It is the Message Output Medium specifies how the output has to be produced like Fax, EDI, email, etc.

 

image

 

Assign the appropriate Driver Program and Smartform with the Delivery Output Type as shown in the above screenshot.

 

Then complete the Condition Technique procedure by assigning the New Delivery Output Type with the appropriate Output Determination Procedure and assign the Output Determination Procedure with the Delivery Type.

 

 

Define Access Sequence:

IMG Logical Execution Shipping Basic Shipping Functions Output Control Output Determination Maintain Output Determination for Outbound Deliveries Maintain Access Sequence

 

image

 

 

The Access Sequence can be defined through the above shown Menu path and can be assigned with the required Condition Tables.

 

For Ex: Here, We have defined the access sequence ZSPL with Condition Table “721” with Key Combination of Shipping type/Shipping Point/Delivery Type.

 

image

 

 

Assign Access Sequence with the Delivery Output Type:

IMG Logical Execution Shipping Basic Shipping Functions Output Control Output Determination Maintain Output Determination for Outbound Deliveries Maintain Output Types

 

The Access Sequence ‘ZSPL’ has been assigned with the Email Delivery Output type ‘ZSPM’ as shown below.

 

image

 

 

Define and Assign Output Determination Procedure with the Delivery Output Type:

 

IMG Logical Execution Shipping Basic Shipping Functions Output Control Output Determination Maintain Output Determination for Outbound Deliveries Maintain Output Determination Procedure

 

Assign the Email Delivery Output type ZSPM with the Output Determination Procedure ‘Z10000’ with the requirement as per business needs.

 

Here we have assigned Requirement as ‘3’ for this output type which will restrict triggering output if there is any Credit Block for the document.

 

 

image

 

 

 

Assign Output Determination Procedure with the Delivery Type:

IMG Logical Execution Shipping Basic Shipping Functions Output Control Output Determination Maintain Output Determination for Outbound Deliveries Assign Output Determination Procedure

 

Assign the output determination procedure with all the Delivery types as per requirement. For instance, we have shown the screenshot of the Assignment of Output Determination Procedure “Z10000” with the Delivery Type “ZLF”:

 

 

image

 

 

 

 

 

Define New Communication Strategy:

IMG Logical Execution Shipping Basic Shipping Functions Output Control Determine Communication Strategy

 

 

image

 

 

Communication Strategy is used to find the Communication Methods for transmitting the communication data to the customer / partner. This communication strategy will be proposed while creating the condition record for the Output Type with transmission medium as “External Send”.

 

 

image

 

 

For example, we have created a new Communication Strategy “ZSBD” with communication method “INT” – Email and this Communication Strategy has to be assigned while maintaining Condition Records for the Delivery Output Type “ZSPM”.

 

 

 

 

Technical Requirements:

In order to send Smart form Output as PDF attachment to more than one Mail ids (TO and CC format) automatically upon saving the Delivery Document, appropriate changes has to be made to Driver Program ‘ZRLE_DELNOTE’ which is assigned to the Delivery Output Type “ZSPM” used for this purpose.

 

 

Driver Program Modifications:

 

Reason for the Change: Since Standard SAP allows sending mail only to one Mail id for which radio button is enabled in Customer Master, we have to do the following technical changes to pick all the mail IDs from customer master for sending Delivery Output automatically via email.Hence following modifications were made to the Driver Program “ZRLE_DELNOTE” which is assigned to the Email Delivery Output Type “ZSPM”:

 

 

Technical Overview:

 

  • Get all the Mail Ids present in ADR6 table for KNA1-ADRNR = ADR6-ADDRNUMBER.
  • The Mail ID with field value as “X” for field ‘FLGDEFAULT’ in the customer master will reflect in ‘TO’ address and the remaining Mail ids in ‘CC’ address of the Delivery Output mail.
  • Call the Smart form with CONTROL_PARAMETERS-GETOTF as ‘X’ (Remaining other Export Parameters are similar to RLE_DELNOTE program’s smart form call) and Import the following structures ‘DOCUMENT_OUPTUT_INFO’, ‘JOB_OUTPUT_INFO’ and ‘JOB_OUPTUT_OPTIONS’.
  • Convert internal table JOB_OUTPUT_INFO-OTF[] to PDF by calling FM ‘CONVERT_OTF_2_PDF’.
  • After converting to PDF, use ‘SO_NEW_DOCUMENT_ATT_SEND_API1’ and send mails in TO and CC Format.

 

Source Code Extract details will be shared upon requests.

 

 

 

 

Functional Requirements:

Condition Record Maintainence for Delivery Output Type “ZSPM”:

 

Go to Transaction Code – VV21

 

Maintain Condition Record for Delivery Output Type “ZSPM” as per your key combination requirement. Here, the Record is maintained based on Shipping Type / Shipping Point and Delivery Type.

 

image

 

Select the “Communication” button to assign the “Communication Strategy” – “ZSBD”

 

image

 

Now save the Condition Records maintained.

 

 

Maintain Email ID in Ztable for Customers:

Go to Transaction Code “ZES_MAIL_IDS”

 

image

 

 

The above screenshot shows the Ztable, where you can Display / Create / Change / Delete the Customer Mail ID by just enabling the appropriate Radio button.

Here, you can see that we have already maintained Email IDs for Customer ‘7600005’:

 

 

image

 

 

In the above screenshot, there is a box in the ‘To Address’ field which is enabled for VISWA@INFOSYS.COM. This ‘To Address’ has to be enabled for the respective mail IDs which you want to display in “TO ADDRESS” in the Delivery Output Email.

 

 

 

 

Functionality Testing:

Scenario 1 – During Creation of Delivery Document thro Transaction Code – VL01N:

 

Enter the Sales Order Number for which the Delivery has to be created:

 

image

 

image

 

 

In main Menu, go to “Extras” à Delivery Output à Header to ensure that our Email Output type “ZSPM” is triggered:

 

image

 

The below screenshot ensures that the Email Output type “ZSPM” is triggered to process sending Delivery Output email to multiple recipients maintained in the Customer Master:

 

image

 

Now save the Delivery to ensure that the Email Output Type “ZSPM” has sent out the Delivery Output via Email to the recipients maintained in the Customer Master in “TO” and “CC” format as explained above:

 

image

 

You can find below the screenshot, where the Delivery Output PDF attachment has been sent to “Viswanathan Thirugnanam” in “TO” address and “Balaji” / “Ravikumar” in “CC” address format:

 

image

 

Screenshot of Delivery Output received through Email in PDF Format:

 

image

 

 

 

 

Scenario 2: Triggering Repeat Delivery Output only for Conditional Field Changes in Delivery Document Change Mode:

 

Let us take the Conditional Field as “Change in Ship to Party Address” in the change mode of Delivery Document through Transaction “VL02N”. So whenever there is a change in the SHIP TO PARTY address in Delivery Document, then the Delivery Output must be triggered and processes after saving the Delivery Document. This ensures that NO Output will be triggered for any changes in the Delivery Document other than SHIP TO PARTY address changes.

 

Go to Change mode of Delivery Document – T. Code “VL02N“:

 

 

image

 

 

Go to Header Details à Partners Tab to change the Postal Code from “08204” to “59574”. The Postal Code change for SHIP TO PARTY has been shown clearly in the below two successive screenshots:

 

 

image

 

image

 

Now save the Delivery Document to ensure that the Email Delivery Output Type “ZSPM” is triggered again due to SHIP TO PARTY address changes in the Delivery Document change mode.

 

image

 

 

Go to T. Code “VL02N” – In main Menu; go to “Extras” à Delivery Output à Header’ to ensure that our Email Output type is triggered again due to the changes made to SHIP TO PARTY address:

 

 

The below screenshot ensures that the Email Delivery Output type “ZSPM” is triggered again due to the SHIP TO PARTY address change in Delivery change mode:

 

image

 

 

You can find below the screenshot, where the Delivery Output PDF attachment has to been sent to “Viswanathan Thirugnanam” in “TO” address and “Balaji” / “Ravikumar” in “CC” address format in email:

 

image

 

Delivery Output received through Email in PDF Format:

 

image

 

 

Advantages of Conditional Repeat Output: 

 

 

  • Repeat Delivery Output will be triggered and processed only if there are any changes made to the specific required fields in the Delivery Document.

 

  • Restricts the Email Output Type trigger and processing for the changes made to the fields other than the specific fields, which are filtered using Technical functionality.

 

  • Only sends the email with Delivery Output attachment to the customer, if there are any changes to the important fields like Quantity / Ship to Party Address / Deletion of Line Item / Addition of Line Item in the Delivery Document Change Mode.

 

  • Conditional Fields can be selected as per Business Requirement.

Assigned tags

      32 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      This blog offers solution for a real time scenario. Please continue posting useful blogs like this.

      Thanks,
      Vijay

      Author's profile photo Former Member
      Former Member
      I have a similar scenario, can you please maill the source code of print program ZRLE_DELNOTE to
      vasu_hyd@yahoo.co.uk
      Author's profile photo Former Member
      Former Member
      This really Excellent Option, it helped me a lot for my client

      Thanks for sharing such a nice blog with All

      Author's profile photo Former Member
      Former Member
      As you mentioned in the block, Standard *API1* Function module to send mail. where you have added the code, is it in Drive program or separate program

      Let us know, will it update the NAST table with respective output type and recipient mail id's.

      It would be better, if you share your ABAP code with all.

      Author's profile photo Former Member
      Former Member
      Can you send me or publish the code also. Need a similar process for sending purchase orders to vendors.
      Author's profile photo Former Member
      Former Member
      Hello Jan,

            Can you please help me to code for 'Email Output to Multiple Recipients Functionality in SAP'. I have the same requirement as yours.

             I want to send the PDF copy of Purchase order to multiple receipents, please help me out

      Thanks !!!

      Author's profile photo Former Member
      Former Member
      Hi,

              I am 7 months old in SAP ABAP. My client wants us to send the PDF copy of PO to the supplier via email as well as to himself. So please share me the code in detail.

      Thanks

      Author's profile photo Former Member
      Former Member
      Hello

      First, thank you for that detail Blog. It is helping to undestand the output mecanisum.

      Is that technic can be applied to send multiple emails for Purchase Orders?

      Can we send purchase orders to several persons by email?

      Can you publish the print proggram code?

      Author's profile photo feng yaowu
      feng yaowu
      Thanks your share!

      I am making the  same function as purchase order. Could you share your detail about program ZREL_DELNOTE. thank a lot!

      best regards!

      Author's profile photo Former Member
      Former Member
      Can the same logic be applied on SAPscripts ?
      Author's profile photo Former Member
      Former Member
      Please can u send me the code ?

      Thanks in advance

      Author's profile photo Madhu Vadlamani
      Madhu Vadlamani
      It is very good example . Can you share that code with me . I am planning sales order to multiple recipients .

      Regards,
      Madhu

      Author's profile photo Former Member
      Former Member
      I would highly appreciate if you can share that code with me.

      Regards,
      Daniel

      Author's profile photo Former Member
      Former Member
      Looking in detail the bolg, I have one question.

      Based on my understanding of the "Technical Overview" section, the emails are sent from the print program using the "SO_NEW_DOCUMENT_ATT_SEND_API1" function and not by the SAP standard output medium.

      Did I understood properly?

      Can you send me the Print program code please? We have a requirement to perform that email to multiple recipient to 15 outputs.
      "Delivery, PO, Invoice, etc.."

      Thank you

      Author's profile photo Former Member
      Former Member
      Dear Mr Ravikumar,

      I would be very interested to receive the source code which makes it possible to implement the solution to send documents to mulitple email receipients.

      Many thanks in advance.

      Author's profile photo Former Member
      Former Member
      Hi Ravi,

      Please send the driver program source code it would be very helpful for me.

      regards,
      kiran

      Author's profile photo Former Member
      Former Member

      I have code to handle this problem from the Invoice side using Smartforms (an Implicit Enhancement)  I'd be glad to share with anyone interested.  Has anyone done this with PO or anything SAPScript?

      Neal

      Author's profile photo Madhu Vadlamani
      Madhu Vadlamani

      Hi Neal,

      Nice to see here.To send for multiple recipients i copied the po driver program and places my code in that which is sending mail to and cc address .

      Regards,

      Madhu.

      Author's profile photo Former Member
      Former Member

      I guess I was hoping to find a point to put in an implicit enhancement, so that this could be consumed through the standard NAST functionality...

      Author's profile photo Madhu Vadlamani
      Madhu Vadlamani

      Hi Neal,

      That is fine.Can you please share how you did with implicit enhancement for the imvoice.

      Regards,

      Madhu.    

      Author's profile photo Former Member
      Former Member

      I will post a document in SCN soon.  Then I'll come beck here and "comment" a reference to the post.  If you don't hear from me soon (within a week) feel free to harass me at wilhiten@aol.com.

      Author's profile photo Former Member
      Former Member
      Author's profile photo Maheshkumar gattu
      Maheshkumar gattu

      Please let me know which filed i need to add if the email i want to put in to CC instead of send to TO address.

      I guess it must be some where in RECEIVER table of  SOOS1.

      Thanks,

      Mahesh Gattu

      Author's profile photo Maheshkumar gattu
      Maheshkumar gattu

      I guess i have to pass SNDCP = 'X'. to send as cc

      SNDCP Types SO_SND_CP CHAR 1 0 Send: As copy
      Author's profile photo Lakshmi Sama
      Lakshmi Sama

      Hi Ravi,

      Thanks for sharing such a good document. Keep sharing your knowledge.

      Regards,

      Lakshmi S

      Author's profile photo Marius Reck
      Marius Reck

      Thanks a lot for all the input!

      Author's profile photo Former Member
      Former Member

      Hi Ravi,

      Many thanks for your document. It helped me to solve my problem.

      kr

      Thomas

      Author's profile photo Robert Forster
      Robert Forster

      Hi Ravi,

      nice document.

      In the meantime there is SAP improvement note 2153962 available providing similar functionality.

      If you use Z print program you have in addition to copy the improvement to your z-program.

      The z-transaction for email address you can also maintain as an exchange server distribution list.

      BR

      Robert

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Thanks for an update. Wow, took them only 20 years to realize this is a badly needed functionality. 🙂 Oh well, better late then never. The other sad part - it's only available through SP starting from EHP6, not through SNOTE.

      Author's profile photo FERNANDO AVILA
      FERNANDO AVILA

      Hi Ravi

      I have a similar scenario, can you please maill the source code of print program ZRLE_DELNOTE to
      fernando.avila@disan.com.co

      Regards,

      Fernando

      Author's profile photo Abhijit Panhale
      Abhijit Panhale

      I also have a similar scenario, can you please maill the source code of program ZRLE_DELNOTE to apnhale@gmail.com

      Author's profile photo Kashif Abbasi
      Kashif Abbasi

      Hi Ravi,

      I know this document is kind of old, but I have a similar requirement. This a very informative blog. Can you please share me the codes, if you still have with you, at my email id kasifabbasi1010@gmail.com. I will remain tanksful.

      kashif