cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Mail Adapter Attachment

Former Member
0 Kudos

Hi All

The mail I get from the 3rd party has a body and attachment. I have done the TRANSORM module as described in some of the forums, and then the Plain2XML.

On sxmb_moni I see the MailMessage and MailAttachment-1, where the MailMessage is in XML format and MailAttachment in normal text. What should I do to completely ignore the MailMessage(body of the mail) and just send MailAttachment to the receiver.

I have tried to split the message to two receivers, but because the attachment message does not transform to xml, it gives me a mapping error. Is there anyway I can either ignore the body and just send the attachment to the receiver without doing JAVA code.

Thanks in advance

Clinton

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

No luck yet.

The payloads in sxmb_moni shows: MailMessage ( text/xml;charset=utf-8)

MailAttachment-1 ( application/octet-stream;name="ENG_45_200701261200.txt)

Any other ideas that might help.

Thanks for you help

Clinton

Former Member
0 Kudos

Hi,

Try using the following Modules before CallSAPAdapter Bean in Sender Mail channel.

localejbs/AF_Modules/PayloadSwapBean TRANSFORM

localejbs/AF_Modules/MessageTransformBean Plain2XML

TRANSFORM swap.keyName payload-name

TRANSFORM swap.keyValue MailAttachment-1

Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion

Plain2XML Transform.ContentType text/xml;charset=utf-8

Plain2XML xml.conversionType SimplePlain2XML

Plain2XML xml.documentName MT_TEBA_Contractor_Details

Plain2XML xml.documentNamespace http://lonmin.co.za/TEBA_to_SAP

Plain2XML xml.fieldNames ENG_TYPE,INDUST_NO,COMPANY_NUMBER,SURNAME,INITIALS,NAME,REGISTERED,MALE,EXPERIENCE,RACE,MARITAL,DEPENDENTS,BIRTH_DATE,LANGUAGE,EDUCATION,SPOUSE,RELIGION,OFFICE,SERIAL_NO,REG_YEAR,SERV_START,SERV_EXPIRE,SERV_PER,LAST_CHANGE_DATE,LAST_CHNAGE_TIME,ID_DOC,ID_EFF_DATE,ID_EXP_DATE,PASSPORT,PASS_EFF_DATE,PASS_EXP_DATE,COUNTRY,DISTRICT,ADDR1,ADDR2,ADDR3,POSTCODE,PHONE,BI_1733_NO,REASON

Plain2XML xml.fieldSeparator |

Plain2XML xml.processFieldNames fromConfiguration

Plain2XML xml.structureTitle Details

Also Check the Audit log of the Message in RWB Message Monitoring->Adapter Engine.

This will give insight in to execution of the Modules.

Regards,

Sudharshan

Message was edited by:

Sudharshan Aravamudan

Former Member
0 Kudos

Hi Clinton -

Where is the issue? Is the swap not occuring and is the attachment not converted to XML?

Can you paste the contents of the text file attachment here and, if possible, forward me the e-mail with the attachment (jin.sdn@sap.com). I'll test it on my system.

Regards,

Jin

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Clinton

If you change this

TRANSFORM swap.keyValue attachment;filename="MailAttachment-1.xml"

to

TRANSFORM swap.keyValue attachment;filename="MailAttachment-1.bin"

it should work.

You see your attachment is not an xml but a plain text file and the filename will be

MailAttachment-1.bin. if you loook for your message in -

http://host:port/MessagingSystem/monitor/monitor.jsp for your message(use message bytes) you will find the exact name of the attachment in the

"Content-Disposition" parameter.

Hope this helps.

Salil

Former Member
0 Kudos

Hi Clinton -

One option here is to swap the payloads (using PayloadSwapBean) of your mail message with your mail attachment. Do this first and then use the MessageTransformBean. This is all in your sender mail adapter module configuration.

This way, you can get the attachment into an XML format, map it to your target RFC-XML, and deliver it via RFC channel.

Regards,

Jin

Former Member
0 Kudos

Hi Jin

Thanks for your answer.

This is how I am using the module within the Sender Mail Adapter.

localejbs/AF_Modules/PayloadSwapBean TRANSFORM

localejbs/AF_Modules/MessageTransformBean Plain2XML

TRANSFORM swap.keyName Content-Description

TRANSFORM swap.keyName Content-Disposition

TRANSFORM swap.keyValue attachment;filename="MailAttachment-1.xml"

TRANSFORM swap.keyValue MailAttachment-1.xml

Plain2XML Transform.Class com.sap.aii.messaging.adapter.Conversion

Plain2XML Transform.ContentType text/xml;charset=utf-8

Plain2XML xml.conversionType SimplePlain2XML

Plain2XML xml.documentName MT_TEBA_Contractor_Details

Plain2XML xml.documentNamespace http://lonmin.co.za/TEBA_to_SAP

Plain2XML xml.fieldNames ENG_TYPE,INDUST_NO,COMPANY_NUMBER,SURNAME,INITIALS,NAME,REGISTERED,MALE,EXPERIENCE,RACE,MARITAL,DEPENDENTS,BIRTH_DATE,LANGUAGE,EDUCATION,SPOUSE,RELIGION,OFFICE,SERIAL_NO,REG_YEAR,SERV_START,SERV_EXPIRE,SERV_PER,LAST_CHANGE_DATE,LAST_CHNAGE_TIME,ID_DOC,ID_EFF_DATE,ID_EXP_DATE,PASSPORT,PASS_EFF_DATE,PASS_EXP_DATE,COUNTRY,DISTRICT,ADDR1,ADDR2,ADDR3,POSTCODE,PHONE,BI_1733_NO,REASON

Plain2XML xml.fieldSeparator |

Plain2XML xml.processFieldNames fromConfiguration

Plain2XML xml.structureTitle Details

Using it like this it does not do the swap correct and it still put the data within the body as xml, and leave the attachment as txt.

Can you see something wrong here.

Thanks

Clinton

Former Member
0 Kudos

Coudl you please try with just one keyName, keyValue pair and see if it makes a difference ?

Former Member
0 Kudos

Hi Clinton -

For the PayloadSwapBean module configuration, just try this:

TRANSFORM swap.keyName payload-name

TRANSFORM swap.keyValue MailAttachment-1

The MessageTransformBean config looks good to me.

Keep in mind that when monitoring in SXMB_MONI, within "Payloads", even after the swap, the main payload will remain within the mail attachment label (e.g. MailAttachment-1). However, this is the payload that is now being used as the main payload. If you do a mapping, for example, the source payload of the mapping will be the payload labeled as the attachment.

Regards,

Jin

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

depends what kind of receiver are you talking about

if you use the receiver adapter which supports attachments

you can always delete the not necessary part in an adapter module

(of the receiver adapter)

Regards,

michal

Former Member
0 Kudos

Hi Michal

The receiver adapter is RFC adapter.

Thanks

Clinton