Application Development and Automation 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: 
Read only

FTP_CONNECT

Former Member
0 Likes
673

Hi,

I have used FTP_CONNECT and then FTP_COMMAND. FTP_CONNECT is successfully executed but FTP_COMMAND fails.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING HANDLE = HDL COMMAND = CMD1

TABLES DATA = RESULT

EXCEPTIONS TCPIP_ERROR = 1 COMMAND_ERROR = 2.

IF SY-SUBRC <> 0.

WRITE:/ 'Cannot execute ',CMD1 ,/ 'error = ', SY-SUBRC.

ENDIF.

I am getting sy-subrc as 1.

Could anyone please under what all conditions do we get TCPIP_ERROR.

Thanks,

Priya

Hi,

I have used FTP_CONNECT and then FTP_COMMAND. FTP_CONNECT is successfully executed but FTP_COMMAND fails.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING HANDLE = HDL COMMAND = CMD1

TABLES DATA = RESULT

EXCEPTIONS TCPIP_ERROR = 1 COMMAND_ERROR = 2.

IF SY-SUBRC <> 0.

WRITE:/ 'Cannot execute ',CMD1 ,/ 'error = ', SY-SUBRC.

ENDIF.

I am getting sy-subrc as 1.

Could anyone please under what all conditions do we get TCPIP_ERROR.

Thanks,

Priya

4 REPLIES 4
Read only

Former Member
0 Likes
637

Hi Priya,

What is the command you are passing in the variable CMD1? Also tell me

1. how have you declared the variable?

2. Is the handle HDL same you have imported from FTP_CONNECT.

- Guru

Read only

0 Likes
637

Hi Guru,

This code was working fine till 22-Dec. It is suddenly started giving problem.

The command I am passing is PUT with file name. and HDL is declared

Thanks,

Priya

Read only

0 Likes
637

That's P**G.

- Guru

Read only

0 Likes
637

Can you post your code, i guess that can help.

As Guru mentioned, check that HDL you are passing to FTP_COMMAND is having the value imported from FM: FTP_CONNECT.

i.e when we execute FTP_CONNECT we get value for Handle. Pass the same value for FTP_COMMAND.

As you were saying, the command executed is for PUT. Is it with reference to two servers. In this case we need to connect to both servers, then execute this command with handle of the destination server.

Regards

Eswar