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 anonymous connection problem

Former Member
0 Likes
2,400

Hi,

 

We try to connect to a Zebra printer using FTP through SAP to print local text file.

I used the program RFSTP002 for testing the connection:

User : anonymous

 

Pwd : none

 

Host: xx.x.x.xxx  (the host is the IP of the
Zebra printer)

 

And I’m getting the following error using the trace program RFSTP001

And here is the trace:

 

trc file:
"dev_ftp", trc level: 2, release: "730"

[Thr 7136]
Tue Feb 26 15:42:52 2013

[Thr 7136]
[7152] sccsid:@(#) $Id: //bas/720_REL/src/krn/ftp/ftpmain.c#9 $ SAP

[Thr
7136]  @(#) $Id:
//bas/720_REL/src/krn/ftp/ftp.c#2 $ SAP

[Thr
7136]  @(#) $Id:
//bas/720_REL/src/krn/ftp/ftpcmd.c#3 $ SAP

[Thr 7136]
sapftp.ini file path : C:\Program Files\SAP\FrontEnd\SAPgui\sapftp.ini

[Thr 7136]
SAPFTP Passive mode set to = 0

[Thr 7136]
[7152] FTP Start :argc - 6 a0 - sapftp

[Thr 7136]
/H/x.x.x.x [Thr 7136] sapgw01 [Thr 7136] 13040786 [Thr 7136] CPIC_TRACE=2 [Thr
7136] ID

X=4 [Thr 7136]

[Thr 7136] [7152] Environment SAP_CODEPAGE = 1160

[Thr 7136]
[7152] RFC Version 730

[Thr 7136]
[7152] RFC DLL loaded

[Thr 7136]
[7152] Install server functions

[Thr 7136]
[7152] Call RfcAccept

[Thr 7136]
[7152] Enter RfcDispatch loop

[Thr 7136]
Tue Feb 26 15:42:53 2013

[Thr 7136]
[7152] Partner codepage 1100

[Thr 7136]
[7152] connect request host :xx.x.x.xxx , user : anonymous

[Thr 7136]
[7152] Connected to xx.x.x.xxx Port 21.

[Thr
7136]  - NI handle: 1

[Thr 7136]
[7152] FTP server : 220 ZBR-79071 Version V53.17.7Z ready.

[Thr 7136]
[7152]    > USER anonymous

[Thr 7136]
[7152] FTP server : 230 User logged in.

[Thr 7136]
[7152]    > *****

[Thr 7136]
[7152] FTP server : 503 Bad sequence of commands.

[Thr 7136]
[7152] FTP disconnect - NI handle : 1

[Thr 7136]
[7152]    > QUIT

[Thr 7136]
[7152] FTP server : 221 Service closing control connection. Bye...

[Thr 7136]
[7152] FTP Stop

Regards,

5 REPLIES 5
Read only

former_member215575
Active Participant
0 Likes
1,652

Hi Daniel,

I have a query.

Daniel Cantin wrote:

I used the program RFSTP002 for testing the connection:

User : anonymous

 

Pwd : none

 

[Thr 7136]
[7152]    > USER anonymous

[Thr 7136]
[7152] FTP server : 230 User logged in.

[Thr 7136]
[7152]    > *****

[Thr 7136]
[7152] FTP server : 503 Bad sequence of commands.

In selection screen of RFSTP002 have you given any input for Password field?

From trace file and after checking some of my previous programs, I believe it should be left blank (No input) or an input '!' can be given.

In trace log, it seems after user is already logged in, password(*****) is provided as command to FTP server and resulted in error. 

Regards,

Sravan Guduru.

Read only

0 Likes
1,652

We have tried with blank password and with “!” as password and we still have the same
problem.

Regards.

Read only

0 Likes
1,652

It of course depends on how the Zebra FTP server is implemented but a typical password in case of an anonymous user can also be any e-mail address in the format of user@address.

That said I suspect something else is going on. I would first make sure the Zebra FTP server works by using any FTP client and logging all commands sent to the server and the responses. Then reproduce the problem with RFSTP002. It might be that as the "FTP server : 503 Bad sequence of commands" error indicates that the client (RFSTP002) might not be issuing the required FTP commands or it is issuing them in the wrong order.

Read only

0 Likes
1,652

Hi,

     You can see that when we try to connect from CMD command everything work fine. So it is difficult to understand why it is not working from SAP side.

Regards,

Read only

0 Likes
1,652

I don't have access to SAP right now but maybe the problem is that RFSTP002 always expects to send a password. Looking at your screenshot, the Zebra FTP server isn't requesting for one. Just copy the program RFSTP002 to ZRFSTP002 and comment out the part where the password is sent to the FTP server and see if it works.