Downloaded file from SAP to excel 2007(*.xlsx, *.xlsm)  - unable to open

Hi All,
I am downloading a data from SAP to excel(*.xlsx) format. I am able to conver/download the file in *.xlsx format, but if try to open the downloaded excel file, it gives teh error message 'Excel cannot open the file 'filename.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'. with a OK button. When I press the OK button, no data is displayed.
So kindly let me know how to download the file from SAP to *.xlsx format without any errors.
Note: I am able to download the data in *.xls format without any erros.
Thanks in advance,
Regards,
Vijay

Hi,
You are probably not being able to open the file of .XLSX format because you do not have Microsoft Office 2007 installed on your system. You might be having a lower version of Microsoft Office. e.g. 2003.
What you can do is, before opening the .XLSX file directly on a system which does not have Microsoft Office 2007, you can convert it into .XLS format and then open the same.
See the below code.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_COPY
  EXPORTING
    SOURCE               = 'C:\Users\Danish\Desktop\test1.xlsx'
    DESTINATION          = 'C:\Users\Danish\Desktop\test2.xls'
  EXCEPTIONS
    CNTL_ERROR           = 1
    ERROR_NO_GUI         = 2
    WRONG_PARAMETER      = 3
    DISK_FULL            = 4
    ACCESS_DENIED        = 5
    FILE_NOT_FOUND       = 6
    DESTINATION_EXISTS   = 7
    UNKNOWN_ERROR        = 8
    PATH_NOT_FOUND       = 9
    DISK_WRITE_PROTECT   = 10
    DRIVE_NOT_READY      = 11
    NOT_SUPPORTED_BY_GUI = 12
    OTHERS               = 13.
IF SY-SUBRC NE 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Danish

Similar Messages

  • Download file from UNIX to EXCEL problem

    Hi,
    I am trying to download file from UNIX server to excel file, there is one column which is messing up and that is number 100000000000000002 (18 in length) it is writing as 1E+17, funny thing is when I click on that cell it is showing as
    100000000000000000.
    I am using GUI_DOWNLOAD to download to excel, below is the output excel format, I am talking about 4th value from left
    GUID    leg_reg     lic_type     lic_num     ex_lic_num     vali_from     valid_to     created_by
    3E633B85C05E6F28E100     EAR     ENC     1E+17     ENC     20030305     20930305     VANRIJ
    below is the program I am using to download the output from UNIX to excel
    FORM get_data_file.
      OPEN DATASET p_unxfil FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc = 0.
        DO.
          READ DATASET p_unxfil INTO input_file_tab-line_string.
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
          APPEND input_file_tab.
          CLEAR  input_file_tab.
        ENDDO.
      ELSE.
        PERFORM write_message USING 'ZZ' 'E' '000'
          'Unable to find file' p_unxfil
          '  Press Enter key to exit.' ''.
      ENDIF.
      CLOSE DATASET p_unxfil.
      DESCRIBE TABLE input_file_tab LINES record_cnt.
    ENDFORM.                    " get_data_file
    FORM create_pc_file.
      DATA: l_file TYPE string.
      MOVE p_pcfile TO l_file.
    Save the file
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
        TABLES
          data_tab                = input_file_tab
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc NE 0.
        WRITE: / 'Error creating pc file', p_pcfile.
        EXIT.
    endif.
    I will assure of points.
    Thanks for your help
    Sarath

    It is not the problem of your program. This happens becuase of the "nature" of the excel. You need to retain the text property of that column.
    Try like this:
    1. Download the file in .txt
    2. Open Excel .. blank sheet
    3. Now, click on Open. Select your .txt file
    4. One pop up will come ..."Text Import Wizard"
    5. Select the fixed width or Delimited ... Press Next ...
    6. Select appropriate delimitors or fixed length .. press Next
    7. Select your coulumn (which has the problem), Select the "Text" radiobutton on the upper-right corner and finish.
    Regards,
    Naimesh Patel

  • S_ALR_87011990 - Problem in downloading report from SAP to Excel.

    Hi All,
    I am facing an issue in report S_ALR_87011990, while downloading a report from SAP to excel. In SAP, report is comming out to be in different format than what it is getting generated in excel.
    I am attaching screen shots for your reference.
    Request you all to kindly help me in this regard, As this report is required urgently.
    Thanks in advance....
    Regards
    Rajat Kumar

    Hi Priya,
    Sorry for the delay.. here
    Simple explanation...
    ABAP - OLE Automation using MS-Excel - Code Gallery - SCN Wiki
    You can find a detail doc here
    http://www.heyiamonline.com/abap/pdf/ABAPOLEAUTOMATION.pdf
    Regards

  • Download file from SAP PLM or Content Server?

    Hi all,
    I learned that the VEG server download the originals from content server and then started the conversion process.
    In my case, I have an error below, it is strange that the IP 153.95.192.93:443 is the ip of SAP PLM server, can anyone tell me is my configuraton right?
    thanks
    Job 42 (Workflow 'KPRO Retrieve') report
    Startup Parameters
         FilesPerTask = '5 '(Integer)
         InputFilePath = '\ \ NBHXVEG02 \ DSShare \ Workspace \ JM_JOB41 \ KProRetrievalRequest.xml' (String)
         OutputFilePath = '\ \ NBHXVEG02 \ DSShare \ Workspace \ JM_JOB41 \ KProRetrievalResponse.xml' (String)
    Step 'validate input'
       Completed Action 'enter a valid'
    Step 'Download'
       CompletedWithWarnings Action 'can not download all the files'
         Info Message 'document retrieval tasks to be addressed: 1'
         Warning Message 'first task failed to retrieve a file (of 1): Unknown error (warning)'
           jmp_KproRetrieve (Task 39)
           Warning Message 'file' A00021876_20130819.CATProduct 'unable to download: Unable to connect to the remote server: Since the connected party did not properly respond after a period of no response or a host connection, the connection attempt fails. 153.95.192.93:443 '

    HI Fergal.
    I changed the IIS port to XX443(XX means instance number), the https service is also started in the ECC server.
    but I got below errors:
    Startup Parameters
         FilesPerTask = '5 '(Integer)
         InputFilePath = '\ \ NBHXVEG02 \ DSShare \ Workspace \ JM_JOB115 \ KProRetrievalRequest.xml' (String)
         OutputFilePath = '\ \ NBHXVEG02 \ DSShare \ Workspace \ JM_JOB115 \ KProRetrievalResponse.xml' (String)
    Step 'validate input'
       Completed Action 'enter a valid'
    Step 'Download'
       CompletedWithWarnings Action 'can not download all the files'
         Info Message 'document retrieval tasks to be addressed: 1'
         Warning Message 'first task failed to retrieve a file (of 1): Unknown error (warning)'
           jmp_KproRetrieve (Task 122)
           Warning Message 'file' A00021876_20130819.CATProduct 'unable to download: The underlying connection was closed: Could not establish trust relationship for the SSL / TLS secure channel. : According to the verification process, the remote certificate is invalid. '

  • Download datas from SAP to Excel in OO

    Hallo,
    i create an excel-document with the methods
    CALL METHOD DOCUMENT->CREATE_DOCUMENT
        EXPORTING
          OPEN_INPLACE     = ' '
    *      CREATE_VIEW_DATA = CREATE_VIEW_DATA
    *      ONSAVE_MACRO     = ONSAVE_MACRO
    *      STARTUP_MACRO    = STARTUP_MACRO
          DOCUMENT_TITLE   = DOCUMENT_TITLE
          NO_FLUSH         = NO_FLUSH
        IMPORTING
          ERROR            = ERROR
          RETCODE          = RETCODE.
    and
    CALL METHOD DOCUMENT->GET_SPREADSHEET_INTERFACE
        EXPORTING
          NO_FLUSH        = NO_FLUSH
        IMPORTING
          SHEET_INTERFACE = SPREADSHEET
          RETCODE         = RETCODE
          ERROR           = ERROR.
    and so on.
    Wounderful.
    I close the excelwindow with the methods:
    CALL METHOD DOCUMENT->SAVE_AS
        EXPORTING
    *      FILE_NAME   = FILE_NAME
          PROMPT_USER = 'X'
          NO_FLUSH    = NO_FLUSH
        IMPORTING
          ERROR       = ERROR
          RETCODE     = RETCODE.
      PERFORM FEHLERPRUEFUNG.
      CALL METHOD DOCUMENT->CLOSE_DOCUMENT
        EXPORTING
          DO_SAVE     = DO_SAVE
          NO_FLUSH    = NO_FLUSH
        IMPORTING
          HAS_CHANGED = HAS_CHANGED
          ERROR       = ERROR
          RETCODE     = RETCODE.
      PERFORM FEHLERPRUEFUNG.
      CALL METHOD DOCUMENT->RELEASE_DOCUMENT
        EXPORTING
          NO_FLUSH = NO_FLUSH
        IMPORTING
          ERROR    = ERROR
          RETCODE  = RETCODE.
      PERFORM FEHLERPRUEFUNG.
      FREE DOCUMENT.
    Only the worksheet is closed but not the excel-window.
    Has anybody an idea what is wrong?
    Thank you.
    Greetings
    datatom

    Hallo,
    i create an excel-document with the methods
    CALL METHOD DOCUMENT->CREATE_DOCUMENT
        EXPORTING
          OPEN_INPLACE     = ' '
    *      CREATE_VIEW_DATA = CREATE_VIEW_DATA
    *      ONSAVE_MACRO     = ONSAVE_MACRO
    *      STARTUP_MACRO    = STARTUP_MACRO
          DOCUMENT_TITLE   = DOCUMENT_TITLE
          NO_FLUSH         = NO_FLUSH
        IMPORTING
          ERROR            = ERROR
          RETCODE          = RETCODE.
    and
    CALL METHOD DOCUMENT->GET_SPREADSHEET_INTERFACE
        EXPORTING
          NO_FLUSH        = NO_FLUSH
        IMPORTING
          SHEET_INTERFACE = SPREADSHEET
          RETCODE         = RETCODE
          ERROR           = ERROR.
    and so on.
    Wounderful.
    I close the excelwindow with the methods:
    CALL METHOD DOCUMENT->SAVE_AS
        EXPORTING
    *      FILE_NAME   = FILE_NAME
          PROMPT_USER = 'X'
          NO_FLUSH    = NO_FLUSH
        IMPORTING
          ERROR       = ERROR
          RETCODE     = RETCODE.
      PERFORM FEHLERPRUEFUNG.
      CALL METHOD DOCUMENT->CLOSE_DOCUMENT
        EXPORTING
          DO_SAVE     = DO_SAVE
          NO_FLUSH    = NO_FLUSH
        IMPORTING
          HAS_CHANGED = HAS_CHANGED
          ERROR       = ERROR
          RETCODE     = RETCODE.
      PERFORM FEHLERPRUEFUNG.
      CALL METHOD DOCUMENT->RELEASE_DOCUMENT
        EXPORTING
          NO_FLUSH = NO_FLUSH
        IMPORTING
          ERROR    = ERROR
          RETCODE  = RETCODE.
      PERFORM FEHLERPRUEFUNG.
      FREE DOCUMENT.
    Only the worksheet is closed but not the excel-window.
    Has anybody an idea what is wrong?
    Thank you.
    Greetings
    datatom

  • Download to Excel 2007 (.xlsx) Help

    Hi Everyone, I have an issue with the Download options - Download to Excel.
    We have a few on-demand bulk reports that basically allows users to fire a detailed obiee report through GoURL.
    Once the report is done, the Download Option - Download to Excel allow them to export data to an Excel Spread-sheet.
    The issue is, OBIEE is exporting the data to Excel as Microsoft Office Excel 97-2003 Worksheet, (.xls) format. As we all know this has a max row count limitation (65000) per sheet.
    I was wondering if there is any setting in OBIEE side that would force the Download to Microsoft Excel 2007, (.xlsx) format which has a max row count of 1 million.
    If anyone can help me finding the configuration file or settings in OBIEE that would do the above requirement, is greately appreciated.
    Thanks
    Sai

    Hi,
      Your Problem is related to Excel only, kindly make the Changes in your Excel File,
       1. Select Column or Cell.
       2. Choose Format > Cells from the menu to open the Format Cells dialog box.
    With the Format Cells dialog box open:
    Note: For help on these steps, refer to the image above.
       1. Click on the Number Tab (circled in red in the image above).
       2. Select General in the Category Window.
    When finished, Click OK at the bottom of the Format Cells dialog box.
    It will Show you 4 instead of 4:0000

  • Unable to export report to excel file from SAP

      Hi all,
    I have a problem to download data from a report. The XL gets downloaded in a different format than my colleague.
    We are using the same XL version but two weeks back the SAP GUI 730 got reinstalled to my machine and since then the problem
    started.
    Can you please confirm is there is any particular user settings for this?
    I have login in any different working ( SAP Export ) machine with my login ID and Password and try to export the report to excel file from SAP, and I have same issue . Same we have requested another user to login in my machine with their ID and Password and check the same, They have tried and its working for then in my machine.
    see screenshots attached.
    Thanks.

    Execute report>
    Right click anywhere in the report output and select Spreadsheet.
    A pop up box will appear, select which export option you would like to use and click green check.
    NOTE: If you don't see this option then goto Settings>Switch List then try above said.
    Thanks,
    Kumar

  • How to download a file from AL11 inot Excel format without collapse the col

    Hi,
    Please suggest how to download a file from AL11 to Excel sheet.currenlty all field are merging into single column.I writing this file via using DATASET.
    Regards
    Ricky

    Hi,
       Try this code,
    ==============================================
    TYPES : BEGIN OF ty_emp,
              empno(2) TYPE c,
              empid(10) TYPE c,
              empname(3) TYPE c,
            END OF ty_emp.
    DATA : it_emp TYPE TABLE OF ty_emp,
            wa_emp TYPE ty_emp.
    DATA : pbk TYPE string.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_file TYPE rlgrap-filename.
    PARAMETERS : p_asfile TYPE rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK b1.
    pbk = p_file.
    OPEN DATASET p_asfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      DO.
        READ DATASET p_asfile INTO wa_emp.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND wa_emp TO it_emp.
      ENDDO.
    CLOSE DATASET p_asfile.
    Filling the already created file with download PS radiobutton
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                  =
          filename                      = pbk
      FILETYPE                      = 'ASC'
         append                        = 'X'
         write_field_separator         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
        TABLES
          data_tab                      = it_emp
    EXCEPTIONS
      FILE_WRITE_ERROR              = 1
      NO_BATCH                      = 2
      GUI_REFUSE_FILETRANSFER       = 3
      INVALID_TYPE                  = 4
      NO_AUTHORITY                  = 5
      UNKNOWN_ERROR                 = 6
      HEADER_NOT_ALLOWED            = 7
      SEPARATOR_NOT_ALLOWED         = 8
      FILESIZE_NOT_ALLOWED          = 9
      HEADER_TOO_LONG               = 10
      DP_ERROR_CREATE               = 11
      DP_ERROR_SEND                 = 12
      DP_ERROR_WRITE                = 13
      UNKNOWN_DP_ERROR              = 14
      ACCESS_DENIED                 = 15
      DP_OUT_OF_MEMORY              = 16
      DISK_FULL                     = 17
      DP_TIMEOUT                    = 18
      FILE_NOT_FOUND                = 19
      DATAPROVIDER_EXCEPTION        = 20
      CONTROL_FLUSH_ERROR           = 21
      OTHERS                        = 22
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ==============================================
    Regards,
    Krrishna

  • How to download data from spool to excel file

    Hi,
    I have requirement like....i need to download data from spool to excel file.
    Please let me know the process how to download...
    <removed by moderator>
    <removed by moderator>
    Thanks,
    Khasimsa
    Moderator message: please (re)search yourself before asking, do not assign priorities, do not offer re-ward
    locked by: Thomas Zloch on Sep 8, 2010 1:18 PM

    Hi try this way..
    *FM called that returns the Spool Request Number data into and internal table
      CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
        EXPORTING
          rqident              = p_spool                     "Spool Request Number
          first_line           = 1
        TABLES
          buffer               = it_spool_xls                            "Internal table that will have the Spool Request No data
        EXCEPTIONS
          no_such_job          = 1
          not_abap_list        = 2
          job_contains_no_data = 3
          selection_empty      = 4
          no_permission        = 5
          can_not_access       = 6
          read_error           = 7
          OTHERS               = 8.
    *To convert the spool data into excel format
      CALL FUNCTION 'SO_RAW_TO_RTF'
        TABLES
          objcont_old = it_spool_xls               "Internal table having spool data
          objcont_new = it_xls_spool.           "Int table having Excel format data converted from Spool data
    "call GUI down Load by passing  it_xls_spool
    Prabhudas

  • From sap to excel file with different sheets?

    can  i upload   an internal table  from  SAP to single Excel file with different sheets for example like : sheet1, sheet2, sheet3.......sheet10. , but need to upload data from sap to excel worksheets ie. from multiple named tabs in Excel. Is this possible, and if so, please can you help and advise me how?
    thanks
    venkat.
    Edited by: Matt on Feb 16, 2009 2:15 PM  Removed excessive question marks...!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Hi venkat,
    Yes indeed it is possible to write data from internal table to different excel sheets. Check out SAP's Microsoft OLE functionality.Search on SDN for OLE . Following are some links
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/sample%252bprogram%252bto%252bopen%252bexcel%252bsheet%252busing%252bole
    You can also check out FM ALSM_EXCEL_TO_INTERNAL_TABLE to check how to read different worksheets.
    Using the above two resources you can create a program that can upload data to multiple worksheets in the same workbook.
    Also see this link
    Creating Excel with More than one page
    Edited by: aditya aghor on Feb 16, 2009 1:57 PM
    Edited by: aditya aghor on Feb 16, 2009 2:02 PM

  • How to download files from the internet via SAP PI

    Hi,
    is it possible to download files from a certain URL from the internet via SAP PI? Which adapter has to be used?
    Thanks in advance
    Dominic

    Hi nosebear,
    this is a piece of JAVA-code to read a URL. This works also for XML-files.
    You can use this in adater-module, JAVA-Mapping or UDF
    Regards Mario
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.URL;
    public class testhttp {
    * @param args
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    try {
    System.setProperty("https.proxyHost", "10.xxx.1.80");
    System.setProperty("https.proxyPort", "8000");
    System.setProperty("http.proxyHost", "proxy");
    System.setProperty("http.proxyPort", "8000");
    URL url = new URL("http://www.openbc.com/ <http://www.openbc.com/> ");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.connect();
    System.out.println(conn.getResponseCode());
    InputStream stream = conn.getInputStream();
    int b;
    while ((b = stream.read()) != -1) {
    System.out.print((char) b);
    } catch (MalformedURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }//catch
    Edited by: Mario Müller on Jul 31, 2008 4:58 AM

  • How to download files from Application Server of Unix o.s to local director

    Hi All,
    I am trying to download files from Apllication server of Unix operating Systems to local file in excel sheet format using a z-program.but whenever I am trying to use OPEN dataset ........
    it is showing sy-subrc = 8.
    Can I have any clew please.
    Thanks in advance,
    Regards,
    AMEER.

    Hi Sreekanth,
    Thanks a lot for quick reply.I have to download that files from z-program only. I am giving you my code below.
    *& Report  ZTRAK_DOWNLOAD                                         *
    REPORT  ZTRAK_DOWNLOAD  MESSAGE-ID ZCT                   .
    SELECTION-SCREEN BEGIN OF BLOCK DOWNLOAD WITH FRAME TITLE TEXT1.
      PARAMETERS :
           SERDIR LIKE RLGRAP-FILENAME DEFAULT '/usr/trak',
           LOCDIR LIKE RLGRAP-FILENAME DEFAULT 'C:\Trak'.
    SELECTION-SCREEN END OF BLOCK DOWNLOAD .
    SELECTION-SCREEN BEGIN OF BLOCK INFO2 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT2.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT3.
    SELECTION-SCREEN END OF BLOCK INFO2 .
    SELECTION-SCREEN BEGIN OF BLOCK INFO3 WITH FRAME.
           SELECTION-SCREEN COMMENT 1(79) TEXT4.
           SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT5.
            SELECTION-SCREEN SKIP.
           SELECTION-SCREEN COMMENT 1(79) TEXT6.
           SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT7.
           SELECTION-SCREEN SKIP 2.
           SELECTION-SCREEN COMMENT 1(79) TEXT8.
    SELECTION-SCREEN SKIP 1.
           SELECTION-SCREEN COMMENT 1(79) TEXT9.
    SELECTION-SCREEN END OF BLOCK INFO3.
    *- Internal Table to output data in Excel
    DATA: BEGIN OF tab_excel OCCURS 0,
            col1(50),
            col2(132),
            col3(255),
            col4(100),
            col5(100),
            col6(50),
            COL7(60),
            col8(30),
            col9(30),
            col10(30),
            col11(20),
            col12(15),
            col13(15),
          END OF tab_excel.
    DATA: FILE LIKE RLGRAP-FILENAME .
    DATA: W_DATASET(80).
    INITIALIZATION.
      TEXT1  = 'Download Reports'.
      TEXT2 = 'The Program downloads the reports generated by Trak'.
      TEXT3 = 'Utility from Server to Local PC.'.
      TEXT4 = 'Check the following before executing the Program.'.
      TEXT5 = '     1. A valid Server path is provided.'.
      TEXT6 = '     2. A valid Local PC path is provided.'.
      TEXT7 = '     3. Local PC has 10 MB free space.'.
      TEXT8 = 'The report can be executed in the forground.'.
    TEXT9 =
    'The report should be executed after execution of Transaction TRAK'.
    AT SELECTION-SCREEN.
    IF SERDIR EQ ''.
    MESSAGE E001(ZCT).
    ENDIF.
    IF LOCDIR EQ ''.
    MESSAGE E002(ZCT).
    ENDIF.
    START-OF-SELECTION.
    Download ABAP Development Summary Report
    FILE =  '\ABAP_Report_Developments.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAP_Report_Developments.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download BDC Development Report
    FILE =  '\BDC_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/BDC_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Development Summary Report
    FILE = '\Developments_Summary_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Developments_Summary_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Enhancement Development Report
    FILE =  '\Enhancement_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Enhancement_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download field exit Development Report
    FILE =  '\Field_Exit_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Field_Exit_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Frequency & Purpose Report
    FILE =  '\Frequency_And_Purpose_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Frequency_And_Purpose_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Group Developments Report
    FILE =  '\FunctionGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Function Module Developments Report
    FILE = '\FunctionModule_Developments_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionModule_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    FILE =  '\Include_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Include_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download UserGroup Developments Report
    FILE =  '\UserGroup_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserGroup_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Modified_Standard_SAP_Objects_Report
    FILE = '\Modified_Standard_SAP_Objects_Report.XLS' .
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Modified_Standard_SAP_Objects_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Include Developments Report
    *FILE =  '\Include_Developments_Report.XLS'.
    *CONCATENATE LOCDIR FILE INTO FILE.
    *W_DATASET = '/Include_Developments_Report.dat'.
    *CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    *PERFORM INIT.
    Download SAP Script Developments Report
    FILE =  '\SAP_Scipt_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/SAP_Scipt_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Transaction Developments Report
    FILE =  '\Transaction_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/Transaction_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download User Exits Developments Report
    FILE =  '\UserExits_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/UserExits_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download ABAP Query Developments Report
    FILE =  '\ABAPQuery_Developments_Reports.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/ABAPQuery_Developments_Reports.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    Download Functional Area Developments Report
    FILE =  '\FunctionalArea_Developments_Report.XLS'.
    CONCATENATE LOCDIR FILE INTO FILE.
    W_DATASET = '/FunctionalArea_Developments_Report.dat'.
    CONCATENATE SERDIR W_DATASET INTO W_DATASET.
    PERFORM INIT.
    MESSAGE S003(ZCT) WITH LOCDIR.
    END-OF-SELECTION.
    This routine checks whether file exists if yes downloads it to
    the Local PC
    FORM INIT.
    OPEN DATASET W_DATASET FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    DO.
       IF SY-SUBRC <> 0.
          EXIT.
       ENDIF.
       READ DATASET W_DATASET INTO  tab_excel.
       APPEND tab_excel.
       CLEAR tab_excel.
    ENDDO.
         PERFORM DOWNLOAD_FILE.
    ENDFORM.
    This routine downloads the data in an XL format on local PC
    FORM Download_File .
      CALL FUNCTION 'WS_DOWNLOAD'
                EXPORTING
                     FILENAME                = FILE
                     FILETYPE                = 'DAT'
                TABLES
                     DATA_TAB                = tab_excel
                EXCEPTIONS
                     FILE_OPEN_ERROR         = 1
                     FILE_WRITE_ERROR        = 2
                     INVALID_FILESIZE        = 3
                     INVALID_TYPE            = 4
                     NO_BATCH                = 5
                     UNKNOWN_ERROR           = 6
                     INVALID_TABLE_WIDTH     = 7
                     GUI_REFUSE_FILETRANSFER = 8
                     CUSTOMER_ERROR          = 9
                     OTHERS                  = 10.
        IF sy-subrc <> 0.
         message ''.       " Error in file transfer
        ELSE.
          CLEAR TAB_EXCEL.
          REFRESH TAB_EXCEL.
          FILE = ''.
          W_DATASET = ''.
        ENDIF.
    ENDFORM.
    I have created those files in Application Server running in another z-program in background mode.Then I am trying to download those files using above the program.I am creating those trak/Trak files manually and I can able to see those files in A.S level.But when downloading the same files I am facing the problem.
    regards,
    Ameer

  • How to transfer file from sap server to PDM server using open FT??

    Hello Sap Guru's
    I want to Trasfer a file with all supplier information from SAP server to PDM server(Thirdparty) system Using Open FT ..How can I transfer ???
    Please let me know the answer??
    Thanks In Advance
    Preethi

    Hi Preethi,
    I think it is not possible to transfer a file from SAP to PDM using open FT.
    Using RFCs, we can do the transfer.
    Other option is the file can be downloaded into UNIX. And from there using a shellscript we can transfer the file from UNIX to PDM or if your PDM has the option to grab the file from UNIX that will also work.
    Hope this helps.
    Please reward if helpful.
    Thanks,
    Srinivas

  • How to download file from application server

    Hi Experts,
                  I developed report and execute in background mode. for this i used Open dataset transfer and close dataset . i got the requried output . But in this case user want downloaded file on presentation server so can anyone tell me How to download file from application server?
    i know it is possible through Tcode CG3Y. but i want code in program.

    This code will download a file to your Client package by package, so it will also work for huge files.
    *& Report  ZBI_DOWNLOAD_APPSERVER_FILE
    REPORT  zbi_download_appserver_file.
    PARAMETERS: lv_as_fn TYPE sapb-sappfad
    DEFAULT '/usr/sap/WBP/DVEBMGS00/work/ZBSPL_R01.CSV'.
    PARAMETERS: lv_cl_fn TYPE string
    DEFAULT 'C:\Users\atsvioli\Desktop\Budget Backups\ZBSPL_R01.CSV'.
    START-OF-SELECTION.
      CONSTANTS blocksize TYPE i VALUE 524287.
      CONSTANTS packagesize TYPE i VALUE 8.
      TYPES ty_datablock(blocksize) TYPE x.
      DATA lv_fil TYPE epsf-epsfilnam.
      DATA lv_dir TYPE epsf-epsdirnam.
      DATA ls_data TYPE ty_datablock.
      DATA lt_data TYPE STANDARD TABLE OF ty_datablock.
      DATA lv_block_len TYPE i.
      DATA lv_package_len TYPE i.
      DATA lv_subrc TYPE sy-subrc.
      DATA lv_msgv1 LIKE sy-msgv1.
      DATA lv_processed_so_far TYPE p.
      DATA lv_append TYPE c.
      DATA lv_status TYPE string.
      DATA lv_filesize TYPE p.
      DATA lv_percent TYPE i.
      "Determine size
      SPLIT lv_as_fn AT '/' INTO lv_dir lv_fil.
      CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
        EXPORTING
          file_name      = lv_fil
          dir_name       = lv_dir
        IMPORTING
          file_size_long = lv_filesize.
      "Open the file on application server
      OPEN DATASET lv_as_fn FOR INPUT IN BINARY MODE MESSAGE lv_msgv1.
      IF sy-subrc <> 0.
        MESSAGE e048(cms) WITH lv_as_fn lv_msgv1 RAISING file_read_error.
        EXIT.
      ENDIF.
      lv_processed_so_far = 0.
      DO.
        REFRESH lt_data.
        lv_package_len = 0.
        DO packagesize TIMES.
          CLEAR ls_data.
          CLEAR lv_block_len.
          READ DATASET lv_as_fn INTO ls_data MAXIMUM LENGTH blocksize LENGTH lv_block_len.
          lv_subrc = sy-subrc.
          IF lv_block_len > 0.
            lv_package_len = lv_package_len + lv_block_len.
            APPEND ls_data TO lt_data.
          ENDIF.
          "End of file
          IF lv_subrc <> 0.
            EXIT.
          ENDIF.
        ENDDO.
        IF lv_package_len > 0.
          "Put file to client
          IF lv_processed_so_far = 0.
            lv_append = ' '.
          ELSE.
            lv_append = 'X'.
          ENDIF.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize         = lv_package_len
              filename             = lv_cl_fn
              filetype             = 'BIN'
              append               = lv_append
              show_transfer_status = abap_false
            TABLES
              data_tab             = lt_data.
          lv_processed_so_far = lv_processed_so_far + lv_package_len.
          "Status display
          lv_percent = lv_processed_so_far * 100 / lv_filesize.
          lv_status = |{ lv_percent }% - { lv_processed_so_far } bytes downloaded of { lv_filesize }|.
          CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
            EXPORTING          "percentage = lv_percent - will make it fash
              text = lv_status.
        ENDIF.
        "End of file
        IF lv_subrc <> 0.
          EXIT.
        ENDIF.
      ENDDO.
      "Close the file on application server
      CLOSE DATASET lv_as_fn.

  • Print Jpeg files from SAP

    Hi,
    We have JPEG files (pictures) stored in Custom Z table (Cluster table). We would like to know how to print these files from SAP on to a certain printer.
    We know that it is not possible to convert JPEG to BMP within SAP and print using SAPScript OR SmartForms.
    We want to find out if there is any print command to print these files to SAP printer  ?
    Any help is appreciated.
    Niranjan

    Hi Gregory,
    I had checked this tcode earlier. However, I don't see any 'Print' jpeg or any other file functionality here. What SAP might be doing here is, allow upload of any document like excel, word or pic files (jpeg, gihf, bmp) and so on and just display.
    I am interested in printing functionality without usng SAP Script OR Smartforms, because, when we get into it, we have to talk only TIF or BMP as JPGs are not supported.
    Niranjan

Maybe you are looking for