Expert Answer Center > Experts On Demand > View Answer
EMAIL THIS
Experts on Demand
  EXPERTS ON DEMAND HOME     POSE A QUESTION     VIEW ANSWERS     BROWSE BY TOPIC        RSS FEEDS  
Hello, Matthew. Can you explain how to bring a text file from a different server into my ABAP or SAP server. The servers (SAP and other) are mapped to each other (although they are in different domains and have no trust between them), and I need to FTP the file so that I can process the data with the ABAP. The Windows FTP function is giving me problems, and I would like to FTP directly from my ABAP. I've had a look at the standard program RSEPSFTP, but this does not allow for the creation of variants, which I need, to run the program at 1:00 a.m. Thank you for any advice/explanation. QUESTION POSED ON: 06 SEP 2004
QUESTION ANSWERED BY: Matthew Billingham You need to set up a command in SM69 with additional parameters. For Unix, the command is "sh", which runs a shell script.

Create the needed FTP commands as an FTP script in ABAP in an internal table. Transfer the FTP script as a file to your server using:

      open dataset script_file 
        for output 
        in text mode. 
      loop at script. 
        transfer script to script_file. 
      endloop.
Where script_file is the output file name. Then you create the Unix shell script, which calls the FTP script, and transfer that to your server.

Call function module SXPG_CALL_SYSTEM to launch your shell script (using the command you set up earlier), which will then call the FTP script, and your FTP is performed.

You can do the same with other OSes with different commands, but the principle is the same. You could set up the FTP as a command directly, but doing the two-step approach allows more flexibility (e.g., moving the source file to another directory after the FTP).

HomeExperts on DemandIT Expert Webcast SeriesExpert KnowledgebaseSite Index
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts