[4259] in sapr3-soft
Re: Print an Excell File in Sapscript
daemon@ATHENA.MIT.EDU (Einar Eirmksson)
Sun Oct 10 20:35:09 1999
To: sapr3-soft@MIT.EDU
Date: Mon, 11 Oct 1999 00:32:30 -0000
From: "Einar Eirmksson" <einare@simi.is>
Message-Id: <3801928e.0@news.isholf.is>
Yes, you can do it in ABAP through Automation but it is printed through
Excel on the client and SAPgui has to be active,
Don't know about doing it through sapscript except for looping through all
the cells in the sheet and print out but why bother
when Excel can do it for you.
Example code follows:
report zprint_excel_file.
include ole2incl.
data excel type ole2_object.
data books type ole2_object.
data book type ole2_object.
data pa_file(128).
data rcode like sy-subrc.
start-of-selection.
call function 'WS_FILENAME_GET'
exporting
def_filename = ' '
def_path = 'C:\'
mask = ',Excel,*.xls;*.xlw,All,*.*.'
mode = 'O'
title = 'Open Excel file'
importing
filename = pa_file
rc = rcode
exceptions
inv_winsys = 01
no_batch = 02
selection_cancel = 03
selection_error = 04.
if sy-subrc <> 0.
exit.
endif.
create object excel 'EXCEL.APPLICATION'.
set property of excel: 'VISIBLE' = 0.
call method of excel 'Workbooks' = books.
call method of books 'Open' = book exporting #1 = pa_file #2 = 1.
call method of book 'Activate'.
call method of book 'PrintOut'.
free object book.
free object books.
free object excel.
Gedis AS (by way of SAP Moderator <sap-request@realtimeusa.com>)
<gedis@pophost.eunet.be> wrote in message
news:7sqcnt$aep@nexus.netconcepts.com...
> Is it possible to print an Excel sheet in an ABAP program or in a
Sapscript
> Form.
>
> Thank you very much
>
> Jean-Claude Onderbeke.
>
> My mail adress is JC_ONDERBEKE@SWING.BE or GEDIS@POPHOST.EUNET.BE
>
>
>
>
>