cancel
Showing results for 
Search instead for 
Did you mean: 

Send a file PDF from mail SAP

Former Member
0 Kudos

Hi forum,

I have a problem. I converted a smartforms to PDF and sended to function SO_DOCUMENT_SEND_API1 to send a mail external...

So, when I tried to open the file attachment, I can't open this file. and I watch a message : 'The file is damaged'. But in ocations the file can opened.

SAP system is connected to CITRIX. can this be a problem?

Regards,

Jhon R.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

First of all do which function do you use to convert your smartforms result to PDF ?

Then i agree with Sandra, please don't use anymore function SO_DOCUMENT_API but use classe CL_BCS . With it a lot of bug disapears and it works very fine . If you need i can give you more detail on how to use it.

Regards

Former Member
0 Kudos

Hi ABAP Gurus ,

Good Morning !

I converted a smartform to PDF and sended to function SO_NEW_DOCUMENT_ATT_SEND_API1 to send a mail external...

So, when I tried to open the file attachment, I can't open this file. and I watch a message : 'There was a error in opening the document . The file is damaged and could not be repaired '.

In one of the earlier threds on www. sdn.sap.com i found a solustion which says to use class CL_BCS but I don't know how to use this class or rather use classes in ABAP Programs .

I would be thankful if I am provided the sample code or some help regarding this issue .

I think if somebody provides a solution on how to use function SO_NEW_DOCUMENT_ATT_SEND_API1 that would make me Relieved .

Regards,

D Singh

Sandra_Rossi
Active Contributor
0 Kudos

Please search SDN (top search field, not the forum search). You would find blog by Thomas Jung several years ago ("Sending E-Mail from ABAP - Version 610 and Higher - BCS Interface ").

There are also demo programs by SAP: BCS_EXAMPLE_*.

Former Member
0 Kudos

There are SPu2019s that break this FM and create the symptoms you are experiencing. The FM is fixed in subsequent SP's. Check note 1430123 to see if it's relevant to your issue.

Former Member
0 Kudos

Hi , Myles Deniz

I am verymuch thankful, I was also facing a similar problem faced by Mr.DEVENDRA SINGH , according to your suggestion, we have applied the note 1430123 and our problem is sorted out.

Thanks and regads

Rani.

Sandra_Rossi
Active Contributor
0 Kudos

Myles and Rani, thank you for your valuable feedbacks.

I just wanted to see what was behind this note, as for me the SO_NEW_DOCUMENT_ATT_SEND_API1 function module has always correctly worked (though very tough to make it work! This FM should be definitely abandoned, and we should use always BCS).

This note says:

> Either the calling program does not specify a document size (which should not be absolutely necessary), or the binary documents are transferred to a text table (type SOLI) in a Unicode system (which is not recommended).

So, if you pass the length with the right value or pass binary document as binary (CONTENTS_HEX parameter if I remember well), then there should be no problem.

Sandra_Rossi
Active Contributor
0 Kudos

PDF damaged, same question again and again... (if people could stop using this old SO_... function module, and use CL_BCS instead, that would limit the bugs and questions!)

Citrix, I don't see where it could impact the mail as the mail is prepared only within SAP and sent externally.

Either extra blanks or zeroes in the PDF. When you convert into PDF, SAP sends back a binary length, you have to transmit it unchanged when adding the attachment to the mail, same thing for binary value of the PDF. To make sure, check length and PDF binary value by debug, and compare it to the attachment you download from the mail to your computer.

Former Member
0 Kudos

hi,

i am facing the same problem.

pdf file in mail attachment not opening because of file damage error.

How to use the other method?

can you plz explain?