‎2005 Aug 31 11:09 AM
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.
‎2005 Aug 31 11:16 AM
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
‎2005 Aug 31 11:17 AM
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
‎2005 Aug 31 11:26 AM
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.
‎2005 Aug 31 11:35 AM
you need OLE programming. its explained well in the doc. i have given the link.
Regards
Raja
‎2005 Aug 31 11:46 AM
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
‎2005 Sep 07 8:01 AM
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.