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: 

How to keep FTP connection from getting hung-up or disconnecting?

Hi,

I have a requirement where I have to retrieve 6 files based on set of names from a FTP destination.

These six files represent data for one plant and I am looping plant wise to get all files and updating in custom tables.

problem is connectivity gets disrupted after random GET file attempt in FTP_SERVER_TO_R3 and it keeps

processing and nothing else gets updated.

I have checked with network issues and didn't find any.

I have also tried reconnecting FTP_CONNECT after every loop iteration and still problem persist.

program gets stuck only at FTP_SERVER_TO_R3 and doesn't go forward.

Thanks guys

5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

Did you try the pseudo-code below with FTP_DISCONNECT?

LOOP AT files ...
  CALL FUNCTION 'FTP_CONNECT' ...
  CALL FUNCTION 'FTP_SERVER_TO_R3' ...
  CALL FUNCTION 'FTP_DISCONNECT' ...
ENDLOOP.

(edit: I replaced FTP_R3_TO_SERVER with FTP_SERVER_TO_R3 after Jagadeesh remark and Nida confirmation)

Sandra_Rossi
Active Contributor

Please obfuscate your user, password, IP address, and so on

former_member596005
Participant

I think you should use ftp_server_to_r3 in place of ftp_r3_to_server because ftp_r3_to_server to place files in FTP directory ,iam not sure about it but just try with ftp_server_to_r3 once.

0 Kudos

Hi Jagadesh,

Yes I used server to r3 FM and not the one mistakenly typed before.

Issue is same as mentioned ,processing stops randomly at FM before fetching file in CSV format.

I am only fetching files I know to be present in FTP location and all parameters passing into FM are correct as seen in debugger.

Regards

srikanthnalluri
Active Participant
0 Kudos

Run the standard programs RSFTP007 and RSFTP008 to make sure nothing wrong with your program.

I believe you no need to connect to FTP for each file. Is it happening for all the files or just happening randomly?