cancel
Showing results for 
Search instead for 
Did you mean: 

Request to help in receiver mail adapter for dynamic filename for an attachment

0 Kudos
787

Hi PI Experts,

We are working on EDI to Mail interface, where we will get EDI source file with multiple message types i.e. 824, 997 in a single EDI file (i.e. 2 ISA segments).

Requirement is to send out a flat file in required format as an email attachment with email body.

Also, we need email subject line and file attachmentnames as “Filename_datetimestamp”.

Note: Filename is static and datetimestamp is current date & time.

We have configured receiver mail adapter without mail package as below and able to send out an email with required file attachment, but file attachment name without datetimestamp, sincemodule parameter ContentDisposition does not supportdynamicat channel level

channel1.png

Also, unable to remove source payload (EDI Payload) in the email attachments

channel2.png

email.png

If we uncheck Keep Attachments, then the required flat file attachment will also remove from the email.

For dynamic filename, I have checked below UDF

https://blogs.sap.com/2013/01/04/dynamic-filename-in-mail-receiver-adapter-made-easier/

String CompositeContentType = ContentType + “;charset=\”” + CharSet + “\”;filename=\”” + FileName + “\””;

container.getOutputHeader().setContentType(CompositeContentType);

return CompositeContentType;

But not sure the required configurations in receiver mail adapter, hence am unable to generate an email with desired file name for the file attachment.

Please suggest me how to populate dynamic filename for the file attachment without using Mail package & custom module. I have found blogs for both in sap forum but wanted to modify the current configurations. Is it possible to handle it in UDF or by declaring a variable at module parameter?

Thanks in advance for your help.

Thank you,

Chakradhar N

View Entire Topic
manoj_khavatkopp
Active Contributor
0 Kudos

Hi,

Check Scenario 3 in this blog for channel config.

Thanks,

Manoj

0 Kudos

Hi Manoj,

Thanks for providing the reference blog, i have tried already but did not work for me.

Even tried all the below blogs too

https://blogs.sap.com/2013/01/04/dynamic-filename-in-mail-receiver-adapter-made-easier/

https://blogs.sap.com/2014/10/21/handling-attachment-as-text-file-with-receiver-mail-adapter/

but no luck.

I am able to populate Content-Disposition value in the Message Content using above UDFs, but still filename is not reflecting. I tried with Mail package and without mail package, but unable to achieve dynamic filename for attachment.

Thank you,

Chakradhar