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

SAP to another server using FTP

Former Member
0 Likes
1,139

Hi all,

I want to put a file from SAP to another server. Im trying with FTP I tried with the following FM's in sequence,

'HTTP_SCRAMBLE'

'FTP_CONNECT'

'FTP_R3_TO_SERVER'

'FTP_DISCONNECT'

'RFC_CONNECTION_CLOSE'

Here the FM FTP_CONNECT is returning me the following error

User <xxxx> has no access authorization for <server I requested>, but I was able to connect to the same server using the same user id from Command prompt of my desktop. Kindly advise me on this...

Thank you,

Sarath.C

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,079

Hi,

i think it is RFC Destination problem.

did u created the RFC Destination in sm59 type TCP/IP

Check this one .

Reward Points If Useful.

Thanks&Regards,

srinivas

Hi,

i think it is RFC Destination problem.

did u created the RFC Destination in sm59 type TCP/IP

Check this one .

Reward Points If Useful.

Thanks&Regards,

srinivas

8 REPLIES 8
Read only

Former Member
0 Likes
1,080

Hi,

i think it is RFC Destination problem.

did u created the RFC Destination in sm59 type TCP/IP

Check this one .

Reward Points If Useful.

Thanks&Regards,

srinivas

Read only

0 Likes
1,079

The RFC dest Im using is SAPFTP which is standard one and is created with TCP/IP.

Edited by: Sarath kumar Chandrasekharan on Jul 15, 2008 3:58 PM

Read only

0 Likes
1,079

Hello Sarath

You need to create a TCP/IP connection (type='T') to your FTP server and use this one.

Regards

Uwe

Read only

former_member435013
Active Participant
0 Likes
1,079

Hi,

functionality on OS level is executed with user from SAP system start.

Does that help?

regards

Walter Habich

Read only

0 Likes
1,079

Walter,

Should we create a separate user id of R/3 type to connect thru FTP from ABAP code..

Read only

0 Likes
1,079

Issue was related user access.

Read only

Former Member
0 Likes
1,079

hi check this..

REPORT ZFTPSAP LINE-SIZE 132.

DATA: BEGIN OF MTAB_DATA OCCURS 0,

LINE(132) TYPE C,

END OF MTAB_DATA.

DATA: MC_PASSWORD(20) TYPE C,

MI_KEY TYPE I VALUE 26101957,

MI_PWD_LEN TYPE I,

MI_HANDLE TYPE I.

START-OF-SELECTION.

Your SAP-UNIX FTP password (case sensitive)

MC_PASSWORD = 'password'.

DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.

FTP_CONNECT requires an encrypted password to work

CALL 'AB_RFC_X_SCRAMBLE_STRING'

ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY

ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD

ID 'DSTLEN' FIELD MI_PWD_LEN.

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

Your SAP-UNIX FTP user name (case sensitive)

USER = 'userid'

PASSWORD = MC_PASSWORD

Your SAP-UNIX server host name (case sensitive)

HOST = 'unix-host'

RFC_DESTINATION = 'SAPFTP'

IMPORTING

HANDLE = MI_HANDLE

EXCEPTIONS

NOT_CONNECTED = 1

OTHERS = 2.

CHECK SY-SUBRC = 0.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

HANDLE = MI_HANDLE

COMMAND = 'dir'

TABLES

DATA = MTAB_DATA

EXCEPTIONS

TCPIP_ERROR = 1

COMMAND_ERROR = 2

DATA_ERROR = 3

OTHERS = 4.

IF SY-SUBRC = 0.

LOOP AT MTAB_DATA.

WRITE: / MTAB_DATA.

ENDLOOP.

ELSE.

do some error checking.

WRITE: / 'Error in FTP Command'.

ENDIF.

CALL FUNCTION 'FTP_DISCONNECT'

EXPORTING

HANDLE = MI_HANDLE

EXCEPTIONS

OTHERS = 1.

Read only

Former Member
0 Likes
1,079

Hi Sarath Kumar.

I would like to suggest to you some references, it is quite similar to your issue,

[SDN - Reference for Transfering data from SAP to other systems using FTP|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5564] [original link is broken] [original link is broken] [original link is broken];

[SDN - Reference for Transfering file from one application server to another|;

Hope that's usefull.

Good Luck & Regards.

Harsh Dave