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 from sap server

Former Member
0 Likes
690

Hi,

I need to transfer my file from sap server directory to a location at ftp.

I just cant figure out how to reach that directory. I wrote to that directory with open dataset but cant transfer it.

I am trying this program to test my command lines

RSFTP002

my sap server directory is when i check al11 it shows

E:\usr\sap\PDD

How should i write this in that program as parameter command

i tried

lcd /usr/sap/PDD

it says invalid directory

Also in my code

CONCATENATE 'lcd' w_file_path INTO command SEPARATED BY space.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

handle = mi_handle

command = command

TABLES

data = mtab_data

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

CHECK sy-subrc = 0.

i just get same error please help me what to write for the file path

Thank you

Hi,

I need to transfer my file from sap server directory to a location at ftp.

I just cant figure out how to reach that directory. I wrote to that directory with open dataset but cant transfer it.

I am trying this program to test my command lines

RSFTP002

my sap server directory is when i check al11 it shows

E:\usr\sap\PDD

How should i write this in that program as parameter command

i tried

lcd /usr/sap/PDD

it says invalid directory

Also in my code

CONCATENATE 'lcd' w_file_path INTO command SEPARATED BY space.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

handle = mi_handle

command = command

TABLES

data = mtab_data

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

CHECK sy-subrc = 0.

i just get same error please help me what to write for the file path

Thank you

3 REPLIES 3
Read only

andreas_mann3
Active Contributor
0 Likes
622

better use rsftp004 !

grx

Andreas

Read only

himanshu_gupta2
Participant
0 Likes
622

Hi,

First you have to connect to the ftp using FTP_connect which ask for the id, password and HOST name , which return the handle.

Then pass the command either binary or ascii , the type of file you want to trasfter as in ftp_command along with the handle.

then again make one more command

put /usr/tmp/abc.txt   /home/td_F/abc.txt

and again call the ftp_command with the handle you get during the ftp connect.

it will transfer the file.

Note: It will recognize the local commands or file path .

for eg put c:\test to /home/td_F/abc.txt

for this you have to require the put it into the application server then FTP it.

Read only

Former Member
0 Likes
622

Hi,

Thank you for answers.

I solved it. The problem was the ftp connection options from sm59. SAPFTP from aplication server solved it.