cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment file not picked - File to Mail scenario

Former Member
0 Kudos

Hi,

I'm just trying out the file to mail scenario as suggested in blog:

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

I created a xml file as the main mail content(main.xml). And I also have an attachment file(txt) placed at the same location. The file adapter picks the mail.xml, but not the attachment txt file. I can see the mail in my inbox, with the mail.xml added as an attachment..

I have added the "additional files" in the File adapter configuration. Also in mail adapter configuration, I have checked "Keep attachments"

Are there any other configurations I'm missing out???

When I check in XI ABAP engine, sxmb_moni, I see the following error:

<SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_Mail_MM_</SAP:P1>

<SAP:P2>java.lang.NullPointerException</SAP:P2>

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>java.lang.NullPointerException thrown during application mapping com/sap/xi/tf/_Mail_MM_:</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Accepted Solutions (0)

Answers (3)

Answers (3)

GabrielSagaya
Active Contributor
0 Kudos

Have you tested your mapping in IR with the payload from SXMB_MONI?

Check your mapping once again...check if you have mapped all the necessary fields

You can use the blog for this,

Former Member
0 Kudos

Hi,

Thanks for the quick response...

Prateek,

the mapping is fine in IR.

Sanjeev,

Making the optional parameter created a failure in the communication channel.

the error the file sender returns in XI runtime workbench is

"Error: java.lang.Exception: Add attachment: Mandatory additional payload file 'main.txt' not found!" though my attachment name is "Attachment.txt" . I renamed the attachment file to "main.txt", and made necessary changes in Additional file configurations too...

I have the attachment in the same location as the main content xml file. Should I specify somewhere the location of my attachment file too?

Gabriel,

Very useful link. but I dont see the failure in sxmb_moni now, may be because the failure occurs at the Communication Channel level itself????

-Ajitha

GabrielSagaya
Active Contributor
Former Member
0 Kudos

Gabriel,

I have made necessary configuration following the document u have sent. I still get the same error "Mandatory additional payload file 'main.txt' not found!" in the communication channel.Main.txt is the name of the attachment.

When I make the "optional" parameter as YES in the additional files configuration, XI processes the main content file, sends it as an attachment... But the attachment is not picked because my file adapter is configured to pick only xml files. when I configure my file adapter to pick all files (.), I receive two mails, one with the main content and other with the attchment content.

Please help me out with this issue.....

thanks!

Ajitha

former_member194786
Active Contributor
0 Kudos

Hi Ajitha,

Just a quick check:

As for the txt file not being picked up, have you provided the parameter test.txt.optional as Yes? In that case the file might be picked up. You need to provide it as NO.

It worked like that only in my case.

The error that you are getting is some mapping error i guess.

Regards,

Sanjeev.

prateek
Active Contributor
0 Kudos

The error shows that it is mapping problem. Please test mapping in IR first

Regards,

Prateek