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: 

Convert MS Word .doc to PDF

Former Member
0 Kudos

Hello,

I am currently searchin for a way to convert several Word documents into a single PDF file. The original Word documents are attachments to a One Order object in CRM 5.0, and I want to create an action that merges them into one file, converts this into a PDF and sends it out via email as the email attachment.

I was wondering if there are function modules that can convert MS Word into PDF directly or via something intermediate, e.g. spool format, and if it was possible to merge them into just one file.

I guess if I somehow get them in spool format I can simply glue the pages onto each other - but is it possible to read the Word files?

Regards

Thomas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Thomas,

it should work with FM CONVERT_OTFSPOOLJOB_2_PDF, just make sure that all Word documents are in one spool job. An example report is RSTXPDFT4.

Hope that help's!

Viele Grüße

Nicola

9 REPLIES 9

Former Member
0 Kudos

Hi Thomas,

it should work with FM CONVERT_OTFSPOOLJOB_2_PDF, just make sure that all Word documents are in one spool job. An example report is RSTXPDFT4.

Hope that help's!

Viele Grüße

Nicola

0 Kudos

Hi Nicola,

thanks for the answer. It seems though as if getting the Word documents into a spool job (and let's not overcomplicate this, so even one successfully converted document is a win) is the hard part.

At the moment I do not see any threads in the SDN where people have successfully managed to read in a Word .doc and "convert" it into a spool file by whatever means, but if you know a way how to do this I would greatly appreciate it!

Grüsse zurück!

Thomas

0 Kudos

Hi Thomas,

could you just give me an idea on how you create the word document? For example is it a converted sapscript, an attachment in SAP Office or are you using an upload first?

Regards

Nicola

0 Kudos

Hi Nicola,

the documents already exist in the SAP system as attachments to orders. They can get into the CRM system as downloads from the R/3 as material descriptions or can be manually created by the users and attached to the order.

I then want to send out all (or some) attachments of one of these orders from within the order via an action, but company policy mandates that there may be only one attachment per mail, and it must be in PDF format.

Regards

Thomas

0 Kudos

Hmmm - that's a tricky one!

But check report RSPO0068; this report converts single Word-documents and send it to spool. You've already got the FM to convert a spool file to PDF and the combination of both should solve the problem.

I know that SAP has developed an external document converter (BC-XDC) but I don't know exactly what release is necessary to work with that tool.

Viel Glück!

Nicola

0 Kudos

And by the way: SO_DOCUMENT_READ_API1 delivers the attachment )

0 Kudos

Hi Nicola,

thanks a lot for pointing out that report! I will see how I can use that code in there for my own purposes!

Regards

Thomas

Former Member
0 Kudos

Hi Thomas,

I checked a lot for this requirement. Using third party tool, we can convert the word document to PDF. If you installed Adobe PDF writer in your machine, then this can be easily resolved.

Regards,

Karthik.

Message was edited by:

ksutharsanam

Former Member
0 Kudos

Did you achieve this task?

I followed Former Member's instructions but the generated pdf is corrupted.

Help me if you have done this.

Thanks

Chandler Bing