cancel
Showing results for 
Search instead for 
Did you mean: 

posting excel attachment in mail receiver adapter

0 Kudos

Hi,

I got a new requirement where I need to take the RFC as input  and send the content in an excel attachment in mail receiver adapter.

What are all the inputs to acheive this task       (or)     do we need to write XSLT or JAVA coding for this ?

If Yes, please help me with the code.

My RFC structure as shown below :



Regards,

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

1. Surely, you have to use payloadSwapBean to swap the main payload as an attachment.

2. Use below blogs to convert xml to excel.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/09/16/convert-incoming-xml-to-excel-or-...

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/09/16/convert-incoming-xml-to-excel-she...

So in short you convert the xml to excel and swap and pass it as excel.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Vishal,

The two blogs will only produce one payload. You can modify the Java Mapping to:

1. Create the mail body

2. Use the mail body as an attachment (Use OutputAttachments interface)

http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/OutputAttachments.html

You can now use the PayloadSwapBean to swap the Excel file and the mail body.

Hope this helps,

Mark

0 Kudos

As mentioned I have created the (in XSLT) code with slight changes with the one that you have given.

Now I am getting below error.

TransformerConfigurationException triggered while loading XSLT mapping

please help me with this.

regards,

Former Member
0 Kudos

try to refresh the mapping cache and the XSLT map would load.

Bhargavakrishna
Active Contributor
0 Kudos

Hi Praveen,

As said by Vishal, do the complete cache refresh, it should work..

Select XMLTOOLKIT option in operation mapping,and execute your XSLT Mapping.

go through below link

http://scn.sap.com/people/sylvia.xiong/blog/2010/03/09/hints-about-pi-runtime-cache-refresh

Regards

Bhargava krishna

0 Kudos

Yes, after clearing the cache now we are getting this strange error.

Message processing failed. Cause:
com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null
"null"]; nested exception caused by:
com.sap.aii.af.sdk.xi.util.XMLScanException: expecting start tag:
{http://sap.com/xi/XI/Mail/30}Mail, but found
{urn:schemas-microsoft-com:office:spreadsheet}Workbook at state 1

I am using the external definition ( for mail receiver according to sap standard) receiver structure .

regards,

Former Member
0 Kudos

this is predominantly a connectivity issue.

have you basis team check if your PI server is able to ping the mail server.

You might have to open some ports to have this connection established