cancel
Showing results for 
Search instead for 
Did you mean: 

Require PDF File attachment in Mail

jagesh_lakdawala
Active Participant
0 Kudos

Hi Experts,

I am doing the Proxy-XI-Mail scenario. I am sending the Mail related data like Content, Content_Type from R/3 to XI and configured the Mail receiver adapter.

R/3 coding:-

G_ALERT_INPUT-MT_R3REQUEST_MAIL_SEND-MAIL-CONTENT_TYPE = 'application/pdf;name="filename.pdf"'

G_ALERT_INPUT-MT_R3REQUEST_MAIL_SEND-MAIL-CONTENT = G_CONTENT

G_ALERT_INPUT-MT_R3REQUEST_MAIL_SEND-MAIL-FROM = From_Mail.

G_ALERT_INPUT-MT_R3REQUEST_MAIL_SEND-MAIL-TO = To_Mail.

and then calling the client proxy

ID Mail Receiver configu:-

Selected Use Mail Package option

Content encoding base64

Keep attachment option is also selected.

I am geeting the Filename.pdf in mail as attachment.

Problem is:- I am not able to open the attached PDF File and error is:- 'Adobe Reader could not open filename,pdf because it is either not a supported file type ot because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded'

I think some conversions may be required to convert the XML Payload data into PDF file format for the Mail receiver adapter.

Please suggest

Thanks & Regards

Jagesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Change the Content-encoding field to application/pdf in the mail adapter using MessageTransform Bean

Module.

Rajesh

jagesh_lakdawala
Active Participant
0 Kudos

Hi rajesh,

Can you provide the sample example for using this MessageTransformBean? beuase I dont have much knowledge on this Adapter module use.

Please suggest me.

Thanks & Regards

Jagesh

jagesh_lakdawala
Active Participant
0 Kudos

Hi Rajesh,

Thanks for your reply.

I am already passing the Content Type from SAP R/3 to XI through proxy as shown here.

G_ALERT_INPUT-MT_R3REQUEST_MAIL_SEND-MAIL-CONTENT_TYPE = 'application/pdf;name="filename.pdf"'

using this I am getting the PDF attachment but I am not able to open it.

I think I need to pass some special Content-Encoding from R/3 to XI for PDF attachment in mail.

Like this same method.. I am successfully getting the Excel, word and Text file attachment. only problem comes with PDF file.

Please suggest.

Regards

Jagesh

former_member200962
Active Contributor
0 Kudos

Hi,

I am already passing the Content Type from SAP R/3 to XI through proxy as shown here.
G_ALERT_INPUT-MT_R3REQUEST_MAIL_SEND-MAIL-CONTENT_TYPE 
= 'application/pdf;name="filename.pdf"'

can you tell me if there is any advantage of passing the mail parameters from the SAP system instead of configuring it in XI/PI....you answer will be helpful to me

Thanks,

Abhishek.

jagesh_lakdawala
Active Participant
0 Kudos

Hi Abhishek,

I dont know the advantages and if you knw then please mention it here.but our requirement is to send Alert mail Either with Excel or Word or HTML ot PDF file attachment based on some criteria so I am using this approach.

Please suggest.

Thanks & Regards

Jagesh

former_member200962
Active Contributor
0 Kudos
if you knw then please mention it here.

sorry i also donno :(...hence asked.....can you check by making all the settings/mapping in XI itself rather than getting them from SAP....just make SAP trigger a request...get it in XI....convert it to mail format to generate PDF....maybe you will get the pdf in a proper format then

Regards,

Abhishek.

Former Member
0 Kudos

you need to use conversion routines without this you can't read/write pdf, ready to use conversion package are proprietory while you can search for java code freely for this.

with this one more approach we used in past, is generate the pdf in application server using R/3 standard conversion functions and send that file as an attachment using PI,

let me know if you require any other detail

Answers (2)

Answers (2)

prasannakrishna_mynam
Contributor
0 Kudos

Hi Jagesh,

The content type of the Pdf has to be identified, in order to conver the pdf successfully, You need to perform the conversion usign the PayloadSwapBean the Module tab. You use this when you want to receive attachment using Mail adapter. You need to configure few steps in Module Configuration

There you need to mention your MIME header paramenters Content-Type, Content-Description.

How this can be configured and how process with PayloadSwapBean check the below link

http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm

Module Processor

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/content.htm

Regading MessageTransformBean, Migrating Dispatcher Classes

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm

Regards,

Prasanna

former_member732072
Active Participant
0 Kudos

Hi Jagesh,

Please have a look at the following fiels and see if it helps

Best Regards

jagesh_lakdawala
Active Participant
0 Kudos

HI Prakash,

I gone throufh this links but it doesn't look related to my problem.

Please suggest further.

Thanks and Regards

Jagesh