Skip to Content

In this Blog(My first Blog 🙂 ) I will explain how to send mail with the content of the file getting displayed in the row column format. Even though there are some Blogs speaking about sending mail, the Blog eMail Reporting  (eMail Reporting) by Prakash Arunachalam explains of sending the mail with the data getting displayed in the row column format using XSLT mapping. However in this Blog I will exercise the same scenario using a User Defined Function.

Requirement:

In a landscape where XI integrating MDM and R3, the requirement is to send the materials that are created in the MDM in a mail to the Data Administrator who has to approve or reject the material. Sending mail can be done with the use of MDM workflow, however it will flood the inbox with these mails!https://weblogs.sdn.sap.com/weblogs/images/251780423/outlook1.jpeg|height=1|alt=|width=1|src=https://weblogs.sdn.sap.com/weblogs/images/251780423/outlook1.jpeg|border=0! being sent for each and every material created. The other best solution for this is MDM will send a file every one-hour with the material details and XI has to send mails with those material details and the URL of the portal page to approve/reject. Even the same requirement can be from R3 where it sends the list of purchase order created in an IDoc, which should be sent as a mail.  Let us start creating the scenario. 

1. Import the XSD of the source structure and the Mail in the external definition.

You can download the mail structure from the following link

https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt

2. Create Message Interface for the Source and the Mail.

3. Map the product details to the Mail XSD as shown.

The above mapping enables to dynamically send mails as shown in the Blog

The specified item was not found.

by Michal Krawczyk.Source.XML</p><p><textarea cols=”100″><?xml version=”1.0″ encoding=”UTF-8″?>

<ProductDetails>

   <Product>

      <MDMID>53</MDMID>

      <JobID>21</JobID>

      <ToEmail>santhosh.vellingiri@wipro.com</ToEmail>

      <CCEmail/>

      <MATNR>12345</MATNR>

      <Description>ABC</Description>

      <MTART>bcd</MTART>

      <FORMID>001</FORMID>

      <RejectionReason/>

      <WF_Status>Pending For Approval</WF_Status>

   </Product>

   <Product>

      <MDMID>54</MDMID>

      <JobID>21</JobID>

      <ToEmail>santhosh.vellingiri@wipro.com</ToEmail>

      <CCEmail/>

      <MATNR>12345</MATNR>

      <Description>ABC</Description>

      <MTART>bcd</MTART>

      <FORMID>001</FORMID>

      <RejectionReason/>

      <WF_Status>Pending For Approval</WF_Status>

   </Product>

   <Product>

      <MDMID>55</MDMID>

      <JobID>21</JobID>

      <ToEmail>santhosh.vellingiri@wipro.com</ToEmail>

      <CCEmail/>

      <MATNR>12345</MATNR>

      <Description>ABC</Description>

      <MTART>bcd</MTART>

      <FORMID>001</FORMID>

      <RejectionReason/>

      <WF_Status>Pending For Approval</WF_Status>

   </Product>

   <Product>

      <MDMID>56</MDMID>

      <JobID>21</JobID>

      <ToEmail>santhosh.vellingiri@wipro.com</ToEmail>

      <CCEmail/>

      <MATNR>12345</MATNR>

      <Description>ABC</Description>

      <MTART>bcd</MTART>

      <FORMID>001</FORMID>

      <RejectionReason/>

      <WF_Status>Pending For Approval</WF_Status>

   </Product>

   <Product>

      <MDMID>57</MDMID>

      <JobID>21</JobID>

      <ToEmail>santhosh.vellingiri@wipro.com</ToEmail>

      <CCEmail/>

      <MATNR>12345</MATNR>

      <Description>ABC</Description>

      <MTART>bcd</MTART>

      <FORMID>001</FORMID>

      <RejectionReason/>

      <WF_Status>Pending For Approval</WF_Status>

   </Product>

</ProductDetails></textarea></p><p>Output Mail 

!https://weblogs.sdn.sap.com/weblogs/images/251780423/outlook2.jpeg|height=395|alt=|width=506|src=https://weblogs.sdn.sap.com/weblogs/images/251780423/outlook2.jpeg|border=0!</body>

To report this post you need to login first.

1 Comment

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

  1. Giuseppe Sinatra
    Hello Santhosh,

    I build your scenario to customize the mail’s content.
    Just a question for you.
    Is it possible to write BOLD strings as well via UDF?
    I tried with \b but it is translate as “#”

    Let me know.
    Thank a lot in advance,
    Giuseppe

    (0) 

Leave a Reply