Application Development 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: 

extract files from external server..

Former Member
0 Kudos

Dear Friends,

I need to connect to an external non SAP server, from which i need to extract invoice files.

Invoice files are of two types:

1. .dat format files which contain invoice data

2. .PDF or .JPEG documents, which are supporting documents for those invoice.

My question are

1. How do i connect to the external server?

2. Do i have to do a FTP from SAP to that file server?

3. Do i have to fetch the .dat file using dataset statments?

4. What are the basis and network related activities involved to get connected to that external server?

Any inputs and help on this is highly appreciated and rewarded.

Thanks,

Simha

Edited by: Simha on May 30, 2008 12:21 PM

2 REPLIES 2

Former Member
0 Kudos

Hi!

1., 4. - Depends on the external server/operating system type.

2. You have to create an setting for your FTP program on the server. After it is working at operating system level, you can call this FTP command with the following function module: SXPG_COMMAND_EXECUTE

3. OPEN DATASET ... CLOSE DATASET commands will help you.

I just found this one:

For single files you can use EPS_FTP_PUT or EPS_FTP_GET (depending on whether you push or pull your files).

For multiple files

EPS_FTP_MPUT and EPS_FTP_MGET.

CALL FUNCTION 'EPS_FTP_PUT'

Import parameters Value

RFC_DESTINATION = NONE

LOCAL_FILE = filename

LOCAL_DIRECTORY = /dir1/dir2

REMOTE_FILE = filename

REMOTE_DIRECTORY = /dir1

OVERWRITE_MODE = F " force -> overwrite existing file

TEXT_MODE = B " binary

TRANSMISSION_MONITOR X " display transmission monitor

*RECORDS_PER_TRANSFER 10

*REQUESTED_FILE_SIZE 0

*MONITOR_TITLE

*MONITOR_TEXT1

*MONITOR_TEXT2

*PROGRESS_TEXT

*OBJECT_NAME

Regards

Tamá

0 Kudos

Hi Tamás,

Thanks for your update.

Could you brief meon how to connect and the basis activity to set up the connectivity.

thanks in advance,

Simha