cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Mail Adapter content conversion

Former Member
0 Kudos

Hi

I have read a lot of forums, etc and changed much on my adapter, but still get a xml file send as an attachment instead of a text file.

Can anyone please advise on how to change the receiver adapter to covert from xml to text.

I have added the module processing sequence like follow - please help.

Processing sequence

localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean XML2Plain

sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean Mail

Module configuration

XML2Plain Details.endSeparator 'nl'

XML2Plain Details.fieldName ZINDUS,TCODE,TDATE,RDATE

XML2Plain Details.fieldSeparator |

XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion xml/txt

XML2Plain Transform.ContentDisposition attachment;filename="TEBA.txt"

XML2Plain Transform.ContentType xml/plain

XML2Plain xTransform.recordsetStructure Details

Thanks

Clinton

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Set your parameters according to this guide:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bf...

In the title is mentioned "JMS adapter" but the conversion workes in mail adapter as well.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan

Thanks for the document it worked!!! I will give you your points in a minute.

Just one last question; can I add a timestamp to my attached file name?

Thanks

Clinton

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

From the mail adapter FAQ,

<i>How can I set the file name of a mail attachment?

There are several MIME headers that play a role in how the client retrieves the file name of an attachment. Unfortunately, this behavior differs among various mail clients. The reason for this inconsistent behavior comes from the fact that this mechanism has been extended incrementally. The old way is to use the name parameter in the Content-Type header as specified in RFC1341. For example, you can set the content type of an XML attachment as:

Content-Type: application/xml; name="abc.xml"

RFC1521 discourages the use of this name parameter in anticipation of the new header Content-Disposition, which is defined in RFC1806.

With this Content-Disposition header, you can set the file name as:

Content-Disposition: attachment; filename="abc.xml"

Some clients may show the Content-Description value as the file name. The Content-Description header is typically used to associate some descriptive information to an attachment (RFC1341) as in

Content-Description: my xml file

To avoid potential interpretation problems, it is recommended to combine the use of these headers.</i>

Also, the note 779981 describes how to set Content Type in the mapping program. Am not sure, but combining the two, maybe it should be possible! Havent tried something of this sort though!

Regards

Bhavesh

former_member203764
Participant
0 Kudos

the link failed. could you update it?

thanks!

Sara

Answers (2)

Answers (2)

Former Member
0 Kudos

Clinton,

Check this weblog:

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

Check this it may help you:

/people/community.user/blog/2006/09/07/email-reporting

/people/sap.user72/blog/2005/06/08/sending-attachments-in-mails

---Satish

MichalKrawczyk
Active Contributor
0 Kudos

hi,

did you check my blog in which I described both ways

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

Regards,

michal

Former Member
0 Kudos

Hi Michal

Thanks for your reply

Still having the probelm, can you guide me some more.

Thanks

Clinton

Former Member
0 Kudos

Hi clinton

post an xml for example

Former Member
0 Kudos

Hi Shai

Here is a example of my xml in the attachment file.

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

<ns0:MT_SAP_Contractor_Details xmlns:ns0="http://lonmin.co.za/SAP_to_TEBA"><Details><ZINDUS></ZINDUS><TCODE>6002</TCODE><TDATE>20070111</TDATE><RDATE>00000000</RDATE></Details></ns0:MT_SAP_Contractor_Details>

Thanks

Clinton

bhavesh_kantilal
Active Contributor
0 Kudos

Clinton,

Did you have a look at the doucment posted by Stefan? It should do the trick. It also has an example as to how to use the content conversion on the receiver adapter. Refering to the example should certainly help.

Regards

Bhavesh