cancel
Showing results for 
Search instead for 
Did you mean: 

filename of a attachment: *.csv >>> XML >>> IDOC

0 Kudos

Hi folks,

our scenario is:

1. are receiving mails with a csv file as an attachment

2. we use a senderChannel with the Mail adapter to get the mails

3. we swap the mail content with the attachment with localejbs/AF_Modules/PayloadSwapBean

4. we transform the "attachment" to XML with

localejbs/sap.com/com.contentmaster.CMTransformModule/CMTransformBean

5. we use the mail adapter

localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean

My question:

We need the filename in SAP but I have no idea how I can get the filename after the swap. Is it possible to get the filename and how can I integrate the filename into the XML or IDOC?

Andreas Solf

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Andreas,

Take a look at this blog.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

cheers,

Prashanth

0 Kudos

Hi Prashanth,

we not use the file adapter at the moment. So do you think this will be necessary or we find a solution without the file adapter.

Hi Moorthy,

we define a dynamic filename when we sent a message (option 1), but we need the name of the attachment when we recieved a new mail.

Cheers Andreas

moorthy
Active Contributor
0 Kudos

HI,

I was not talking about Dynamic File Name. In Module, retrieve the file name (attached file ) and pass it as a part of Payload. I think this was your requirement right ?

Cheers,

Moorthy

0 Kudos

Hi Morrthy,

I just read the topics of the blog you sent to me

Did you ever wanted to post your message as an attachment with the mail adapter?

Did you ever used MessageTransformBean to set a static name to your attachment?

Finally, did you ever wanted to make it a little more dynamic?

and found that we have a solutions for this questions. We not need to create or name attachments. We need to get the filename of an attachment that was sent to us.

Cheers Andreas

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check this weblog, this shows how to add the file name in payload.

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

Thanks,

Prateek

0 Kudos

Hello Prateek,

we are not using the file adapter. So this blog is not what I'm looking for.

But thx anyway

Andreas

0 Kudos

Hello again,

still searching for a solution.

The payload data are:

Content-ID: <payload-e2055983be3011dabf3b001279cd5411@sap.com>

Content-Type: application/octet-stream;name="filename.csv"

Content-Disposition: attachment;filename="MailAttachment-1.bin"

Content-Description: MailAttachment-1

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

...

How can I get the filename out of the headerdata to include it into the XML.

Cheers Andreas

P.S. I start my first steps in XI and I'm not a XI professional. So please send me a step by step solution.

Former Member
0 Kudos

Hi Andreas,

Did you already found a solution for this problem?

if so I'm very interested...

regards,

Andre.

moorthy
Active Contributor
0 Kudos

Hi

There are two options-

Option 1: Use the Module Processor code in the Mail Adapter and get the file name and use it in the Mapping

Option 2: Use java Proxy to invoke the MailBox and detach the attachment and construct the XML message and send into XI

Here is link for using the module in Receiver Mail Adapter- just for the info

/people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution

Regards,

Moorthy