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: 

Problem in fm ; FTP_R3_TO_SERVER'

0 Kudos
567

Hi,

     I am facing problem while using this function module : FTP_R3_TO_SERVER'.

i want to transfer data from SAP to  FTP server in  (.CSV) file. still through my program everything is ok.means i am able to transfer data from SAP TO FTP server in .CSV format. but client requirement is

Example : suppose on FTP server already 2 record exist in .CSV file when i create new two record ithrough my problem means from SAP.

that time  2 record which  already available on FTP server refresh and 2 newly created records getting paste on that FTP server .CSV file.

but i dont want like that . i want when i create new 2 record that time this 2 record and old 2 record must be display in .CSV file on FTP server.

currently new records gets replaced by old record but i dont want that please help me to fulfill this requirement.

Thanks,

Yogesh

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
169

Try to use in sequence

  • HTTP_SCRAMBLE
  • FTP_CONNECT
  • FTP_COMMAND (multiple if you want)
  • FTP_DISCONNECT

In the call of FTP_COMMAND: use the append command and not the usual put command.

Regards,

Raymond

6 REPLIES 6

Patrick_vN
Active Contributor
0 Kudos
169

Try loading the data from the existing (or old) file, append the new data, and write the complete new file (containing both old and new records) back to the FTP server.

SimoneMilesi
Active Contributor
0 Kudos
169

Hello Yogesh,

You mean you want to merge your actual file to be transferred with the one on destination folder if exist?

In this case

  1. via FTP_COMMAND copy the file from destination folder to your temporary folder.
  2. Read the file from temporary folder
  3. append rows in your new file
  4. transfer file as you already do

raymond_giuseppi
Active Contributor
0 Kudos
170

Try to use in sequence

  • HTTP_SCRAMBLE
  • FTP_CONNECT
  • FTP_COMMAND (multiple if you want)
  • FTP_DISCONNECT

In the call of FTP_COMMAND: use the append command and not the usual put command.

Regards,

Raymond

0 Kudos
169

HI Raymond,

Your reply was useful. But append command returns subrc = 0 but not appending data into file.

Waiting for reply from you all SAP Gurus.

Thanks&Regards,

Srinath R

0 Kudos
169

Check the returned itab DATA from FTP_COMMAND, it contains a log of execution of the command, you can find some message and the command actually executed.

Regards,

Raymond

0 Kudos
169

Hi Raymond,

Thanks for you quick response.

Yeah. In the itab DATA i get the log like..

1.append \file.csv

2.192 bytes transferred successfully..

and so on like this.

But I found that record is not appended in the file.

Waiting for your reply.

Thanks&Regards,

Srinath R