Transfer Excel file to external FTP server via PGP

Hi SDN!
I have build an scheduled report to generated an Excel-file from an internal table and saved it in the database. Now my task is to upload it to an external FTP Server of a partner company. The File contains sensible data and shall be encrypted via PGP.
How can i upload to an external FTP server and before that, encrypt the file with PGP? I appreciate any help and look forward to reward some great posts.
Thanks for your help!
Edited by: Steffen Wieprecht on Aug 7, 2008 1:00 PM

I found a solution myself, maybe someone is interrested:
I installed a WS FTP Professional on a Server.
Onto this server I wrote the files that have to be ftp-uploaded into one specific folder.
A Perl Script in the scheduled tasks of the machine checks if a new file is in the folder and starts the upload.
In WS FTP the site upload is defined with all PGP Keys so they are store secure.
This solution can be used by any programming language that is able to write files in the upload folder.
Best Regards,
Steffen

Similar Messages

  • 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!

  • How to schedule Adapter to Pickup File on external FTP Server

    Any solution is very much appreciated for the following Problem.
    My Scenarios are  File to XI to FIle
    My problem is XI is picking up file on FTP Server while file is being written by Webservice ( This Webservice can not write .tmp file or movie file from one directory to another. So these options are ruled out )
    These are proposed steps:
    1. Job Scheduler creates Dummy File on XI File System
    2. XI Picks up File on XI File System and Invokes External Webservice and receives Response that a File "MadFile" has been written to external FTP Server.
    3. After XI receives response from webservice, XI should get "MadFile" from FTP Server
    How Can I implement step 3 above.
    ( Please do not suggest executing scripts as the the application where webservice running do not want to write it )

    ST,
    At times one has to take a stand and using a BPM like this is actually complicating things. Using the script option is the best solution!
    Menahwile, even BPM solution doesn't make sense to me as like you correctly told, your Second Receive Step can poll over the file and pick up the temporary file! Even if you can handle this using Adapter Scheduling, you would need Correlation and I am pretty sure that as you are using a dummy file, this also cannot be achieved!
    Would suggest that another option would be to ask the webservice to send a call directly to XI after writing the file. The moment XI receives the Webservice request,  XI can invoke a java proxy to collect the file ( polling using File adapter is not going to help ) and then pass this file to the integration engien and so on.
    Even my solution is not a very good one, but, if nothing works out, it is something atleast. But, I would ask you to push for the tmp folder plus script.
    Regards
    Bhavesh

  • Excel file format  to FTP server

    hi all,
    By using FM's i am able to upload data from SAP to FTP in .XLS format
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          handle         = w_hdl
          fname          = 'test.xls'      "file path of destination system
          character_mode = 'X'
        TABLES
          text           = it_data1
        EXCEPTIONS
          tcpip_error    = 1
          command_error  = 2
          data_error     = 3
          OTHERS         = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
        RAISING invalid_output_file.
      ENDIF.
    While viewing this excel sheet a popup is triggering  as ''The file you are trying to open is in different format than specificed by the extention.Verify the fileis not corruptedabd is from  a trusted source before opening  the file .Do you want to open the file now ?   Yes     or   No "
    If Yes selected data is opened correctly only but i need to ignore this message .
    When i see the SAVE AS TYPE   its showing text format  and FILENAME as test.xls
    When i change SAVE AS TYPE to EXCEL 97-2003 its fine.but i need this should be updated automatical when i send from SAP itself.

    Sachin, this question is asked several times each week in the forum. There are solutions, in short: DOI or OLE for dialog, external softwares for other cases. As said by breakpoint, you'll be able to process these files more easily and quickly, if they are saved under other (text) formats: txt, csv, xml, xslx.
    Please search and read these posts and revert back if any question.

  • File transfer from a FTP server to another External FTP server

    Hi,
    I have one FTP server , I need to transfer a file from this FTP server to aother external FTP server. Could any one please help me how to write a batch file on FTP server so that my file is transfered to another FTP server by executing the Batch file. I don't want to use SAP server for this.
    best regards
    bobby

    CREATE CONTROLFILE
    Caution:
    Oracle recommends that you perform a full backup of all files in the database before using this statement. For more information, see Oracle9i User-Managed Backup and Recovery Guide.
    Purpose
    Use the CREATE CONTROLFILE statement to re-create a control file in one of the following cases:
    All copies of your existing control files have been lost through media failure.
    You want to change the name of the database.
    You want to change the maximum number of redo log file groups, redo log file members, archived redo log files, datafiles, or instances that can concurrently have the database mounted and open.
    Note:
    If it is necessary to use the CREATE CONTROLFILE statement, do not include in the DATAFILE clause any datafiles in temporary or read-only tablespaces. You can add these types of files to the database later.
    An alternative to the CREATE CONTROLFILE statement is ALTER DATABASE BACKUP CONTROLFILE TO TRACE, which generates a SQL script in the trace file to re-create the controlfile. If your database contains any read-only or temporary tablespaces, that SQL script will also contain all the necessary SQL statements to add those files back into the database.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_54a.htm#SQLRF01203

  • How to transfer excel files(on ftp server) into internal table?

    hello,everyone
    pls tell me how to transfer excel files those on a ftp server into internal table?
    ps.i know the function 'ftp_server_to_r3',it can help to transfer flat file.

    Hi,
    I believe you want to get the data from the FTP Server to R3.
    I am also sending the code. Have a look and it would help you.
    First get the Password and user name and the FTP Server Path where file is stored and FTP Server Host name
    FUNCTION zfi_ftp_get.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(I_FILENAME) TYPE  C
    *"  TABLES
    *"      T_BLOB STRUCTURE  ZFI_TLM_LENGTH OPTIONAL " is a table type with a field called line of length 992
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
      DATA : i_password(30)     TYPE c,
             i_user(30)         TYPE c,
             i_host(30)         TYPE c,
             i_rfc_destination  TYPE rfcdes-rfcdest,
             i_length           TYPE i,
             i_folder_path(100) TYPE c.
      DATA:   lv_blob_length   TYPE i.
      DATA:   lv_length        TYPE i,  "Password length
              lv_key           TYPE i VALUE 26101957,
              lv_password(30)  TYPE c,
              lv_ftp_handle    TYPE i,
              lv_cmd(80)       TYPE c.
      DATA: BEGIN OF result OCCURS 0,
            line(100) TYPE c,
            END OF result.
      TYPES: BEGIN OF ty_dummy,
             line(392) TYPE c,
           END   OF ty_dummy.
      DATA: lt_dummy TYPE TABLE OF ty_dummy,
            ls_dummy LIKE LINE  OF lt_dummy.
      i_password        = 'vnhdh'.
      i_user            = 'sdkgd'.
      i_host            = 'sbnksbg'.
      i_rfc_destination = 'SAPFTP'.
      i_length          = '992'.
      i_folder_path     = '/hioj/hohjk/hh'.
      lv_length = STRLEN( i_password ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = i_password
          sourcelen   = lv_length
          key         = lv_key
        IMPORTING
          destination = lv_password.
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = i_user
          password        = lv_password
          host            = i_host
          rfc_destination = i_rfc_destination
        IMPORTING
          handle          = lv_ftp_handle
        EXCEPTIONS
          not_connected   = 1
          OTHERS          = 2.
      IF sy-subrc = 1.
        return-type = 'E' .
        return-message = 'FTP Connection not Successful'.
        APPEND return.
      ELSEIF sy-subrc = 2.
        return-type = 'E' .
        return-message = 'FTP Connection not Successful'.
        APPEND return.
      ELSEIF sy-subrc EQ 0.
        return-type = 'S' .
        return-message = 'FTP Connection Successful'.
        APPEND return.
        CONCATENATE 'cd' i_folder_path INTO lv_cmd SEPARATED BY space.
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
            handle        = lv_ftp_handle
            command       = lv_cmd
          TABLES
            data          = result
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        IF sy-subrc = 1.
          return-type = 'E' .
          return-message = 'Command Error Occured during open of FTP Folder'.
          APPEND return.
        ELSEIF sy-subrc = 2.
          return-type = 'E' .
          return-message = 'TCIP Error Occured during open of FTP Folder'.
          APPEND return.
        ELSE.
          REFRESH t_blob.
          lv_blob_length = 992.
          TRANSLATE i_filename TO LOWER CASE.
          CALL FUNCTION 'FTP_SERVER_TO_R3'
            EXPORTING
              handle      = lv_ftp_handle
              fname       = i_filename         
            IMPORTING
              blob_length = lv_blob_length
            TABLES
              blob        = lt_dummy.
          t_blob[] = lt_dummy[].
        ENDIF.
      ENDIF.
    ENDFUNCTION.
    Regards
    Sajid
    Edited by: shaik sajid on Nov 16, 2010 7:25 AM

  • Transfer file to an external FTP SERVER

    HI Gentelemen!!,
    I'm trying to open an external FTP connection, sending a file from the  MiniSAP.
    Which is the appropiate RFC connection that I have to use??
    Anybody know how to set RFC connection to access an external FTP server.
    This are the MF that I use:
    CALL FUNCTION 'SCRAMBLE_STRING'
    To encrypt password
    CALL FUNCTION 'FTP_CONNECT'
    here i have an import value for RFC DESTINATION
    return handle - I use it to close the connection
    CALL FUNCTION 'FTP_COPY'
    CALL FUNCTION 'FTP_DISCONNECT'
    Use HANDLE numbre to close the connection
    Thanks for your help.
    POLAK.-

    I am not sure minisap has sapftp and sapftpa executable.
    Anyway the two RFC destination used to do FTP are SAPFTPA and SAPFTP. This are 2 TCP/IP RFC destination (Type T) that launch either the program sapftp or sapftpa on the application server.
    If these rfc destination are not setup in transaction SM59 you can try to define them but it might not work on minisap.
    Regards

  • Output to an ftp server via Destinations or Applescript

    In Compressor, you can set the Destination of a compression batch to be a remote server, such as an ftp server.
    When you start a batch, if the destination is not available or reachable then the documentation (p.230) says: "When there is a problem with your destination, a yellow warning triangle appears. You must resolve this problem before you can successfully transcode."
    Although I have not tried it, it implies that if your remote ftp server is not accessible when you drop a file on a created droplet with the Destination set to an ftp server, it won't be able to begin encoding until the destination is available: "As soon as you resolve the problem, the warning triangle disappears and you can continue to transcode." (p.230)
    For a lot of people, this is OK.
    Some people need to compress and then tranfer the output to a distant location, and they may not have continuous, reliable access to the remote location. They may need to make a temporary connection via modem dial-up, satellite phone or third-world Internet connections. Think news reporters in remote locations.
    So, for those people, the option of Applescript should allow them to have their output files saved to a local destination, and then staged up to the ftp server using the built-in commands. But, the problem is that a small file is created at the Destination when the compression is started, and Compressor is not Applescript aware (apart from being able to call an Applescript). This means that any Applescript called as a post processing activity knows nothing about the files Compressor just processed and outputted. It has to glean information about them from the Destination folder where the output files are placed, and then sort out the completed output files from the ones that have just been started, then ftp the completed files up to an ftp server and delete sent files from the Destination folder.
    What I would like to see is either
    1) a Staged Destination where files are created on the first Destination then staged to a secondary Destination, with an option of keeping these files on the first destination, and/or
    2) Applescript support in Compressor which will allow information about the files that have just been compressed to be passed to another Applescript aware application or script.
    I would be happy even with some sample Applescript to do the transfer or files from Destination to an ftp server that avoids copying files that haven't been fully processed.
    Has anyone else run into these issues?
    Bill Lee

    Oh, trust me, I do know about Apple and the fact this discussion site is not an official contact point for Apple. I'll be escalating this Request for Enhancement through my contacts at Apple.
    There is a reason I have not posted before in this forum (and relates to the above).
    There seems to be few people who are using the Applescript post-processing feature, and I was trying to gauge any support for enhancements in this area (and maybe stir up some villagers with pitchforks and burning torches).
    Apple will listen to normal users input, but it needs to have a business case that justifies any resources devoted to this. The more people affected, and the greater the impact on your business, and the size/importance of your business has an effect on whether you will get what you want, and when.
    Sorry if I was not clear on what I wanted: information as whether this was important for other (non-Apple) people, and whether people had scripts that solved the problem of staging output files to an ftp server that was not consistently connected during the compression process.
    Thanks for your reply,
    Bill Lee

  • Settings and usage of external FTP Server in ECC 6.0

    Dear all,
    I work in ECC 6.0, and I want to configure and use an external FTP Server for upload, download and delete file from FTP Server.
    My questions are:
    1) Which are steps for configure an FTP connection?
    2) How can I read, delete and send a flat file to the FTP Server? Can you send a sample code?
    Thanks in advance for your help.
    Best Regards,
    Giulio

    Please check program RSFTP002  is a good example given by SAP .

  • Need Help to locate a file on a FTP server using MediaLocator class

    Hi Friends,
    This is Venkat. Iam currently working on a Multimedia J2EE web project. Iam working on a requirement to
    show Thumbnail view for uploaded media. For this i have downloaded a standalone code from the following site.
    http://www.exactfutures.com/index02.htm.
    This code converts frames of a media files to jpg images which i can use them to show as Thumbnails.
    The code takes file name which is present in project folder as parameter. But in my web project iam using a FTP server to store my media files.
    The above code uses Java Media Framework along with another API Fobs4JMF. The media file name is passed to MediaLocator class constructor which is located in the project folder. Iam talking about a standalone application here.
    But my project is a J2EE web application.
    Now my problem is that, how can i refer a file which is located on a external FTP server and pass it to MediaLocator or some other class.
    Say the ftp file URL is mms://wm.testuser.net/12365741/testvideo.wmv
    Guys hope you are clear abt my problem. Please help me ASAP.
    Below is the part of code
         * Constructor
         public vid2jpg(String path) {
              MediaLocator ml;
              String args = path;
              if ((ml = new MediaLocator(args)) == null) {
                   System.out.println("Cannot build media locator from: " + args);
              if (!open(ml)) {
                   System.out.println("Failed to open media source");
         * Given a MediaLocator, create a processor and start
         private boolean open(MediaLocator ml) {
              System.out.println("Create processor for: " + ml);
              try {
                   p = Manager.createProcessor(ml);
              } catch (Exception e) {
                   System.out.println("Failed to create a processor from the given media source: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(p.Configured)) {
                   System.out.println("Failed to configure the processor.");
                   return false;
              // Get the raw output from the Processor.
              p.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
    Thanks in Advance for your time.
    Venkat
    Edited by: VenkataGuru on Jul 23, 2008 5:30 PM

    Hi Mani,
    Below is code that ran successfully on a cRIO-9002.  It looks much the same as yours, please double-check the formatting of your string controls.  If things still do not work, let's look at the cRIO more closely.
    Message Edited by Pie56694 on 06-30-2008 09:45 AM
    Attachments:
    FTPDELE3.jpg ‏28 KB
    FTPDELE.jpg ‏24 KB
    FTPDELE2.jpg ‏18 KB

  • Excel file creation on application server

    Gurus,
    I have seen a lot of threads on excel file creation in application server, but failed to see if anyone had a solution.
    Problem: In background execution I need to create an excel sheet on application server, the data would be contained in internal table, The FM like WS_DOWNLOAD etc..cannot support these as they have GUI component.
    All the documentation that I have been through states to use dataset which saves the file in.csv or txt format seperated by delimiter, is it possible to save as a true excel file.
    same as this thread:
    Re: Excel download in Application Server
    let me know,
    Thanks in advance .

    * Write column headers, if required
      IF column_headers = 'X'.
    *   ... override field names with LABELS_IN, if specified
        IF NOT labels_in[] IS INITIAL.
          DESCRIBE TABLE labels_in LINES num_lines.
          IF num_lines > num_fields.
            RAISE too_many_labels.
          ELSEIF num_lines < num_fields.
            RAISE too_few_labels.
          ENDIF.
          ASSIGN COMPONENT 1 OF STRUCTURE labels_in TO <f>.
          LOOP AT fields_in.
            READ TABLE labels_in INDEX sy-tabix.
            fields_in-name = labels_in-name.
            MODIFY fields_in.
          ENDLOOP.
        ENDIF.
    *   ...write column headers to file...
        position = 0.
        LOOP AT fields_in.
          IF fixed_length NE space.
    *** INSERT: DAR was here for Issue 17817 --------------- dar012009 ---v
            field_len = STRLEN( fields_in-name ).
    *** INSERT: DAR was here for Issue 17817 --------------- dar012009 ---^
            DO fields_in-len TIMES.
              offset = sy-index - 1.
    *          IF sy-index > 15.                                 dar012009
              IF sy-index > field_len.                          "dar012009
                line_out+position(1) = space.
              ELSEIF fields_in-name+offset(1) NE space.
                line_out+position(1) = fields_in-name+offset(1).
              ELSE.
                line_out+position(1) = space.
              ENDIF.
              position = position + 1.
            ENDDO.
          ELSE.
            CONCATENATE line_out fields_in-name INTO line_out
              SEPARATED BY delimiter.
          ENDIF.
        ENDLOOP.
        IF fixed_length EQ space.
          SHIFT line_out LEFT DELETING LEADING delimiter.
        ENDIF.
        IF no_write IS INITIAL.                                 "dar041505
          TRANSFER line_out TO file_out.
        ENDIF.                                                  "dar041505
        data_out = line_out.  APPEND data_out.                  "dar041505
      ENDIF.
    * Write lines to file...
      LOOP AT data_in.
        CLEAR line_out.
        position = 0.
        DO num_fields TIMES.
          ASSIGN COMPONENT sy-index OF STRUCTURE data_in TO <f>.

  • Excel File downloaded from application server is also opening in notepad

    Hi Friends,
    While downlaoding an excel file from the application server,we are able to open in notepad also.But this does not conatin the excel properties and hence happening.File should only oopen with excel and no other file type
    Can any open help on this
        ld_file =  '/usr/sap/trans/abap/HR_DATA.xls'.
        OPEN DATASET ld_file FOR OUTPUT in text mode ENCODING DEFAULT .
        IF sy-subrc = 0.
          LOOP AT int_final.
            CLEAR wa_string.
            CONCATENATE int_final-employee_sno int_final-employee_code INTO wa_string SEPARATED BY con_tab.
            CONCATENATE wa_string int_final-first_name         INTO wa_string SEPARATED BY con_tab.
    please help...
    Edited by: Neliea on Oct 29, 2009 1:11 PM

    Hi,
    Please refer to these links.
    [url]Re: Internal table to excel download?;url]
    [url]Re: Transfer from Internal Table to EXCEL file...;url]
    Regards,
    Aditya

  • Help Fetching files from an FTP server into a DBase or local folder

    Hello Gurus!
    I need help to automate or design/write an app capable of (replace a manual process) reading log files in an ftp server folder, this log files are called CDR (Call Detail Record) and named as follow cdr.txt.20020221010000 meaning that this log file was created on 2002/02/21 at 01:00:00.
    This CDR log files are generated every hour by a Lucent telephone switch using a software/program called EXS ExchangePlus in ASCII format (fixed length delaminated, Char data type). EXS ExchangePlus writes a record in this CDR/log files after the call is completed, i.e. Calling_Number, Called_Number, Date_connect (yyyymmdd), Time_connect (hhmmss), Charged_time (hhmmss, duration of the call), and so on.
    The manual process I am using now is:
    1. Log in the ftp server into the folder where the CDRs log files are, located the latest generated CDRs log files and downloaded them into a local folder/directory. Normally I download the CDR for full day or 24 CDRs log files.
    1a. Optionally sometimes I used a program called VEdit compiled/gather all 24 CDRs into a single file.
    2. Once I have downloaded the CDRs I want to process (normally I process a full day 24 CDRs) I imported then into a Data Base temp table, where then I do the conversion of data types (i.e. Dates and times fields from char type -> to ->Date type) and calculations for billing purposes.
    So if somebody can help with this, I would really appreciated ideas or any kind of information on how to automated this process.
    I�m familiar with Java2 platform (using JDeveloper ) so if somebody has done something like this before using java, this would very helpful. Or Maybe using Visual Basic 6.0 would help too.
    Thanks Gurus, and I look forward to hear from you soon!
    Alf Pathros!

    Thanks for the idea, even though an example would help me more.
    I already found the FTPClient class.
    I also would like to knwo if there is a away Ican append/merged various files CDRs into a single/one to then dump/import it into the database

  • Polling of the current file from multiple files in the FTP Server

    Hello Experts
    I am working on a file to file scenario.We have to poll the file from the FTP server which may contain multiple files with different creation dates.The requirement is to poll only the file created in the current date.Could anyone throw some light on this.
    Thanks & Regards
    Sabyasachi

    Hi Sabyasachi,
        You can archive the files that you do not need into another folder manually for the first time.
    Later you can schedule the file adapter to poll the folder only once in a day (Poll INterval = 86400 secs)
    Do not forget to set the option to archive/delete the file that are already processed.
    Regards,
    Ravi Kanth Talagana

  • Upload and download of  excel file in the application server in background

    Hi all,
    i want to download the excel file from application server into internal table and after processing i have to upload to excel file in the application server in the background mode..
    i mean i'll schedule the program in background.
    im using FM ALSM_EXCEL_TO_INTERNAL_TABLE its working fine in fore ground but not in back ground.
    what method i have to follow ?

    Hi Ankit,
    I think this is not possible to open a Excel-File from the application server because the Excel format before Office 2007 where a binary format (Suffix: .xls). The newer Office file format (Suffix: xlsx) is a zipped XML Format. To read the binary Excel-Format you need an OLE Connection between SAP GUI and Office. But at the application server in background you doesn't have this OLE Connection.
    In my opinion you have two possibilities:
    1. Convert all files in the CSV format. This file format can be read with open dataset.
    2. Upload the files from the presentation server in forground. There are some funktion modules in the standard which can read the xls format. But they have some limits regarding the length of cells content.
    My recommendation is solution no. 1. If you know an VBA expert, he can write an Excel-macro which converts all Excel Files in the CSV-Fomat.
    Regards
    Dirk

Maybe you are looking for