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: 

upload and download

Former Member
0 Kudos
86

Hi,

how can we upload data to unix server and download it to pc file later?

Regards,

Subbu

3 REPLIES 3

Former Member
0 Kudos
47

Hi,

Use the key words;

Use the FM "FILE_GET_NAME" to get the file name and path....

1.OPEN DATASET FOR INPUT / FOR OUTPUT

2.TRANSFER

3.CLOSE DATASET

If the hint is useful… Say thanks by reward….

Regards,

Prabhu Rajesh

Former Member
0 Kudos
47

Hi,

follow the code

  • Retrieve data file from presentation server(Upload from PC)

DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.

DATA: begin of it_datatab occurs 0,

row(500) type c,

end of it_datatab.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = i_file

filetype = 'ASC'

TABLES

data_tab = it_datatab "ITBL_IN_RECORD[]

EXCEPTIONS

file_open_error = 1

OTHERS = 2.

  • Retrieve Data file from Application server(Upload from Unix)

DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.

OPEN DATASET i_file FOR INPUT IN TEXT MODE.

IF sy-subrc NE 0.

MESSAGE e999(za) WITH 'Error opening file' i_file.

ENDIF.

DO.

  • Reads each line of file individually

READ DATASET i_file INTO wa_datatab.

  • Perform processing here

  • .....

ENDDO.

please reward if of any use.

vivekanand