06-18-2008 9:37 AM
Hi,
I need to download a report and save it to a unix directory defined by a variant. Please help me out with this.
06-18-2008 10:02 AM
06-18-2008 10:05 AM
Hi,
In the ALV report there is a button on application toolbar to download the report.Select proper format and save it to the directory.
06-18-2008 10:09 AM
Hi,
Use a FM F4_DXFILENAME_TOPRECURSION for downloading data to the application server and also using the same FM for retrieving the data from appl. server
Thanks
Vikranth
06-18-2008 10:06 AM
Hi,
*open a new file on the application server for output...
OPEN DATASET APPPATH FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC NE 0.
WRITE: / 'There was an error opening the file in output mode:',
ENDIF.
*write data to file...
TRANSFER ITAB TO APPPATH.
*close file on application server...
CLOSE DATASET APPPATH.
Regards
Adil
06-18-2008 10:13 AM
06-18-2008 10:16 AM
check this..
for the unit directory use this..
*-- Read the Values entered in the selection screen.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = it_scrfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
for writing the file use this...
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
if sy-subrc ne 0.
message e368(00) with 'Error opening output file:' p_file.
endif.
LOOP AT it_final INTO wa_final .
TRANSFER wa_final TO p_file .
ENDLOOP.
IF sy-subrc = 0.
MESSAGE s043 WITH 'Data downloaded succesfully'(014).
ENDIF.
CLOSE DATASET p_file.
06-18-2008 10:17 AM
Hi,
You have an option to download the report to presentation server. Then using TCODE CG3Z upload the file to application server. Then you go with the following links.
i think you can do this with FTP.
Please go through the following links for FTP and UNIX & FTP.
Here is an example of how to FTP a file from the Application server to a remote server using standard SAP functions.
http://abap4.tripod.com/FTP_Using_SAP_Functions.html
How to access UNIX .
http://sapabapnotes.blogspot.com/search/label/Unix%20and%20FTP
Hope this may help you.
Thanks and regards.