Skip to Content

Problem with Put and ls FTP commands.

Hello guys,

When iam FTPcommand function module or RSFTP002 program with ls or put command following exception is raising


NIECONN_BROKEN:TCP/IP Network Connection Broken in getreply()

TCP/IP error, connection terminated.

Its working fine for any other commands like PWD,cd etc.

Please help me in getting resolved.

Add a comment
10|10000 characters needed characters exceeded

  • Check with your network admin, this is not related to Abap development. Else post your (relevant part of) code and reformulate (did you call FTP_CONNECT before FTP_COMMAND, etc.)

    NB: Did you already read a document such as The SAPFTP Library - FTP Programming in ABAP

  • 1) Maybe it's an invalid command?

    You shouldn't confuse the FTP commands which are proposed by FTP clients, and those which are understood by FTP servers.

    FTP clients interpret and convert your commands into FTP commands defined under RFC959 and sent to the server.

    Could you try NLST instead of LS (should be equivalent).

    2) Maybe it could work if you first set the passive mode (command PASV)

  • Thx for the feedback, you may convert your comment into an answer for a better visibility.

    PS: I guess my first point is completely non-sense, because the SAP FTP interface is based on the `sapftp` program which is a client with the classic commands "ls", "set passive on", etc. The RFC959 commands (NLST, PASV, ...) can still be used by direct transfer to the server via the command "quote" (e.g. quote NLST /dir1/dir2), though.

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jun 26, 2019 at 04:22 PM

    Hi sandra ,

    Resolved the issue , as you mentioned Passive mode should be on when Ftp servers are behind firewalls or NAT gateway. Ran the 'Passive mode on ' command before the put command everything is working fine.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 26, 2019 at 02:10 PM


    Did you check the SAP note 633391

    or you can try download the file using ftp_SERVER_TO_R3 and upload it to the new location using FTP_R_3_TO_SERVER



    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.