cancel
Showing results for 
Search instead for 
Did you mean: 

Keep same filename for mail attachment

0 Kudos

Hi,

We have a requirement to pick up a file (.txt) from a folder and send it as an attachment over mail.

The filename has to be kept same as of the actual file. We have tried setting the composite content type as mentioned in the below link.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/01/04/dynamic-filename-in-mail-receiver...

However to set this, we have to use a mapping and then the payload was getting changed from the original attachment to the mapping output.

(We were not using mail package and the attachment content was overwritten by the target XML from the mapping)

We tried with using mail package as well but was having issue with getting the Content field populated or not getting the filename passed through.

Is it possible to keep the same filename for attachments as well without using any adapter module? If yes, please guide on this matter.

Thanks

Justin

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

We achieved the solution by reading the payload and writing the same to content field in mail packaging. We didn't want to read the payload content but there was no other way of putting the attachment filename at runtime.

Former Member
0 Kudos

Yes Justin

We have to read the payload in any case. We can do this in both ways.

1. With mail package

2. Without mail package

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

There is an adapter module written that works in 7.0 version. Basically you have to change the code that will support your version

http://wiki.scn.sap.com/wiki/display/XI/Adapter+Module+PI+7.0+Get+Attachment+Name

0 Kudos

Hi Baskar,

Thanks for the reply. I had seen this but we wanted to avoid the use of any custom adapter module.

Is there any standard module which will aid in achieving this?

Regards

Justin

rhviana
Active Contributor
0 Kudos

Hi Justin George,

Check the two links below:

http://scn.sap.com/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapt...

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/04/19/yes-it-is-possible-to-dynamically...

Also if you dont want use module, you can do it buy javaMapping with MailPackage, you must extract the name of file and after that save into temporary variable.


I have the full javamapping code with MailPackage, but it's posted in portuguese language, because it's something to Brazil, but you can read the java code and adapt for you, check below:

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=315524420

Kind regards,

BR.

R.Viana.

0 Kudos

Hi,

Thanks for the answer. Yes, it can be achieved through Java mapping but we wanted to avoid that as well if there is a possibility.

We are trying to achieve the functionality through graphical mapping or using standard modules.

If there is no other way, I will take a look into the code you have provided. Thanks!

Regards

Justin