Skip to Content
author's profile photo Former Member
Former Member

upload and download

Hi,

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

Regards,

Subbu

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2007 at 06:40 AM
    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 28, 2007 at 06:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2007 at 06:49 AM

    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

    Add comment
    10|10000 characters needed characters exceeded