Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem for Mail with PDF attachment

Former Member
0 Kudos

Hello all,

I have a problem regarding sending mail with a PDF attachment from SAP. The attachment contains Payslip of employee that is being generated from a Submit program of the respective HRFORM. I have used the Submit program within a JOB and the spool request generated. From the spool request i am extracting the pages using FM RSPO_GET_PAGES_SPOOLJOB.

Now to convert the spool job to PDF am using FM CONVERT_OTFSPOOLJOB_2_PDF. And after the job is being finished, am deleting both the JOB and SPOOL.

To change the output of the FM CONVERT_OTFSPOOLJOB_2_PDF, into attachment with line width of 255 am using FM SX_TABLE_LINE_WIDTH_CHANGE. Then after filling all the required parameters for FM SO_DOCUMENT_SEND_API1, am sending the mail with the attachment. I have kept the format as PDF.

But the problem here is, the attachment is going as .DAT file and not as .PDF file!!!

Please help to resolve this issue.

with regards,

Koushik.

2 REPLIES 2

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

Instead of using SO* APIs to send mail you should use the BCS classes. Anyway there is a sample program BCS_EXAMPLE_8 which is very similar to your requirement

Cheers,

Suhas

PS: The sample program BCS_EXAMPLE_6 has got more to do with PDF forms as is your case

Former Member
0 Kudos

Thanks Suhas,

Yeah the problem got resolved on using Object Oriented approach. I had to do some modifications as the mail required both attachment as well as body text. But now its working fine.

Thanks a lot.

Will give a point for the help,

Koushik