Skip to Content

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.
To report this post you need to login first.

29 Comments

You must be Logged on to comment or reply to a post.

  1. Sri harsha medisetty
    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.

    (0) 
    1. reshma b
      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 !!!

      (0) 
  2. reshma b
    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

    (0) 
  3. Daniel St-Jacques
    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?

    (0) 
  4. 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!

    (0) 
    1. Daniel St-Jacques
      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

      (0) 
  5. M. Schotanus
    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.

    (0) 
  6. Neal Wilhite

    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

    (0) 
    1. 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.

      (0) 
      1. Neal Wilhite

        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…

        (0) 
              1. 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

                (0) 
  7. 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

    (0) 
    1. 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.

      (0) 

Leave a Reply