‎2006 Dec 07 10:26 AM
Hello gurus,
I have requirement like this..
The Program what has been written should run
Every day at 00:00 and the program must be executed and the result should be stored at the following location: e:\.....csv.
The output that store in the location should de in csv file
How this can be done ??
If u have sample code that would be very
helpful to me..
Waiting for your replies
senthil
‎2006 Dec 07 10:33 AM
Hi Senthil,
Chnadra provided some code. It is helpful to define the report.
Schedule at 00:00 the report as background job.
I hope will problem will be solved
Regards
Bhupal reddy
‎2006 Dec 07 10:29 AM
Check this , this will convert to CSV and download to text file
TYPE-POOLS: truxs.
TYPES:
BEGIN OF ty_Line,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
END OF ty_Line.
ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY.
DATA: itab TYPE ty_Lines.
DATA: itab1 TYPE truxs_t_text_data.
SELECT
vbeln
posnr
UP TO 10 ROWS
FROM vbap
INTO TABLE itab.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
i_field_seperator = ';'
TABLES
i_tab_sap_data = itab
CHANGING
i_tab_converted_data = itab1
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:TEMPtest.txt'
TABLES
data_tab = itab1
EXCEPTIONS
OTHERS = 1.
‎2006 Dec 07 10:33 AM
Hi Senthil,
Chnadra provided some code. It is helpful to define the report.
Schedule at 00:00 the report as background job.
I hope will problem will be solved
Regards
Bhupal reddy
‎2006 Dec 07 10:35 AM
the report can't be downloaded using GUI_DOWNLOAD in background.
Use OPEN DATASET AND CLOSE DATASET.
‎2006 Dec 07 10:37 AM
Hi Senthil ,
For the program to run at a perticular time you will have to schedule the program to run at that time .
What is it you want to download an internal tabel of the output report.
Regards
Arun
‎2006 Dec 07 11:22 AM
thanx for all your replies
anymore comment on this issue
senthil
‎2006 Dec 07 11:54 AM
Hi Senthil,
background jobs can not use any GUI functionality. Inbackhround there is no client and so there is no dowlnload.
Only OPEN DATASET and TRANSFER can be used to store data on a server that is directly connected to the SAP server.
I hope e:\ is a windows drive mapped to SAP system running on WINDOWS server.
Otherwise you may consider to use ftp server or send as email attachment.
[This is an addition to the gelpful comments already posted].
Regards,
Clemens