Application Development and Automation 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: 
Read only

Send Data into word.

Former Member
0 Likes
889

Hi there ! I got this problem I need to send some datas from an abap program to a Microsoft word document

(In the word file i need two colums that come from the abap program and two colums that the user will input. ), i tried to search different things but without result..

there is someone who can help me

Thanks Gil.

6 REPLIES 6
Read only

athavanraja
Active Contributor
0 Likes
850

check out the following article.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/technologies/an easy reference for ole automation.article

Regards

Raja

Read only

Former Member
0 Likes
850

Hi Gil,

There are lot's of ways to download the data into MS word through ABAP program like use FM GUI_DOWNLOAD, ALV menu already having default option, through OLE.

Pls be more specific.

Reg,

Arpit

Read only

0 Likes
850

What i mean is that two columns will be trnsfer to the word document and it will be a nother two columns for input by the user.

Read only

0 Likes
850

you need OLE programming. its explained well in the doc. i have given the link.

Regards

Raja

Read only

0 Likes
850

I feel, if you do this for MS Excel then It woud be good and easy.

REPORT MULTIEXCEL .

INCLUDE ole2incl.

DATA: application TYPE ole2_object,

workbook TYPE ole2_object,

sheet TYPE ole2_object,

cells TYPE ole2_object.

CONSTANTS: row_max TYPE i VALUE 256.

DATA index TYPE i.

DATA: BEGIN OF itab1 OCCURS 0,

first_name(10),

END OF itab1.

START-OF-SELECTION.

APPEND: 'Arpit' TO itab1,

'John' TO itab1.

CREATE OBJECT application 'excel.application'.

SET PROPERTY OF application 'visible' = 1.

CALL METHOD OF application 'Workbooks' = workbook.

CALL METHOD OF workbook 'Add'.

  • Create first Excel Sheet

CALL METHOD OF application 'Worksheets' = sheet

EXPORTING #1 = 1.

CALL METHOD OF sheet 'Activate'.

SET PROPERTY OF sheet 'Name' = 'Sheet1'.

LOOP AT itab1.

index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.

SET PROPERTY OF cells 'Value' = itab1-first_name.

ENDLOOP.

  • Save excel speadsheet to particular filename

CALL METHOD OF sheet 'SaveAs'

EXPORTING #1 = 'c:\temp\exceldoc1.xls' "filename

#2 = 1. "fileFormat

  • Closes excel window, data is lost if not saved

  • SET PROPERTY OF application 'visible' = 0.

Reg,

Arpit

Read only

0 Likes
850

i'll try to explain my request again...

So this is what i'm looking for:

Transfer data into ms word document at the top of the page will be the logo of the company beneath that will be a sub title and date of printing beneath the date of printing will be a table with 6 columns and 13 rows,

2 columns will receive the data from the sap and the others columns by the users.

i hope it's more clear now.

thanks.