cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Output as MS word doc.

Former Member
0 Kudos

My requirement is to get the output as a MS word format ..

without using any third party toool? Can we really achieve it or not ?

What we propsed is a solution is to get the output to a PDF file then to use

the PDF to word converter which cost them some amount but they were not satisfied to that .

they need the output directly from SAP .

Can we do this in SAP or not ?

Accepted Solutions (0)

Answers (3)

Answers (3)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

>> NO experts are replying for this Question ....

Hm... I don't think you will get very far with comments like this

But anyway...

I don't think there is a way to convert any output to MS Word format natively using only ABAP. It is possible using OLE but that requires MS Word to be installed on the workstation, plus due to OLE, this doesn't work in programs running in the background.

The situation is similar to generating an Excel spreadsheet (and now I'm not talking about DAT and tab delimited format but real native Excel output). It is also not possible without involving OLE or some other third party tool as far as I'm aware.

I'm sure there is a reason for this - probably related to licensing or something like that.

It'd be certainly nice to have a way to create .DOC or .XLS files natively from ABAP... just nobody developed it yet

Former Member
0 Kudos

Hi Tamas,

Thanks for your reply .

am really sorry if I hurt anybody by my comments

I just wrote as I have already seen a lots of posts on SDN regarding this requirement

with no proper solution and also not getting reply to this post .

anyway ..

If users are able to perofrm activities like passing the alv lists to EXCEL sheets then I think we have already OLE in our systems .

Would you please let me know in that case how to download to MS WORD .....

Sandra_Rossi
Active Contributor
0 Kudos

As already said, you may use OLE, or Desktop Office Integration which is an abstract layer using OLE. Look at the demo programs provided by SAP (SAPDEMOINTEGRA*). In SE38, look at menu Environment | Examples (and especially Controls).

You may call Word macros (VBA) to paste a PDF.

Former Member
0 Kudos

Hi

I don't think that you can do it without 3rd party tools.

OLE is to complex and cause its binnary its hell to implement any extension

With OLE for sure you will get to the point where something will not be possible.

Try tu use new xml based docx. In fact is a simple zip file with xml files inside. Format of word is well documented you can check it

[Open Office XML |http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm]

With ifxml library from SAP maybe you could create such document from scratch.

We did similar thing (export of sapscript to ms word) but with external tools connected via RFC, because amount of xml transformations you need to perform is huge.

Wish you luck. Hope I helped you somehow.

Former Member
0 Kudos

There is no standard possibility to do Word outputs in SAP.

Anyway you can develop connection of Mail-merge technology of Microsoft and SAP ABAP class i_oi_document_proxy.

http://help.sap.com/saphelp_sm32/helpdata/EN/e9/0be980408e11d1893b0000e8323c4f/content.htm

with interface get_mail_merge_interface:

http://help.sap.com/saphelp_sm32/helpdata/en/6e/8fc2e3dd0d11d2bdba080009b4534c/content.htm

Hope, it helps

Sandra_Rossi
Active Contributor
0 Kudos

I need to correct what you say.

SAP supplies a STANDARD OLE interface, so SAP is able "to do Word outputs". We may also use DOI to do that (what you call "Mail-merge technology" is a part of it), it is valid for excel, word, outlook, etc.

And, as sap2word suggests very well, "docx" format can be used (since word 2007 if I remember well), especially in background jobs because OLE is usually not possible (unless a PC is connected as an RFC server).

Former Member
0 Kudos

DOI is more flexible, because you design your template separately in Word,

Example: http://www.sap2word.de/abap.html

ALE is probably faster, not so flexible.

ALE and DOI is not background.

XML based docx is from my point of view the best solution, but it uses 3rd party tool, what you do not like.

Anyway it is your choice, what you prefere.

Edited by: sap2word on Sep 17, 2009 6:19 PM

yes_sapteam
Participant
0 Kudos

Another very simple solution (which of course works in Jobs) is to write HTML code in the attachment and give it ".DOC" extension (or ".XLS" for Excel).

It will display very nice with MS Word or MS Excel and the user will not know the difference.

We are using it here in several cases and the results and users satisfaction is great.

I haven't tried it (I didn't need to), but I'm afraid you will not be able to do too fancy stuff like Formulas in Excel.

Regards.

Ayal.

Former Member
0 Kudos

Hi,

Refer the sample code: it is for smartforms

CALL FUNCTION fm_name " '/1BCDWB/SF00000031'

EXPORTING

control_parameters = control_parameters

output_options = output_options

s_header = st_header

IMPORTING

job_output_info = output_data

TABLES

it_overdue = ITAB[]

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5

.

  • now convert the final document (OTF format) into PDF format

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'DOC'

IMPORTING

bin_filesize = v_pdf_len

TABLES

otf = output_data-otfdata

lines = pdf_table

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5.

Regards,

Vijay

Former Member
0 Kudos

Hi Vijay ,

I do not require the PDF output. I require the output to a Word doc .

But here it has been written to convert it to PDF would you please tell me how to download it to a word doc ..

Former Member
0 Kudos

Hi surya ,

This is not possible to convert the smartform to Word Doc may be it can be possible by using adobe forms

Regards,

Vijay

Former Member
0 Kudos

Hi Surya,

Yes, we can convert the SAP output as MS word document.

Plz check these links , it will guide you in doing this:

Hope it will help you.

Thanks & Regards,

Sarita Singh

Edited by: Sarita Rathour on Aug 18, 2009 7:35 AM

Former Member
0 Kudos

Hi Sarita Nowhere I can find a proper Solution for how to download the Smartform output

to word doc format ..

and the links which you provided I don't think nowhere we can find a solution for that.

Does anybody have a solution ?

I have done most of the SDN searches nowhere I could find a solution to this format ..

any solution is available for this or not ?

NO experts are replying for this Question ....

Former Member
0 Kudos

Hi Surya,

I dont think so you can do it using SAP. There is no way to convert into MS word document,as stated by others only into PDF.

Vishwa.