cancel
Showing results for 
Search instead for 
Did you mean: 

Requirement for iDoc to Mail Package

Former Member
0 Kudos

Hi All,

Can somebody please help in iDoc to Mail Package interface.

I have a requirement in which I need to attach the iDoc structure to the Content of Email Package

I need to take the iDoc structure with the values from the source side(for e.g ORDERS05 structure with all the values) and add it to the content of the Mail Package on the target side. The reason for this requirement is that I need to dynamically generate the Attachment name i.e. pick-up the values from the iDoc and then concat it with the hard-code wording

e.g CofA_<DOCNUM> <SNDPRT><RCVPRT>.xml and also the email address, subject and To is coming from iDoc field.

I haven't find any blog regarding iDoc to Email Package.

Thanks,

Iqbal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think you would be able to do this by a java mapping or a udf. check this blogs,

/people/samuel.chandrasekaran2/blog/2008/10/06/xi-mail-adapter-dynamically-building-attachment-and-message-body-content-using-a-simple-udf

/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping

Regards,

Francis

former_member611181
Participant
0 Kudos

I would convert IDOC to xml format using XML port and place in file folder. And using one of above blogs send this xml as attachment thru email.

Former Member
0 Kudos

HI Francis Antony,

Thanks for sending me the blog.

Can you please help me in my requirement.

I have a requirement in which I have to do the following

Requirement

The file name of the XML is CofA_<Serial Number>_<Material desc>.xml

both the Serial Number and Material description are coming from iDoc.

SERIAL_NUMBER = QALITY02/IDOC/E1EDLIN/E1CCI01/E1MEA01/SERIAL_NUMBER

Material Desc = QALITY02/IDOC/E1EDLIN/E1CCI01/E1MEA01/TEXT

iDoc also contains

Email Subject : Currently under development

Email Body: Currently under development

and also I need to attached the iDoc Structure as it is and send it as an attachment to the email which is also present in the iDoc.

I wrote one XSLT Code which select the entire iDoc Structure and send it as an attachment but I need to select the email subject, body from the iDoc which I don't know how to pick up and also not sure if it is possible to display the email body along with the attachment through XSLT.

XSLT Code

<?xml version="1.0" encoding="UTF-8"?>

<ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform">

<ns0:template match="*">

<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<Subject>Need to pick up from iDoc</Subject>

<From>abc</From>

<To>Need to pick up from iDoc</To>

<Content_Type>application/xml;name="CofA_<Serial Number (Need to pick up from iDoc)>_<Material Desc(Need to pick up from iDoc).xml"</Content_Type>

<Content_Disposition>attachment;filename="CofA_<Serial Number (Need to pick up from iDoc)>_<Material Desc(Need to pick up from iDoc).xml"</Content_Disposition>

<Content>

Need to pick up from iDoc

<ns0:copy-of select="/"/>

</Content>

</ns1:Mail>

</ns0:template>

</ns0:stylesheet>

This code will select the entire structure and email it to the fixed address as an attachment but not displaying the Email body.

Can you please help me in solving this issue.

Thanks,

Answers (1)

Answers (1)

Former Member
0 Kudos