10-11-2011 3:44 PM
Hi guru's
I am trying to fetch files from External FTP Server and trying to place them in a specific folder in Application Server. My SAP App Server is UNIX based.
Called HTTP_SCRAMBLE
Called FTP_CONNECT
Called FTP_COMMAND
* STEP 1: TO GO TO EXACT FOLDER IN THE FTP SERVER*
Called FTP_COMMAND and passed the command
CD <Exact Location in FTP Server>
* STEP2: TO CHANGE THE DIRECTORY IN SAP APPLICATION SERVER WHERE FILES HAVE TO GET SAVED*
Called FTP_COMMAND and passed command
LCD <Exact Location in Application Server>
*STEP 3 :TO GET ALL FILES*
Called FTP_COMMAND and passed command
mget *
In STEP2 where I am trying to change the APPP server directory I always get a FTP_COMMAND Error , SY-SUBRC = 0.
In Command Prompt if i try connecting to the FTP server again in
LCD <Exact Location in Application Server>
I get an error saying the file not found.
I also checked my READ WRITE DELETE Access by calling Autority check and looks like I have all access to the Folders in SAP APP Server.
Is it an access issues? Unix command Issue? or SAP APP Server path issue? I had been searching hard in forums but was not of much help.
If some one can throw some light on this issue it would be of great help to me and others having similar issues.
Regards,
Sam
10-11-2011 3:51 PM
10-11-2011 3:51 PM
10-11-2011 3:56 PM
I am using standard SAPFTP
dest = 'SAPFTP'.
*Connect to FTP server
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = user
password = pwd
host = host
rfc_destination = dest
IMPORTING
handle = hndl
EXCEPTIONS
not_connected = 1
OTHERS = 2.
10-11-2011 4:07 PM
10-11-2011 4:25 PM
Hi
Yes Arseni is right
SAPFTP is ftp for presentation: so your pc
SAPFTPA is for application
(so that can explain your error: you are trying to download the file in a path of your pc, but that path doesn't exist)
This is not the rule, but the basis (or SAP) are use to call like above: if you want to make sure:
Run transaction SM59, node TCP/IP: here you can see how those RFC destination are defined
Max
10-11-2011 4:35 PM
hi Arsin & Max,
Thanks a lot for help. Now it works. Is there a way I can unzip the files when getting them and also sett he mode to ASCII?
Also will there be similar issues in Test and Production Server in terms of File paths etc?
Can I hard code the Application server paths in Dev? will they be same in test and prod? What other issues do we encouter delaing with FTP's
Regards,
Sam
Edited by: jessica sam on Oct 11, 2011 6:39 PM
10-11-2011 4:54 PM
Hi
I know there are several standard classes (like CL_ABAP_ZIP) but I'm not sure if they can unzip the files, you can give a look in the forum,
Else you can create a script or an external command
Max