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

Download a file from application server(UNIX) to ftp server on windows

Hi

I have to move a file from UNIX to ftp server(WINDOWS)R:\SAPRpts\User Reports\abc.xls. Iam using 4.6C version. so what is the procedure and how should i send the file.

Thanks in advance

Satya

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Oct 25, 2006 at 03:49 AM

    Use the Function module <b>SXPG_COMMAND_EXECUTE</b>.

    data: begin of IEPCOL occurs 100.

    include structure BTCXPM.

    data: end of IEPCOL.

    • BTCXPM = Log message from external program to calling program

    data: W_STATUS like EXTCMDEXEX-STATUS.

    • EXTCMDEXEX = Parameters of SXPG_COMMAND_EXECUTE

    data: W_HOST like RFCDISPLAY-RFCHOST.

    • RFCDISPLAY = Display structure for RFCDES maintenance "M5

    • The External operating system command ZECOM is created using the transaction SM69. For any changes to the command goto SM69 and for executing and testing use the transaction SM49.

    W_HOST = SY-HOST.

    call function 'SXPG_COMMAND_EXECUTE'

    exporting

    COMMANDNAME = 'ZECOM'

    ADDITIONAL_PARAMETERS = P_F_UNIX

    OPERATINGSYSTEM = SY-OPSYS

    TARGETSYSTEM = W_HOST

    STDOUT = 'X'

    STDERR = 'X'

    TERMINATIONWAIT = 'X'

    importing

    STATUS = W_STATUS

    tables

    EXEC_PROTOCOL = IEPCOL

    exceptions

    NO_PERMISSION = 1

    COMMAND_NOT_FOUND = 2

    PARAMETERS_TOO_LONG = 3

    SECURITY_RISK = 4

    WRONG_CHECK_CALL_INTERFACE = 5

    PROGRAM_START_ERROR = 6

    PROGRAM_TERMINATION_ERROR = 7

    X_ERROR = 8

    PARAMETER_EXPECTED = 9

    TOO_MANY_PARAMETERS = 10

    ILLEGAL_COMMAND = 11

    WRONG_ASYNCHRONOUS_PARAMETERS = 12

    CANT_ENQ_TBTCO_ENTRY = 13

    JOBCOUNT_GENERATION_ERROR = 14

    others = 15.

    if SY-SUBRC <> 0.

    case SY-SUBRC.

    when 1.

    message E138(ZSM) with 'No permission to Execute ' 'External O/S command'.

    when 2.

    message E138(ZSM) with 'External O/S Command not found'.

    when 3.

    message E138(ZSM) with 'Parameters too long.' 'Exceeds the limit of 128 characters'.

    when 4.

    message E138(ZSM) with 'Security risk. ' 'The Command contains impermissible characters'.

    when 5.

    message E138(ZSM) with 'Wrong check call interface. Check the command.'.

    when 6.

    message E138(ZSM) with 'Error while starting the External O/S Command'.

    when 7.

    message E138(ZSM) with 'Error getting the return ' 'code of the External O/S command'.

    when 8.

    message E138(ZSM) with 'Unknown error'.

    when 9.

    message E138(ZSM) with 'Some mandatory parameter is not supplied'.

    when 10.

    message E138(ZSM) with 'Too many parameters. ' 'Check the additional parameter'.

    when 11.

    message E138(ZSM) with 'Illegal command'.

    when others.

    message E138(ZSM) with 'Unknown error'.

    endcase.

    else.

    if W_STATUS = 'O'.

    if UNIX_FILE cs '.ES'.

    message S138(ZSM) with 'File FTP Successfull..!'.

    • External O/S command to' 'FTP the above file to' 'ES FTP server succesfully!' P_F_UNIX.

    endif.

    else.

    message I138(ZSM) with 'Ext O/S command to FTP the ' 'abv file to ext UNIX system not executed due to:'.

    loop at IEPCOL.

    write:/ SY-TABIX, IEPCOL-MESSAGE,255 ' '.

    endloop.

    endif.

    endif.

    endform. " TRIGGER_EXT_OS_COMMAND

    Regards

    - Gopi

    Message was edited by: Gopi Narendra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 04:40 AM

    Please try with transaction: CG3Y.

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 08:17 AM

    Hi Satya,

    Use transaction codes CG3Y and CG3Z for moving files b/w servers.

    Regards,

    Chandra.

    Note: Please reward if helpful.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.