Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV reports- list display

Former Member
0 Kudos

Hi,

I need to download a report and save it to a unix directory defined by a variant. Please help me out with this.

7 REPLIES 7

Former Member
0 Kudos

Hello,

Can you provide me some more information.

Thanks,

Sridhar.

Former Member
0 Kudos

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.

0 Kudos

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

former_member705122
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

check the link it will be usful for you.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.