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

outbound interface

Former Member
0 Likes
852

Hi Experts,

My job is to transfer data from SAP to AS400.

There are four files to be extracted and all the fouir has to trnsfered to AS400 FTP serever.

Actually it is said that " we require the extract data files to be FTPed to the AS400 FTP server".

what does this mean exactly . Is this the standard FTP process or any extra coding required for this.

I assume "We only need to download these files to the specified file folder." - PL CONFIRM.

Regards,

Siri.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
796

process will be like this

files exits on PC,

from PC->SAP server->u have to connet FTP of AS400---> here u have to PUT these files.

Regards

Prabhu

7 REPLIES 7
Read only

Former Member
0 Likes
797

process will be like this

files exits on PC,

from PC->SAP server->u have to connet FTP of AS400---> here u have to PUT these files.

Regards

Prabhu

Read only

0 Likes
796

Prabhu,

Can u explain it in a better way.

Is this coding enough for this.

GUI_DOWNLOAD the data from SAP

OPEN_DATASET.

if sy-subrc= 0.

loop at itab.

transfer itab to dataset.

Help me.

Can we do this without using the selection screen for giving the file path.

Regards,

siri.

Message was edited by:

sireesha yalamanchili

Read only

0 Likes
796

1.Upload Required Files into SAP.Here u can save on SAP application server or leave it ?, So get data into Internal tables.

2.Call FTP FM , from here u have to call that FTP server and write files into that Server.

pleasee check for the FM's , i forgotten the FM names which are useful in this case.

<b>IN FTP: we will do only 2 things,

1.GET

2.PUT.

get ---> which files u want to write in FTP , here u will get the data , in ur case ,data already with u , so no need to use GET.

PUT--->writing files into FTP server.</b>

Message was edited by:

Prabhu Peram

Read only

0 Likes
796

Prabu,

Already required data is avilable in SAP. I a m asked to download the data an d FTPed to it to AS400FTP server.

where exactly i have tyo use this FTP FM and what are they can anyone help me out.

Regards,

siri.

Read only

0 Likes
796

Hi ,

Can someone send a small sample code for this kind of interface. I feel it is not just normal interface with simple coding.

Regards,

siri.

Message was edited by:

Saravanan Ramasamy

Read only

0 Likes
796

Prabhu,

Could u plz send sample code for this kind of interface.

points sure.

regards,

siri

Read only

0 Likes
796

Hi,

For doing FTP initially you need to establish the FTP connection i.e with Fm 'FTP_CONNECT' .

for this you need to pass Remote server IP address(HOST), username,pwd(scrambled) and RFC destination.

Connect to the FTP server

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

USER = WA_ZK2_FILE_POLL-USER_NAME

PASSWORD = G_PASSWORD “scrambled pwd”

HOST = WA_ZK2_FILE_POLL-SERVER_IP

RFC_DESTINATION = 'SAPFTP'

IMPORTING

HANDLE = G_FTP_HANDLE

EXCEPTIONS

NOT_CONNECTED = 1

OTHERS = 2.

After successful connection to execute the commands like ‘lcd’ for to set(source path) , ‘cd ‘ for to set(destination path)

‘put’ to transfer the file to remote (AS400) server from local( SAP)and if require ‘get’ to get files from remote to local.

CONCATENATE 'cd' WA_ZK2_FILE_POLL-REMOTE_FOLDER

INTO G_CMND SEPARATED BY SPACE.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

HANDLE = G_FTP_HANDLE

COMMAND = G_CMND

TABLES

DATA = MTAB_DATA

EXCEPTIONS

COMMAND_ERROR = 1

TCPIP_ERROR = 2.

IF SY-SUBRC <> 0.

P_ERROR = C_X.

ENDIF.

Likewise you need pass the each unix command(lcd,put,get) to the above FM

Finally use FTP_DISCONNECT to close the connection

CALL FUNCTION 'FTP_DISCONNECT'

EXPORTING

HANDLE = G_FTP_HANDLE

EXCEPTIONS

OTHERS = 1.

  • CONTINUE.

ELSE.

PERFORM FTP_CONNECTION_ERROR.

WRITE:/ ' Connection failed for ', WA_ZK2_FILE_POLL-SERVER_IP.

ENDIF.

Please check this weblog.

/people/thomas.jung3/blog/2004/11/15/performing-ftp-commands-from-abap

Refer following standard programs for further details

RSFTP001 SAPFTP version

RSFTP002 Execute FTP Command

RSFTP003 Test

RSFTP004 FTP copy

RSFTP005 SAPFTP check

RSFTP006 FTP command list

I hope above info is helpful to you…

Reward points if needful…