cancel
Showing results for 
Search instead for 
Did you mean: 

How to send smartform form through email as word document

Former Member
0 Kudos

Hello gurus,

Currently we are using below approach

First we are calling FM

  • call smartform

CALL FUNCTION v_fmname

EXPORTING

control_parameters = wa_control

output_options = wa_final

user_settings = c_checked

wa_final = wa_output

IMPORTING

job_output_info = wa_job_output_info

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

Then we are converting imported wa_job_output_info-otfdata[] data from above FM using below FM

CALL FUNCTION 'CONVERT_OTF'

And then by using FM CALL FUNCTION 'SO_DOCUMENT_SEND_API1' we are sending the smartform as PDF attachment

But now we have to send the form as Word document attachement.

So can u plz suggest any FM to convert this data to Word document instead of PDF.

Regards,

Amit Taur.

Accepted Solutions (0)

Answers (5)

Answers (5)

mehmet_koc3
Explorer
0 Kudos

Hello,

I'm only functionnal in FICO area, and currently busy to provide a functional spec to developpers for the following requirement in SAP business workflow:

In the workflow, agent takes the decision to reject the finance document, then workflow creates an email with a Word document as attachment to that email. The content of word doc is configured in workflow and linked to the logon language of the user.

The developpers don't know how to create the word document for that workflow. They can create a PDF doc, but not a word.

I would like to know which precise and complete information I can give them to unblock them.

Your help will be very appreciated.

Thank you very much

Cheers

OttoGold
Active Contributor
0 Kudos

Hello,

I always wonder why people must convert the smartforms into Word (well I have answered questions how to do this even for Adobe forms, what is even more fun) when it is so easy to generate a new Word document using Office integration or through a simple XML transformation.

Maybe you can go for this one?: /people/otto.gold/blog/2010/02/11/happy-reporting-with-excel-ii

Regards Otto

Former Member
0 Kudos

Thanks for your input.

But how can we convert the smartform data to word format, to send it using FM 'SO_OBJECT_SEND

Waiting for your reply.

Regards,

Amit Taur

Sandra_Rossi
Active Contributor
0 Kudos

I guess you didn't understand answers in SDN, or don't have time to look at all of them. So, to summarize:

1) SAP don't provide a converter from OTF to Word. That would be too much complex to develop it yourself.

2) workaround is to convert OTF into PDF and embed it in a Word document (Adobe Reader is opened when we double-click the PDF icon). First, the question to ask oneself: is there really an interest in providing a Word doc which only contains a PDF, instead of a PDF alone?

To embed the PDF into a Word document, there would be 2 solutions (unfortunately I don't think we can achieve the second one):

1) if you convert in dialog mode (opposed to background), you may create the Word document and embed the PDF using OLE2 commands (see abap statements create object of, call method of, ...)

2) usually, we may create the Word document in WordML format (XML Word 2003). To know what format is needed, either read the WordML specification (ECMA-376), or create the Word document manually, insert a PDF object and save it as 2003 XML then "decypher it". I couldn't succeed with 2nd option. According to specification, inserted objects are compressed using LZ77 compression algorithm, then are written in base 64. I don't know how to call LZ77 algorithm!

Former Member
0 Kudos

Hi Amit,

Object_type i.e.,

Type of document to be sent with mail

u2018RAWu2019 for raw text (default)

u2018DOCu2019 for word file

u2018XLSu2019 for excel file

All classes can be used except for folders (u2018FOLu2019) and distribution lists (u2018DLIu2019)

In the function module 'SO_OBJECT_SEND' fill the OBJECT_TYPE = 'DOC'.

Regards,

Md Ziauddin.

Sandra_Rossi
Active Contributor
0 Kudos