cancel
Showing results for 
Search instead for 
Did you mean: 

Mail Package and ContentConversion using StructXML2Plain

former_member189519
Participant
0 Kudos

Hi,

is ist possible to use "MailPackage" (i need dynamic filenames for mail-attachments) and convert the "<content>"-XML part of the mail package to a .csv using the Module "com.sap.aii.messaging.adapter.Conversion" ?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member189519
Participant
0 Kudos

Yeah, thanks for the links, i already found the XI - Mail stuff you mentionend.

BUT:

1. My sender adapter is "IDOC" so i have no "Adapter specific message properties" (blog 2664) or any "attachment" (blog 1685). Anyway, i can not find any information about the "adapter specific message properties" of the mail adapter.... so how could i change the <ContentType> (e.g. "text/plain"; name="blablubb")

2. if i use "mail package" (which does the trick for dynamic attachment names) the output format is described in note 748024 (.xsd) and then i can not use the "StructXML2Plain" transformation module (finds a tag <ns:mail> !)

Still my question:

- I have an incoming IDOC and outgoing mail with content as attachment

- i want dynamic attachment names

- i want content conversion "StructXML2Plain"

how to do?

Currently i do a graphical mapping and fill the required fields (sender, receiver, subject, contentType!). The <content>-Tag is 0-unbounded and holds the content line-by-line (csv-lines). After that i use the following xsd which maps all <content>-lines into one.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="UTF-8" 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_Type>
                <xsl:value-of select="//content_type"/>
            </Content_Type>
            <Content_Description>
                <xsl:value-of select="//content_description"/>
            </Content_Description>
            <Content><xsl:for-each select="content"><xsl:value-of select="."/><xsl:text>
</xsl:text></xsl:for-each></Content>
        </ns:Mail>
    </xsl:template>
</xsl:stylesheet>

so i can use the "mail-package" and do the .csv-conversion in graphical mapping.

Chandra_Hota
Participant
0 Kudos

Hello Bernhard,

I am in a similar situation where, in receiver mail adapter, i have multiple lines of data.

I want to send that data in a csv file as an attachment to email.

How can i do this using mail package, and StrictXml2Plain bean?

StrictXml2PlainBean is trying to parse all the fields including Subject and To fields which are part of mail package.

Please let me know how you solved this issue.

Thanks

Chandra

Former Member
0 Kudos

Hi..

As said above it is possible ..

Please see the below links ..

/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC - File to Mail

try MessageTransformBean

Transform.ContentType

http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm

also shown in my blog:

/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

/people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u

/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure

/people/rahul.nawale2/blog/2006/11/01/dynamically-sending-a-mail-to-the-po-creator-using-xslt-abap-mapping

/people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Regards

Chilla..

Former Member
0 Kudos

Hi Bernhard Josef Neuhauser ,

Yes, it is possible,

This links may help you.

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] - File to Mail

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address - Dynamic Mail Address

/people/siva.maranani/blog/2005/05/25/understanding-message-flow-in-xi - Message Flow in XI

Regards,

Ramesh.