cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic attachment name with receiver mail adapter and use mail package

krishg
Active Participant
0 Kudos

We need to send mapped XML payload as attachment (with dynamic name) to a recepient (recepient email id is part of input xml payload, but not part of the mapped XML payload).

I could probably do this using the adapter module (as per the following link),

http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=tru...

I would like to explore if this would be feasible using Mail package and XI payload.I already have a Java mapping that is converting the input XML to required Output format. If I am using Mail package (XI Payload), how do I go about sending this Output XML from java mapping as attachment to email id available in the input payload?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1) XML payload as attachment (with dynamic name)

2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)

These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.

The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.

 
<?xml version="1.0"; encoding="UTF-8"?> 
<p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30"> 
<Subject>My Invoice</Subject> 
<From>from email address<;/From> 
<To>to email address</To> 
<Content_Type>text/plain;name="MyFile.csv";</Content_Type>  --> file name here 
<Content>123;A49;aaa</Content>   -> attachment xml here
</p2:Mail> 

And you have to select MailPackage in the receiver mail adapter.

Regards,

Aravind

krishg
Active Participant
0 Kudos

Thank you, Aravind... I am modifying an existing java mapping and not very familiar with it. My question, Is it possible to do this with in the Same java mapping?

Former Member
0 Kudos

Hi,

Yes, you can use the existing java mapping as it is.

The xml out put of the java mapping should be put into the <content> tag of the mail package xml schema.

and in <Content_Type> tag -> xml;name = "fyour file name.xml"

regards,

Aravind

Answers (0)