cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with File to Mail Scenario--PI7.3

Former Member
0 Kudos

Hi Experts,

I have a requirement where there are two files in PI AL11 Directory,let say file.xml and file_test.xml.

I want to send file.xml as the main payload and file_test.xml as the attachment.In the target side I want to have the entire xml content of the file "file.xml "as the mail body and "file_test.xml" as the attachment.I am getting the xml content as the mail body as required and also the attachment as required but problem is I am getting file.xml whose content should only be in my mail body as an additional attachment where I need only file_test as the attachment in my mail in short I am getting 2 attachment file.xml and file_test.xml where I need only one i.e;file_test.xml.

I have implemented it in following ways:

a) Mail package is used as the receiver structure.

b) Following mapping is done in ESR:

       emailid----->To

       emailid---->From

       application/xml----->Content_Type

       filename----->ContentDescription

      inline;filename="filename"----->Content_Description

      return as xml(root source message)------>Content

c)  In the sender file adapter:

     file.xml as the source filename and the relevant directory name

     checked the option Additional File

     put the name as file_test

       file_test.namePart   ".xml"="_test.xml"

       file_test.optional       NO

d)    In the receiver mail adapter I have checked the mail package format and the keep attachment option.

      In the Module tab I have done the following configuration:

   

I have gone through all the Links available in SDN for the solution of this issue.
Therefore expecting an exact solution of this problem.Kindly help.

Thanks and Regards

  Anik Sarkar

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Anik,

You need to develop Adapter Module for this. In general whenever you check the option "Keep Attachment",Mail adapter by defaults pass the main payload as an attachment.For more details

please go through the below link:

Regards

Atanu

Former Member
0 Kudos

Hi Atanu,

Yes I am also thinking of going by that way.

Thanks for the help.

Thanks and Regards

Anik Sarkar

Answers (2)

Answers (2)

gagandeep_batra
Active Contributor
0 Kudos

Hi Anik,

Why you using Payload swap bean, Try without bean that should work

Regards

GB

Former Member
0 Kudos

Hi GB,

Do you mean to try without both Payload Swap Bean and Message Transform Bean?

I tried without using Payload Swap Bean and Message Transform Bean,in that case I am getting 2 attachment:

1st the file whose content is required only in the mail body is coming as one attachment with its name i.e; file.xml

and 2nd is the actual file which I want to come as an attachment is coming as untitled.xml

Here the attachment file.xml is the file whose content I want to come only in the body and not as attachment and untitled.xml is the file which I want to come as attachment but here the name of the file i.e; file_test is not populating.

Thanks and Regards

Anik

Former Member
0 Kudos

Hi Anik,

Can you try below module configuration in your mail adapter and test?

This will swap the payload of file_test content to the MainDocument. Check this links for reference http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5...

Regards,

Praveen

Former Member
0 Kudos

Hi Praveen,

I want file_test.xml as the attachment and file.xml as the body of the mail.

Thanks and Regards

Anik

Former Member
0 Kudos

Hi Anik,

Just give a try my module configuration. By default, mail adapter attach the payload (MainDocument) of the message to the mail. you can swap the payload content of your attachment (file_test.xml) to MainDocument, then you will receive file_test.xml payload in attachment of your mail.

Regards,

Praveen

Former Member
0 Kudos

Hi Praveen,

I tried what you have suggested.I am getting 2 attachment:1st the file whose content is required only in the mail body is coming as one attachment with its name i.e; file.xml

and 2nd is the actual file which I want to come as an attachment but it is coming as untitled.xml.The same output what I get trying Gagandeep suggestion.

Former Member
0 Kudos

Hi Anik,

For me only one file (untitled.xml) is attaching with content of file_test.xml.

Did you you activated the channel? Because i tested with below configuration, it's attaching only one file untilted.xml (i'll check why filename wrongly created and provide solution) in mail.

file.xml:

file_test.xml:

Sender CC:

Receiver CC:

Mail with attachment:

Regards,

Praveen

Former Member
0 Kudos

Hi Praveen,

Are you doing anything in ESR Mapping in the mail package structure?

I have done the following mapping:

emailid-->From

emailid-->To

application/xml----->Content_Type

filename----->Content_Description

inline;filename="filename"----->Content_Disposition.

Is this required in ESR?If possible can you also share the screenshot if you have done anything in ESR?

Thanks and Regards

Annik