cancel
Showing results for 
Search instead for 
Did you mean: 

Mail Attachments

Former Member
0 Kudos

Hi there,

I am new to XI and hope find good ideas from the gurus!

I need to send my Idoc as attachment to the mail adapter. I am using mail package and hence the to, from and subject are mapped from within my Idoc. I now have the problem of getting the Idoc structure into the content tag ! is there a work around ! I am using XI 7.0.

Any Ideas will be highly regarded.

thanks,

amair

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

You can use XSLT mapping like this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="*">
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject><xsl:value-of select="//subject"/></Subject>
<From><xsl:value-of select="//sender"/></From>
<To><xsl:value-of select="//receiver"/></To>
<Content><xsl:copy-of select="/"/></Content>
</ns:Mail>
</xsl:template>
</xsl:stylesheet>

Another option is not using the Mail Package, but populating the adapter header fields for setting from, to and subject.

http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

I have already a complex Graphical mapping with which I derive the To, From, Subject from the IDOC. Now I need the whole Idoc into the content node. I need this as we need to send the IDOC XML as attachement.

regards,

Zubair

Message was edited by: Amair

MichalKrawczyk
Active Contributor
0 Kudos

hi,

have a look at this weblog:

/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword

Regards,

michal

Former Member
0 Kudos

Hallo Michal,

I am trying the weblog for my problem but it does not somehow do what it is supposed to !

/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping - XML node into a string with graphical mapping

here is my situation in detail.

source:

<some idoc>

<..>

..

</some idoc>

Target (TO BE)

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

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

<From> this is from complex graphical mapping</From>

<Content_Type>text/xml;name="file.xml"</Content_Type>

<Content_Disposition>attachment;name="SYSTAT01.XML"

</Content_Disposition>

<Content>here is where I need the IDOC</Content>

</ns0:Mail>

I have already a graphical mapping in place and dont want to disturb it, can I some how get the source message in the content tag. I am not a XSL guru but is it possible to get the results with multiple mappings.

Thanks,

Amair

former_member206604
Active Contributor
0 Kudos

Hi,

I would suggest you to go with XSL mapping, and XSLT is very simple and easy to do

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>Subject</Subject>
<From>from@email.com</From>
<To>to@email.com</To>
<Content_Type>text/xml</Content_Type>
<Content>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[

]]
>



]]>

Just save this as .XSL and zip it. Import it under Imported Archive and use it in Interface mapping.

You need to change from and to ids in the XSL.

Thanks,

Prakash