on 02-23-2011 10:15 AM
Hi Abapers,
Could any body please explain me the procedure to convert an SAP SCRIPT form OTPUT to Excel .and send the same to email.
Please do post the code if anybody is having the code for it.. (SCRIPT TO EXCEL)
Moderator message: FAQ, please search for available information/documentation.
Edited by: Thomas Zloch on Feb 23, 2011 1:04 PM
Hi,
find sample code download script to doc .
*&---------------------------------------------------------------------*
*& Form OPEN_FORM
*&---------------------------------------------------------------------*
* Open form for output to OTF memory
*---------------------------------------------------------------------*
call function 'OPEN_FORM'
exporting form = tnapr-fonam
language = nast-spras
options = itcpo
archive_index = toa_dara
archive_params = arc_params
device = 'OTF_MEM'
dialog = ' '
exceptions others = 1.
*---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form DOWNLOAD_FORM_OTF
*&---------------------------------------------------------------------*
* New output type download to word.
* Read form back from OTF memory. download and start word
*----------------------------------------------------------------------*
FORM DOWNLOAD_FORM_OTF.
DATA: TLINE LIKE TLINE.
DATA: TLINES LIKE TABLE OF TLINE.
CALL FUNCTION 'CONVERT_OTF_MEMORY'
TABLES
LINES = TLINES
EXCEPTIONS
MEMORY_EMPTY = 1
ERR_MAX_LINEWIDTH = 2
ERR_FORMAT = 3
ERR_CONV_NOT_POSSIBLE = 4
OTHERS = 5.
* REMOVE FORMAT CHARACTERS
LOOP AT TLINES INTO TLINE.
TLINE = TLINE+2.
MODIFY TLINES FROM TLINE.
ENDLOOP.
DATA: W_FILENAME LIKE RLGRAP-FILENAME.
W_FILENAME = 'C:\TEMP\Z.DOC'.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = W_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = TLINES
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 9.
DATA: W_PROGRAM(100).
W_PROGRAM = 'C:\Program Files\Microsoft Office\Office\winword.exe'.
CALL FUNCTION 'WS_EXECUTE'
EXPORTING
COMMANDLINE = W_FILENAME
INFORM = 'X'
PROGRAM = W_PROGRAM
EXCEPTIONS
FRONTEND_ERROR = 1
NO_BATCH = 2
PROG_NOT_FOUND = 3
ILLEGAL_OPTION = 4
GUI_REFUSE_EXECUTE = 5
OTHERS = 6.
ENDFORM. " DOWNLOAD_FORM_OTF
click on below link to cconvert sap script to excel
Edited by: Venkata Pavan Sinagam on Feb 23, 2011 12:21 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.