File send to FTP

Hi Friends,
I generated a file and i strored in application server, now i want to move the same file into server SAPFTP.
could u plz tell me how can I move this file to the servr SAPFTP?
thanks in advance.
with regards,
magesh.s

Hi,
Use these function module
FORM EPAPP_R3APP.
  SET EXTENDED CHECK OFF.
  SLEN = STRLEN( PWD ).
  CALL FUNCTION 'HTTP_SCRAMBLE'
    EXPORTING
      SOURCE      = PWD
      SOURCELEN   = SLEN
      KEY         = KEY
    IMPORTING
      DESTINATION = PWD.
"Connect to FTP server
  CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      USER            = USER
      PASSWORD        = PWD
      HOST            = HOST
      RFC_DESTINATION = DEST
    IMPORTING
      HANDLE          = HDL.
  CONCATENATE '/usr/sap/APD/JC00/j2ee/cluster/server0/'  NAME_WITH_EXT INTO E_FILE ."SEPARATED BY SPACE.
  CONCATENATE '/tmp/' NAME_WITH_EXT INTO TO_FILE . "SEPARATED BY SPACE.
  CMD1 = 'get'.
  CONCATENATE CMD1 E_FILE TO_FILE INTO CMD1 SEPARATED BY SPACE.
  IF CMD1 IS NOT INITIAL.
    "Execute FTP Command
    CALL FUNCTION 'FTP_COMMAND'
      EXPORTING
        HANDLE        = HDL
        COMMAND       = CMD1
        COMPRESS      = COMPRESS
      TABLES
        DATA          = RESULT
      EXCEPTIONS
        COMMAND_ERROR = 1
        TCPIP_ERROR   = 2.
    SIGNAL = SY-SUBRC.
    REFRESH RESULT.
  ENDIF.
Thanks
Ankur Sharma

Similar Messages

  • File sender adapter (FTP) - processing mode "Archive"

    Hello all
    We're polling files from an external FTP server. For this I created a scenario on XI according to this thread:
    When setting processing mode to "Archive" in the file sender adapter (ftp) it polls the file, stores it to the archive directory I specified and then tries to delete the file on the FTP server side. This returns me an error because we're not allowed to delete the retrieved files on the FTP server!
    Because of this error the file adapter stops further processing and does not poll all the other files.
    How can I disable this deletion mechanism while keeping processing mode to "Archive"?!?!?
    We do not want to use processing mode "Delete" or "Test" and we don't see other options to influence this behaviour.
    Thanks for any guideance on this one in advance!
    Kind regards,
    Renaud

    Hi Bhavesh
    Sorry for the late answer. Unfortunately I can't ask the application system to provide file names containing a timestamp within. The files are provided by an external partner and are retrieved by several others as well.
    In the meantime I managed to achieve this:
    In repository I created dummy data types, message types and message interfaces. No mapping programs and interface mappings!
    In configuration I created the necessary communication channels (1 ftp sender, 1 file receiver) and the required receiver and interface determinations as well as the sender and receiver agreements.
    The result of this is:
    I'm able to poll some specific files via ftp from remote host. The file names are file1.arj, file2.arj, file3.arj and file4.arj. All 4 files have the same SourceFileTimestamp (e.g. "20060727T053900Z").
    I'm able to store those 4 files 1:1 in a target directory with the same file names. Until here I did NOT need to follow this blog: <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a>.
    As of this blog it is possible to access adapter specific attributes and make them available in message mapping using user defined functions. This way I'm able to get the SourceFileTimestamp from the polled files and use it in a message mapping. This way I'm also able to use it in variable substitution on file receiver adapter (syntax = "payload:root,1,fileTS,1") in order to dynamically create a directory with this syntax: YYYYMMDD.
    So far so good... but the only remaining BIG problem now is, that as soon as the mapping is activated and assigned in the interface determination, the created files contain the XML payload instead of the original binary content. Where has it gone? How should the target message type look like so that it can carry over the original binary file content?
    BTW: isn't it possible to post screenshots? Would be much more easier to explain things... so sorry to anyone if I wasn't clear enough!
    TIA and best regards,
    Renaud

  • Sender channel FTP archive problems.

    Hi all,
    I'm trying to archive the file I upload from folder /xx/yy/filename.txt in folder /xx/yy/archive.
    In the Adapter monitor I can see that the archive is not succesful. It is trying to archive under /xx/yy/archive//xx/yy/filename.txt !!!!!!
    It looks like it the adapter is using the hole file reference "/xx/yy/filename.txt" as the new filename !!!!
    Can any one help me !!!!!

    Dear Frank,
    This might help you
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    You can archive files using Archive option of File Adapter.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    Archive flat file on different server
    File sender adapter (FTP) -> processing mode "Archive"
    Regards
    Agasthuri Doss

  • Need help to Configure FTPS connection for File Sender Adapter

    Hi,
    I want to Configure, FTPS connection (Secured Connection) for File Sender Adapter. Could anyone please guide me, what Information I require to configure. I just want to know what Information should I request the team inorder the configure FTPS so that it can be deployed properly.
    I have checked with [SAP Help Link|http://help.sap.com/saphelp_nw04/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm] and while configuring the communication channel found that I need Keystore and the X.509 Certificate and Private Key.  which needs to be deployed on the J2EE server by using the Visual Administrator.
    Is there anything else, I need to configure.
    Any help would be appreciated in this regard.
    Thanks & Regards,
    Varun.K

    The basic things are Certificate/Keys which you already know. Usually it is enough for running a sceanrio.
    However, if you have additional requirements, like FTPS for "Connection Security" for encryption, then you may need additional details like commands. Rest all settings are same as FTP.
    Regards,
    Prateek

  • Sending XML file from SAP to Windows Based file server with FTP function

    Hi Gurus,
    We are using SAP BW 3.0B version.
    I need to convert data in ODS to XML format and send this XML file to remote server which  is not a SAP application server, it is just a Window Based file server with FTP function..
    By writing some ABAP code I have converted ODS data into XML format (which gets saved in my local system)
    (Is that I need to put this file in Application Server to send it to the other servers? )
    Now the thing is how I can send this file to that Windows Based file server.
    plz suggest me.... what can be done......
    Thanks in Advance
    Madhusudhan
    Edited by: Madhusudhan Raju on Dec 3, 2009 4:25 AM

    I dont think the above code support windows OS. Because I always execute this script via UNIX.
    I think you can try this option, go to command prompt, goto the destination path where you have an XML file using cd....
    ftp (destination servername), specify the username and password.
    afterthat, use the command put and filename.
    check whether the file had reached destination successfully or not.
    For automation purpose, you can use the following script like
    ftp: -s: test.txt  (servername)
    In test.txt,
    UserName
    Password
    bin
    cd /files
    put file.xml
    bye
    Also, you can check in SM69, there will be some SAP external commands to automate the file transfer.
    Thanks
    Sat
    http://support.microsoft.com/?kbid=96269

  • Cant do a file get from external server using file sender adapter with ftp

    Hi all,
    Up until now our company has only used the file sender adapter with ftp protocol to get a file from our XI server for processing and input the file into an integration process
    I have a requirement to do an ftp file get from an external server
    From our XI development server I can ftp directly to the external server and view the required directory using the command window via a DOS prompt (FTP open ...).  So all firewall issues and communications are fine
    Unfortunately I cannot currently pull files from the external server using the XI file adapter with ftp protocol from the XI development server AWB017
    FTP Connection Parameters: External server name using port 21, Data Connection is Passive, No security, I supply a userid and password
    Processing Parameters: Processing Mode is Archive (I tried test but this did not work either)
    No messages appear in the RWB
    Is there something else that I need to set up in order for the external ftp get to work via the XI file adapter?
    Regards,
    Mike

    Thanks for your responses.
    I have found the error messages in the File Adapter Monitor
    Scenario 1
    When I prefix the source directory with a forward slash, eg <b>/Folder/Subfolder</b> the error message is as follows
    <b>EST: Error: Error connecting to ftp server 'ip address': FTPEx: /Folder/Subfolder: The system cannot find the path specified</b>
    Scenario 2
    When I DO NOT prefix the source directory with a forward slash, eg <b>Folder/Subfolder</b> a different error message is returned
    <b>Error: Retrieving file 'FILENAME.XML' failed unexpectedly: FTPEx: Folder/Subfolder: The system cannot find the path specified</b>
    At least in this scenario the adapter has been able to identify the file on the external FTP site but cannot retrieve it
    Questions
    I thought that the backslash prefix for the source directory was mandatory but I am receiving an error in each scenario
    I receive the same error message whether the Processing Mode is 'Archive' or 'Test'
    The logs on the external ftp server seem to indicate that I am simply connecting, sending username and password then quiting straight away. I am not issuing any commands that they can see
    I thought that being a Sender adapter it would inherently execute a Pull or Get command
    To recap, from our XI development server I can ftp directly to the external server and view the required directory using the command window via a DOS prompt (FTP open ...). So all firewall issues, communications, userid and password are fine
    Has anyone experienced these issues?
    Please advise on next course of action?
    Regards,
    Mike

  • Sender File Adapter - remote FTP server program execution

    Hi all,
    I have a scenario
    X12 -> XI -> File
    where sender File adapter is used. The input file is X12 txt document which needs to be converted into X12 xml format. I have created astylus studio XSLT mapping which uses Convertor to convert this txt file to X12 XML.
    I don't know how to configure sender file adpater to run this mapping on the source file before picking it up. have created a windows batch file on the FTP server which runs tis XSLT mapping on the txt file and replaces it with X12 format xml. This batch file uses command line parameters of stylus studio to run XSLT mapping on input txt file and generates an xml.
    I am not sure how to run this mapping on the input file before processing starts in PI file adapater.
    I tried running command line parameters of Sender file adapter but that didn't worked.
    Please help.
    Thanks
    -Kulwant

    Hi, Kulwant:
    Looks like you would like to execute your mapping program before file adapter pick it up.
    Right ? for one interface, it seems out of the XI scope, however if this is your requirement, you can separate into two interfaces:
    The first interface is file to file scenario, it is used to execute your mapping program:
    The file sender just pick up the txt file, send to integration engine.
    Your Message Mapping program need to specify your XSLT mapping, after the mapping, the message is XML format,
    then you will use file receiver to send it to certain directory.
    Now the XML format file is your input of your second interface.
    Regards.
    Liang

  • File selection sequence in the FTP connection for File Sender Adapter

    Hi,
    I have a file to Proxy scenario using FTP connection parameters.
    If there are multiple files in the sender folder, XI picks up the files randomly with no processing sequence.
    I want XI to pick up the files based on the date time stamp meaning the  oldest file created in the folder should be processes first and rest all in sequence there after.
    I know processing sequence can be set for NFS connection but not for FTP .
    Please suggest if there's any way to make this work.
    Thanks in advance.
    Thanks and Regards,
    Amit Bhagwat.
    Edited by: Amit Bhagwat on Nov 4, 2009 5:17 AM

    Hi
    For the Transport Protocol "File Transfer Protocol (FTP)" files are always processed in ascending alphabetical order
    If you want the file to be processed in sequence then you can use Quality of Service EOIO in the sender adapter.
    The files are processed in the sequence they are picked up.
    otherwise use BPM for File Sequencing..
    Refer the following Threads
    FTP Sender Adapter - Processing Sequence
    Processing Sequence issue of FTP protocol
    Regards
    Abhijit
    Edited by: Abhijit Bolakhe on Nov 4, 2009 10:32 AM

  • File Sender Adapter with FTP protocol

    Hi,
    I implementet a file sender adapter with FTP protocol. There is a problem: the sender processes the files even if they're in use by another application.
    I.E. If another application put files (via ftp) in the sender work directory (that is on ftp), the sender processes those files before their transfer is completed.
    I don't want that this sender in a communication channel in PI 7.1, imports files in the system when they aren't completed yet.
    There are some ways to block sender before it processes incompleted files (in an ftp)?
    Thanks
    Matteo

    Hi,
    File sender adapter provides a check for NFS mode
    +Check this
    To specify additional parameters in the adapter configuration, set the Advanced Modeindicator.
    ●      Msecs to Wait Before Modification Check
    Enter the number of milliseconds that the adapter must wait before it checks whether the files have been changed.
    This parameter is not available if you have selected File Content Conversion as the Message Protocoland then made an entry under Recordsets per Message that splits an input file into several messages.
    This parameter is applicable only for the File adapter. If you enter a value in this field when configuring the sender FTP adapter, it will have no effect.+
    Other approach can be to apply OS level checks
    Regards
    Suraj

  • SAP XI File Adaptor (FTP mode) Sender Channel FTP commands

    I have a service set up to communicate via ftp to an external partner.  Their FTP server is secured to a point that I am unable to connect with normal settings.  They claim that the FTP server follows the RFC 959 standard and therefore we should be able to connect and extract a file from their server.  Not happening! 
    The question:
    What are the exact ftp commands issued by a Sender channel configuration to an external FTP server?  I have all the usual setting: user/pass/path/server/file (with wild card). 
    I can not find a definitive listing of commands issued by the file adapter in ftp mode to the remote ftp server.  Not just a listing but an actual flow of commands issued would be useful.
    Would appreciate some help/direction.
    Thanks,
    Mike

    Hi Michael,
      Please look at the FTP Server parameters...
    1) if you have given the uncheck the anonymous login they can connect with out giving the username and password to connect to the FTP server...please check this paramerter and also make sure that if are mainting the username and password it should be the same they are using to access the FTP server.
    2) Please check the port and ip address
      For more information i would suggest you to look at the following link:
      http://help.sap.com/saphelp_nw2004s/helpdata/en/0b/9a50465ccf84479e39a6d50c90fb3f/frameset.htm
       Could you please reply us what would be exact problem u r facing? 
      Thanks and Regards,
      Chandu.

  • Save a copy of file sent through FTP Send Port

    How can we save a copy of the file sent through an FTP Send Port?
    Here are the details of the scenario:
    1. I have an Orchestration which after processing, creates a Flat File
    2. Orchestration has a Static One Way Send Port with specify later
    3. FTP Send Port is bind to the orchestration
    Problem is, I don't want to create an extra file send port in the orchestration.
    Requirement is:
    When orchestration send the flat file to FTP, I want a copy of the file in a local file location.
    BizTalk Specialist

    Create a Send Port Group with the two ports in question and bind your orchestration to the Group.
    Alternatively you can leverage the BizTalk Archiving Pipeline component from codeplex at
    http://biztalkarchiving.codeplex.com/ and use this pipeline on your existing send port.
    Regards.

  • FTP Adapter - file.sender.customizer_class

    Hey,
    Anyone has a working example on how to implement this class?
    I have one class, and apparently, in its simplest form it could be something like this:
    package slf.nask.FileSender;
    import java.util.Date;
    import oracle.oai.agent.adapter.sdk.Agent;
    import oracle.oai.agent.adapter.sdk.AttributeObject;
    import oracle.oai.agent.adapter.sdk.MessageObject;
    import oracle.oai.agent.adapter.technology.FileSenderCustomizer;
    import oracle.oai.agent.adapter.transport.TransportMessage;
    public class SLFNaskFileSenderCustomizer implements FileSenderCustomizer {
         public static void main(String[] args) {
              System.out.println("Interconnect renaming facility!");
         public String generateFileName(Agent agent, String rule, String app,
                   String partitition, Date time, MessageObject mobj,
                   AttributeObject aobj) {
              return "MyFilename.xml";
         public void customizeTransportMessage(Agent agent,
                   TransportMessage transportMessage, MessageObject mobj,
                   AttributeObject aobj) {
    But I keep running into an error when running the adapter. If i comment out this class, it works fine, but once this class is in, it keep getting a parseLong error.
    Log entry:
    TransportProperties.TransportProperties():ota.d3ls=agresso_customer.xml;file.sender.type=ascii;file.receiver.max_msgs_retrieved=30;file.receiver.exception_dir=file://localhost/R:\nask\errors;file.sender.customizer_class=SLFNaskFileSenderCustomizer;ota.type=D3L;file.sender.file_name_rule=NA%TIME%_3.c15;ota.send.endpoint=file://localhost/R:\nask\AgressoFTP\TEST;file.receiver.polling_interval=60000;
    java.lang.NumberFormatException: 1240438527
    4
         at java.lang.Long.parseLong(Long.java:319)
         at java.lang.Long.parseLong(Long.java:363)
         at oracle.oai.agent.common.logger.ErrorLogObserver.readNextLogObject(ErrorLogObserver.java:361)
         at oracle.oai.agent.common.logger.ErrorLogObserver.run(ErrorLogObserver.java:137)
         at java.lang.Thread.run(Thread.java:484)

    Looks like the fault here, was the package. Leave it empty and it should be fine!

  • When I try to upload files in my ftp, the ftp sends an error

    Since the last Firefox update, I´ve been unable to upload files to my www.floraciarlo/ftp. Explorer uploads files ok. I use Windows XP 64bit
    == This happened ==
    Every time Firefox opened
    == The last firefox update!!! Explorer can upload the files to my ftp ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100405 Namoroka/3.6.3

    Firefox doesn't have the ability to upload files on FTP. Are you thinking of another program? See [[Accessing FTP servers]]

  • Get filename from file sender adapter

    Hi Experts,
    I have a question regarding the file/ftp adapter (sender).
    I have a directory with xml and pdf files. for every xml file there is a pdf file with the same filename. for example:
    file1.xml
    file1.pdf
    file2.xml
    file2.pdf
    file3.xml
    file3.pdf
    Now I want to read the xml file with the file sender adapter. afterwards I want to read the related pdf file. for example: If I read the file file1.xml afterwards I want to read the pdf file file1.pdf with the file sender adapter. For this it is nessessary to get the filename from the xml file so that I can read afterwards the pdf file. How can I realise it?
    Thanks and best regards
    Christopher

    Hi srinivas,
    thanks for your quick answer.
    That the file adapter is not able to read pdf files is clear to me. In this case I only want to transport the pdf. that works fine. I tested it.
    the problem is the following:
    I have a xml file with the name "file1.xml". I read the xml file with the sender file/ftp adapter configured with filename "*.xml". Then I want to import the pdf file with the name "file1.pdf". Therefor I need the filename from the xml file.do you know what I mean? So XI has to know the filename of the xml to import the pdf with the same name ...
    regards

  • Posting an Excel file to a FTP Server

    Hi,
    I have a requirement, where I have to convert the contents of an internal table to an excel file, along with header details and put that file to a FTP Server.
    I am able to create an excel file in FTP server, using function module FTP_R3_TO_SERVER and transfer contents of my internal table. But the contents of my internal table are getting copied to one column. How do I get the contents in different columns?
    Also how do I get the header details?

    Hi,
    you can simply create a comma-separated text file on your SAP application server, line by line, each column separated by a semicolon (;). That file can later easily be opened with Excel. Afther the file has been created you can send it to the remote FTP server.
    HTH!

Maybe you are looking for

  • Issu in Rejected PR after cancelling the requistion line

    Hi, I have an issue after cancelling a requisition line in the rejected purchase requisition. I have 2 purchase requisition lines in PR. Approver rejected the PR as one requisition has to be deleted. PR status changed to 'Rejected'. Originator cancel

  • Mac Air Security, Internet Issues: System Report Attached

    I don't know if it's my fault that my brand new Macbook Air is having so many problems. I am not in the know with the terms so I have attached a system report. Basically unable to keep users off of my internet network (private supposedly), On both my

  • A problem about GP parameters mapping.

    Hi, all. I tried to group two parameters together. Those are both structured parameter with cardinality 0.n. But when I groupped them together , the cardinality became 0.1 . I had no idea how this happened. Can anyone give me a hand? Thanks

  • Exporting TIFF with Pages

    Hi everyone. I'm a stranger here and need your help. I got a huge problem when I tried to export TIFF images with Pages. I use Pages to create documents or issues and export them into TIFF, then send them to printers. Everything is OK with Lion. But

  • AppendChunk

    Hi, I am using VB6 & Oracle 8i. I am trying to update a CLOB field (more than 4000 characters). strConnectionString = "Provider=MSDAORA.1;User ID= User; password = password;Data Source = Test;Persist Security Info=False" CursorLocation = adUseClient