cancel
Showing results for 
Search instead for 
Did you mean: 

FTP_CONNECT failed for SAPFTP from WD4A to external Server

Former Member
0 Kudos

Hi experts,

this is a challange to you.

He do have a WD4A application runnig on a BI with SAP NetWeaver 2004s and a SAP BASIS 700 Level 21 highest Support package SAPKB70021.

The application runs well and only some strange behaviors in CZ and HU we have obtained. But this is not the Question i will ask:

For an excel template download we will use at an external MS Server2003. We want to sent the data string which has to

be displayed in excel via FTP to this server (The server will convert the data string with makros and send it back zu WD4A).

So far so good. But every time we tried to open the connection with FTP_CONNECT we the communication failed.

What do we do exactly?

1. Event through Button

1. Creating the data string on Eventhandler method (View)

2. using a Function Call from Eventhandler to start the file transfer.

3. Parameters are user, pwd, host, destination ...

4. with HTML_SCAMBLE hint pwd

5. call function 'FTP_CONNECT'

The connection failed.

WE DO CALL the Function correct, cause testing FTP_CONNECT with Program RSFTP002 the connection works.

IF we start the Function Call we use inside the WD4A outside the WD4A, the connection works.

We do have an ITS Service which works on this Server. An RFC CALL to the ERP R/3 with the same Function Call fails also as the Call in BI.

Does anyone know, if there are technical limits to WD4A to use the connections to an external server via SAPFTP ? It is forbidden to mount the file system of the server directly on the SAP BI System.

Our Basis and Network guys would not find anything.

At least: WE do use an Excel download with templates without using the MS Server. Therefore we have problems with different MS Office Versions, Language and date display. Thats why we want to go the way above.

lot of greetings

Thorsten

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can't use FTP_CONNECT with the default destination of SAPFTP from Web Dynpro. If you look at this RFC destination in SM59 you will see that SAPFTP uses the SAPGUI connection and the executable on the client side to perform the FTP operation. Instead override the RFC_DESTINATION importing parameter and use SAPFTPA instead. The A in SAPFTPA stands for Application Server. In this case the FTP operation will be done relative to the file system of the ABAP application server.

Former Member
0 Kudos

Hi Thomas,

that is what we obtained yesterday. The user dismatched on the Server.

Now we have generated the SAPFTPA and the connection works.... until we arrive FTP_R3_TO_SERVER and than the FTP interups. Getting a cerror of 4, after tried the path.

Okay we'll have a look at this new topic.

Thanks for your help and the reply

Thorsten

Answers (1)

Answers (1)

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

where exactly is the FM crashing and why? Did you debug? Is it occuring at

CALL FUNCTION 'FTP_CONNECT' DESTINATION RFC_DESTINATION
     EXPORTING USER = USER PWD = PASSWORD ACCT = ACCOUNT HOST = HOST
               TRACE = FTP_TRACE GUSER = GATEWAY_USER
               GPWD = GATEWAY_PASSWORD GHOST = GATEWAY_HOST
     IMPORTING HANDLE = HANDLE ERROR = CERROR
     EXCEPTIONS SYSTEM_FAILURE = 1 COMMUNICATION_FAILURE = 2.

or earlier?

Try tracing with ST01, one time with the way it works, and another time out of the WebDynpro where it crashes, then compare the logs.

regards, Lukas

Former Member
0 Kudos

Hi Lukas,

it's just the position where the connection failed. But if you read the reply from Thomas Jung, this will explain the problem. As we have a look at the trace files we see, the the conncetion will be tried with SAP User and not with the given user and pwd.

This behavoir is exactly what i expect when SAPFTP uses SAPGUI connection.

Know we try to get the SAPFTPA which is not generated automaticly in our BI.

Thanks for your reply.

Thorsten