Download SAP Report in Spreadsheet Format with automatic Save As selection

Hi All,
I'm using an Excel sheet that links up to SAP to grab some data off of QE03. Due to the nature of my data, I have to save the data into Excel/Spreadsheet format (aka this button )
BUT, when you click that button it stops the script for a "Save As" screen, since it isn't a part of SAP. Since I have a macro immediately after the save that cuts the data, I need this to be fully automated and uninterrupted.
Here is the script I have in excel:
Dim SapGuiAuto
Dim Apps
Dim Connection
Dim session
Dim WScript
Sub Master()
        With Sheets("Graphs")
        Call SAP
        Call QE03
        End With
End Sub
Sub SAP()
If Not IsObject(Apps) Then
   Set SapGuiAuto = GetObject("SAPGUI")
   Set Apps = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
   Set Connection = Apps.Children(0)
End If
If Not IsObject(session) Then
   Set session = Connection.Children(0)
End If
If IsObject(WScript) Then
   WScript.ConnectObject session, "on"
   WScript.ConnectObject Application, "on"
End If
End Sub
Sub QE03()
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nqe03"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]").sendVKey 4
session.findById("wnd[1]/usr/tabsG_SELONETABSTRIP/tabpTAB005/ssubSUBSCR_PRESEL:SAPLSDH4:0220/sub:SAPLSDH4:0220/ctxtG_SELFLD_TAB-LOW[1,24]").Text = "123456"
session.findById("wnd[1]/usr/tabsG_SELONETABSTRIP/tabpTAB005/ssubSUBSCR_PRESEL:SAPLSDH4:0220/sub:SAPLSDH4:0220/ctxtG_SELFLD_TAB-LOW[1,24]").SetFocus
session.findById("wnd[1]/usr/tabsG_SELONETABSTRIP/tabpTAB005/ssubSUBSCR_PRESEL:SAPLSDH4:0220/sub:SAPLSDH4:0220/ctxtG_SELFLD_TAB-LOW[1,24]").caretPosition = 8
session.findById("wnd[1]").sendVKey 0
session.findById("wnd[1]/usr/lbl[1,1]").SetFocus
session.findById("wnd[1]/usr/lbl[1,1]").caretPosition = 8
session.findById("wnd[1]").sendVKey 2
session.findById("wnd[1]/usr/lbl[1,3]").SetFocus
session.findById("wnd[1]/usr/lbl[1,3]").caretPosition = 7
session.findById("wnd[1]").sendVKey 2
session.findById("wnd[0]/usr/ctxtQAQEE-VORNR").Text = "1234"
session.findById("wnd[0]/usr/ctxtQAQEE-VORNR").SetFocus
session.findById("wnd[0]/usr/ctxtQAQEE-VORNR").caretPosition = 4
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/mbar/menu[1]/menu[0]/menu[0]").Select
session.findById("wnd[0]/tbar[1]/btn[40]").press
session.findById("wnd[1]/tbar[0]/btn[8]").press
session.findById("wnd[1]/tbar[0]/btn[37]").press
End Sub
I get stuck right at the last line, "session.findById("wnd[1]/tbar[0]/btn[37]").press" which opens the Save As dialog box. I've seen some similar topics around here, but I am honestly not too savvy at scripting and this is an Excel specific model, so does anyone have any advice?

Hi,
Why are you trying to use  that button?
It's much easier to use simple its called "Local file" u can grab it by shortcut CTRL+SHIFT+f9...
Another option is to use SAP functions:: put "%PC" to command field then enter, and you will get the window with option to save data in excel.
Please find below some examples to download data to excel:
'For STANDARD T-CODES like MB52
'export to excel button
Session.FindById("wnd[0]/tbar[1]/btn[45]").Press
Session.FindById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select
Session.FindById("wnd[1]/tbar[0]/btn[0]").Press
Uname = CreateObject("WScript.Network").UserName
Session.FindById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\Users\" & uname & "\Desktop\"
Session.FindById("wnd[1]/usr/ctxtDY_FILENAME").Text = "TEMP.xls"
'rewrite
Session.FindById("wnd[1]/tbar[0]/btn[11]").Press
OPTION WITH "%PC"
'save to TEMP
session.findById("wnd[0]/tbar[0]/okcd").Text = "%pc"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\Users\" & Uname & "\Desktop\"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").Text = "TEMP.xls"
session.findById("wnd[1]/tbar[0]/btn[11]").press
Best,

Similar Messages

  • Download alv report in excel format in Linux

    Hi All,
    I am working on SAP GUI for Java in Linux PC. I have installed
    Open Office.
    After executing an alv report there is no spreadsheet option
    to download the report in excel format .
    Also, when doing Save as Local File -> Spreadsheet ,
    the report is not downloaded in proper format.
    So, how to download the alv reports in excel format ?

    Hi Vinod ,
    Save as Local File -> Spreadsheet
    It will ask for Directory and file name with .xls format . Give proper name e.g. test.xls and save, and after saving file right click on the file and click on Open with "OpenOffice.org calc".
    It will definetly work.
    Abhijeet

  • Regarding downloading thw report in pdf format

    Hi Experts,
    when we download the report in pdf format using printer friendly icon,
    my concern is that is it possible to add watermark in the downloaded report
    by changing in xml files.
    please suggest any solutions.

    Hi ,
    While scheduling a report we can get the pdf watermark .Check the below link
    http://oraclebizint.wordpress.com/2008/02/04/oracle-bi-ee-101332-adding-watermarks-to-delivered-pdf-documents-using-pdf-merger-api-of-bi-publisher/
    Thanks,
    Ananth

  • Regarding downloading the report in  ppt format

    Hi Experts,
    one of our client facing an issue. this seems very strange issue.
    when he download the report in ppt format and save it to desktop and when open it he is getting error message that
    POWERPOINT CANNOT READ C:\USER\MANOJ\DESKTOP\ABC.PPT
    ,But when we are downloading the report on our system it opens without any error.
    He is using office 2010.
    Please suggest any solution.

    Hi ,
    While scheduling a report we can get the pdf watermark .Check the below link
    http://oraclebizint.wordpress.com/2008/02/04/oracle-bi-ee-101332-adding-watermarks-to-delivered-pdf-documents-using-pdf-merger-api-of-bi-publisher/
    Thanks,
    Ananth

  • Problems downloading spool lists to spreadsheet format

    Hi,
    When downloading spool lists to spreadsheet format, individual columns
    are not separated like lists created online.
    How can we solve this problem?
    (Notes 118692 and 650491 don't give any solution)
    Thanks in advance.
    Eduard

    Your subject header says you own CS5 but your message says CS5.5 so I assume you really want CS5.5.
    Download CS5.5 from http://prodesigntools.com/adobe-cs5-5-direct-download-links.html
    Follow the Very Important Instructions on that page first BEFORE you click the download links.
    Install then enter your serial number to license it.

  • How to save attachment with 'Automatic Save' set to False

    Hi,
    Can someone please clarify for me how I should code for making sure that the attachment is saved (when 'Automatic Save' set to False) . The Developer's guide states that
    "...in the processformRequest method of the controller object, you need to capture the event of this submit button and call commit() explicitly."
    I assume that by "this submit button" the button located on the product page is meant (the page from which attachments page is invoked). In this case my question is - which event to I need to capture for this button? If I am already commiting changes when the user clicks the Apply button on the product page (not on the attachments page) then I thought no additional commit is required anywhere? Is this correct? My problem is that with 'Automatic Save' set to False the attachment is not being saved.
    Thank you.
    Anatoliy

    Rumkumar,
    Thank you for the clarification. Let me ask you please - by calling commit you mean issuing 'transaction().commit()"? The thing is that I AM doing that - I issue commit once I click submitButton on the product page, all changes are saved except the attachements - but the attachment is not saved. Do you have an idea what the problem might be? Of course if I set 'Automatic Save' property on the Attachment item to 'True' then I am fine. I appreciate your feedback.
    Thanks,
    Anatoliy

  • Download classical report to MS word with OLE

    hi experts,
       I have a Classical HR Report that contains profile information of the employee.Now I have to Download the Report to Ms word through OLE . I tried some threads but they were just displaying the static text.I have to download the data for the following format.could some one help me on this?
    WRITE : 'Salary Information '.
    SKIP 1.
    WRITE : 1 SY-ULINE(83).
    WRITE : /1'|',2 'Period Ending On 31ST',25'|',26'Rating(If Any)',42'|',43'Basic Salary',57'|',58'Gpm',70'|',71'CTC',83'|'.
    WRITE : /1 SY-ULINE(83).
    CLEAR YEARSAL.CLEAR CURRENT.
    CLEAR GROSS.CLEAR GROSS1.CLEAR CTC1.
    LOOP AT ISAL INTO WSAL WHERE PERNR = WP01-PERNR AND ENDDA = '99991231' ."AND CURRENT BETWEEN WSAL-BEGDA AND WSAL-ENDDA.
      GROSS = WSAL-BET01 + WSAL-BET02 + WSAL-BET03 + WSAL-BET04.
      GROSS1 = GROSS.CONDENSE GROSS1.
      CTC1 = WSAL-BET10.CONDENSE CTC1.
    WRITE : /1'|',2 'Current' ,25'|',26 WSAL-RTEXT,42'|',43 WSAL-BET01 ,57'|',58 GROSS1,70'|',71 CTC1,83'|'.
    WRITE : /1 SY-ULINE(83).
    ENDLOOP.
    "need to download such information as above to ms word
    "ole format
    CREATE OBJECT gs_word 'WORD.APPLICATION' .
    IF sy-subrc NE 0 .
    MESSAGE s000(su) WITH 'Error while creating OLE object!'.
    LEAVE PROGRAM .
    ENDIF .
    *--Setting object's visibility property
    SET PROPERTY OF gs_word 'Visible' = '1' .
    *--Opening a new document
    GET PROPERTY OF gs_word 'Documents' = gs_documents .
    CALL METHOD OF GS_DOCUMENTS 'ADD' = V_DOCUMENTS.
      CALL METHOD OF gs_selection 'TypeText'
    EXPORTING
    #1 = 'Overview Of The Employee'.
    "the output format would be like this .
    pernr    |   year   |    salary | .......
    Edited by: SYED_ibbu on Feb 23, 2011 11:07 AM
    Edited by: SYED_ibbu on Feb 24, 2011 5:57 AM

    hi experts,
    i Have to display multiple tables in the word document . i am displaying the first table but when i try to display the second table it is getting displayed inside the first table. When i debugged , i found that that the cursor is still in the first row of the first table even after the first table is displayed and the second table is displayed from that cursor position. How to get the cursor position after the end of the table ie outside the table to the main document.could some one help me on this. Below is the code i have used.
    GET PROPERTY OF GS_WORD 'ActiveDocument' = gs_actdoc.
    GET PROPERTY OF gs_actdoc 'Tables' = gs_tables .
    GET PROPERTY OF gs_selection 'Range' = gs_range .
    CALL METHOD OF gs_tables 'Add' = gs_table
    EXPORTING
    #1 = gs_range
    #2 = LINES
    #3 = '7'.
    GET PROPERTY OF gs_table 'Borders' = gs_table_border .
    SET PROPERTY OF gs_table_border 'Enable' = '1' .
    GET PROPERTY OF gs_cell 'Range' = gs_range .
    SET PROPERTY OF gs_range 'Text' = value .
    CALL METHOD OF gs_table 'Cell' = gs_cell
    EXPORTING
    #1 = P_TABIX1
    #2 = CNT.
    GET PROPERTY OF GS_WORD 'ActiveDocument' = gs_actdoc1.
    GET PROPERTY OF gs_actdoc1 'Tables' = gs_tables1 .
    GET PROPERTY OF gs_selection 'Range' = gs_range1 .
    CALL METHOD OF gs_tables1 'Add' = gs_table1
    EXPORTING
    #1 = gs_range1
    #2 = '2'
    #3 = '4'.
    with thanks in advance,
    syed
    Edited by: SYED_ibbu on Feb 25, 2011 5:39 AM

  • Help me to download my report in excel format.

    Here is my code below. On selection screen I am giving three inputs.
    And There are two radio buttons present on my selection screen.
    first one is for display the report.
    second button name is generate(to export the report).
    Clicking on the generate radio button will show the report.
    There should be a standard button on the toolbar called GENERATE.
    Clicking on that button will show a popup window asking to download the report either in .xls format or in .csv format.
    ==========================================================
    My report is being displayed perfectly.But not getting how to downlaod the report in excel and csv format. Would u plz guide me what should I write within the export_report function of my program so that I can download the report. Kindly guide.
    REPORT ZMYREPORT.
    TYPE-POOLS: SLIS.               
    TYPES: BEGIN OF t_afko,
           aufnr type aufnr,        
           gamng type gamng,        
           plnbez type matnr,
           END OF t_afko.
    TYPES: BEGIN OF t_mara,
           matnr TYPE matnr,
           mtart type mtart,         
           pstat type pstat_d,       
           END OF t_mara.
    TYPES: BEGIN OF t_output,
           aufnr type aufnr,              "Production order
           gamng type gamng,         "move number
           mtart type mtart,              "size/fit
           pstat type pstat_d,           "Variant
           quantity type meng8,        "Quantity
           barcode(35) type c,          "barcode
           END OF t_output.
                 INTERNAL TABLES, WORK AREAS AND VARIABLES                      
    *For work area.
    DATA:
          gwa_afko type t_afko,                          "work area for t_afko table
          gwa_mara type t_mara,                          "work area for t_mara table
          gwa_output type t_output,                      "work area for t_output table
          gwa_output1 type t_output,                     "second work area for t_output table
          gwa_fieldcat type slis_fieldcat_alv,           "work area for slis_fieldcat_alv
          gwa_top type slis_listheader,                  "work area for slis_listheader
          wa_variant type disvariant,                    "work area for variant
          wa_Variant1 type disvariant,                   "work area for variant
    *For internal tables.
    gi_afko TYPE STANDARD TABLE OF t_afko,                     
    gi_mara TYPE STANDARD TABLE OF t_mara,               
    gi_output TYPE STANDARD TABLE OF t_output,              
    gi_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
    gi_top TYPE slis_t_listheader,                        
    gi_download TYPE TABLE OF t_download,
    *Variables for screen-input.
          v_aufnr like caufvd-aufnr,  "for production order
          v_txt04 like tj02t-txt04,   "for production order status
          v_plnbez like afko-plnbez.  "for article
    *For constants.
    CONSTANTS: quantity(1) type c value '1',
               lv_save(01) TYPE c VALUE 'A',
               c_csv TYPE char1 VALUE   '|'.
                           S E L E C TI O N     S C R E E N      *
    SELECTION-SCREEN:
    BEGIN OF block inputpath1 WITH FRAME TITLE TEXT-001.            
    SELECT-OPTIONS: s_aufnr for v_aufnr,                                                                               
    s_txt04 for v_txt04,                                                                               
    s_plnbez for v_plnbez.                                
    SELECTION-SCREEN: END OF block inputpath1.
    SELECTION-SCREEN:
    BEGIN OF block inputpath2 WITH FRAME TITLE TEXT-002.   
    PARAMETERS:   
    p_disp RADIOBUTTON GROUP rb DEFAULT'X',   "Button to display report           
    p_gen RADIOBUTTON GROUP rb.         "button for generate option
    SELECTION-SCREEN: END OF block inputpath2.
    SELECTION-SCREEN:
    BEGIN OF block inputpath3 WITH FRAME TITLE TEXT-003.   
    PARAMETERS:layout TYPE disvariant.                                      
    SELECTION-SCREEN: END OF block inputpath3.
                    I-N-I-T-I-A-L-I-Z-A-T-I-O-N                                   *
    INITIALIZATION.
      DATA: g_repid LIKE sy-repid,
            g_uname LIKE sy-uname.
      g_repid = sy-repid.
               AT SELECTION SCREEN                     *
    *Function module for variant.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR layout.
      wa_variant-username = g_uname.
      wa_variant-report = g_repid.
    *Display all existing variants
      DATA:  lv_exit(1) TYPE c.
    *Code for variant part.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant    = wa_variant
          i_save        = lv_save
        IMPORTING
          e_exit        = lv_exit
          es_variant    = wa_variant1
        EXCEPTIONS
          not_found     = 1
          program_error = 2
          OTHERS        = 3.
      IF sy-subrc <> 0.
        layout = wa_variant-variant.
      ELSE.
        IF lv_exit = space.
          layout = wa_variant1-variant.
        ENDIF.
      ENDIF.
                           MAIN PROGRAM                              *
    AT SELECTION-SCREEN .
    *For validating the user inputs on selection screen.
      PERFORM  validate_input.
                      START-OF-SELECTION                         *
    START-OF-SELECTION .
      SET PF-STATUS 'ZGUI1'.
      IF p_disp = 'X'.                         "If the display radio button is checked.
       perform zselection.                  "Data is fetched from tables.
      ENDIF.
                     END-OF-SELECTION                              *
    END-OF-SELECTION.
      IF p_disp = 'X'.
       PERFORM buildcat.
       PERFORM display_report.
      ELSEIF p_gen = 'X'.
        PERFORM display_report.
        PERFORM export_report.
      ENDIF.
    *&      Form  validate_input
    Checking input data validation on the display screen.           *
    form validate_input.
    *Local variables for input validation.
    DATA: lv_aufnr type aufnr,
          lv_txt04 type J_TXT04,
          lv_plnbez type matnr.
    IF s_aufnr[] is not initial.
      SELECT aufnr up to 1 rows
      FROM aufk
      INTO lv_aufnr
      WHERE aufnr IN s_aufnr.
      ENDSELECT.
      IF lv_aufnr IS INITIAL.
      MESSAGE e001(zmssg).
      ENDIF.
    ENDIF.
    IF s_txt04[] is not initial.
      SELECT txt04 up to 1 rows
      FROM TJ02T
      INTO lv_txt04
      WHERE txt04 IN s_txt04.
      ENDSELECT.
      IF lv_txt04 IS INITIAL.   "this depicts that if s_txt04 is initial.
      Message e002(zmssg).
      ENDIF.
    ENDIF.
    IF s_plnbez[] is not initial.
      SELECT plnbez up to 1 rows
      FROM afko
      INTO lv_plnbez
      WHERE plnbez IN s_plnbez.
      ENDSELECT.
      IF lv_plnbez IS INITIAL.   "this depicts that if s_plnbez is initial.
      Message e003(zmssg).
      ENDIF.
    ENDIF.
    endform.                    " validate_input
    *&      Form  zselection
          Fetches data                                           *
    form zselection .
    SELECT aufnr  "production order
           gamng  "move number
           plnbez
           FROM afko
           INTO TABLE gi_afko
           WHERE aufnr IN s_aufnr
           AND plnbez IN s_plnbez.
    SELECT matnr
           mtart        "size/fit
           pstat        "variant
           FROM mara
           INTO TABLE gi_mara
           WHERE matnr IN s_plnbez.
              Populating final data                                         *
    LOOP AT gi_afko INTO gwa_afko.
      READ TABLE gi_mara INTO gwa_mara with key matnr = gwa_afko-plnbez.
      IF sy-subrc IS INITIAL.
    *Moving t_mara and t_afko data from their work area to work area of t_output.
        MOVE   gwa_mara-mtart TO gwa_output-mtart.
        MOVE   gwa_mara-pstat TO gwa_output-pstat.
        MOVE  gwa_afko-aufnr TO gwa_output-aufnr.
        MOVE  gwa_afko-gamng TO gwa_output-gamng.
        APPEND gwa_output TO gi_output.
        ENDIF.
    ENDLOOP.
    *Populating the quantity field
      LOOP AT gi_output INTO gwa_output.
        gwa_output-quantity = '1'.
        MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING quantity.
    *Concategnating aufnr, pstat into barcode
        CONCATENATE gwa_output-aufnr gwa_output-pstat INTO gwa_output-barcode .
        MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING barcode.
      ENDLOOP.
    endform.                    " zselection
    *&      Form  buildcat
          text
    form buildcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'AUFNR'.
      gwa_fieldcat-seltext_l = 'PRODUCTION ORDER'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 1.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'GAMNR'.
      gwa_fieldcat-seltext_l = 'MOVE NUMBER'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 2.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'MTART'.
      gwa_fieldcat-seltext_l = 'SIZE/FIT'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 3.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'PSTAT'.
      gwa_fieldcat-seltext_l = 'VARIANT'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 4.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'QUANTITY'.
      gwa_fieldcat-seltext_l = 'QUANTITY'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 5.
      APPEND gwa_fieldcat TO gi_fieldcat.
      CLEAR gwa_fieldcat.
      gwa_fieldcat-fieldname = 'BARCODE'.
      gwa_fieldcat-seltext_l = 'BARCODE'.
      gwa_fieldcat-tabname = 'GI_OUTPUT'.
      gwa_fieldcat-emphasize = 'C201'.
      gwa_fieldcat-col_pos = 6.
      APPEND gwa_fieldcat TO gi_fieldcat.
    endform.                    " buildcat
    *&      Form  top
          text
    FORM top .
    REFRESH gi_top.
    gwa_top-typ = 'H'.
    gwa_top-info = My alv report'.
    APPEND gwa_top TO gi_top.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = gi_top
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                "top
    *&      Form  display_report
    form display_report .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
       I_INTERFACE_CHECK                 = ' '
       I_BYPASSING_BUFFER                = ' '
       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = g_repid
       I_CALLBACK_PF_STATUS_SET          =  'PF-STATUS'
       I_CALLBACK_USER_COMMAND           = ' '
        I_CALLBACK_TOP_OF_PAGE            = 'TOP'
       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
       I_CALLBACK_HTML_END_OF_LIST       = ' '
       I_STRUCTURE_NAME                  =
       I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      =
       I_GRID_SETTINGS                   =
       IS_LAYOUT                         =
        IT_FIELDCAT                       = gi_fieldcat
       IT_EXCLUDING                      =
       IT_SPECIAL_GROUPS                 =
       IT_SORT                           =
       IT_FILTER                         =
       IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
        I_SAVE                            = 'A'
        IS_VARIANT                        = wa_variant1
       IT_EVENTS                         =
       IT_EVENT_EXIT                     =
       IS_PRINT                          =
       IS_REPREP_ID                      =
       I_SCREEN_START_COLUMN             = 0
       I_SCREEN_START_LINE               = 0
       I_SCREEN_END_COLUMN               = 0
       I_SCREEN_END_LINE                 = 0
       I_HTML_HEIGHT_TOP                 = 0
       I_HTML_HEIGHT_END                 = 0
       IT_ALV_GRAPHICS                   =
       IT_HYPERLINK                      =
       IT_ADD_FIELDCAT                   =
       IT_EXCEPT_QINFO                   =
       IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER           =
       ES_EXIT_CAUSED_BY_USER            =
       TABLES
         t_outtab                          = gi_output
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform.                    " display_report
    *&      Form  export_report
          text
    form export_report.
    endform.

    Hi Cinthia,
    Check this Link.
    How Can we genarate Excel file without GUI_DOWNLOAD
    Reward points if useful.
    Regards,
    Abhishek

  • How to generate one report in multiple formats with FOP or BIP?

    Hi all,
    Is it possible to generate multiple formats of one report in a single "call" using Apache FOP or BI Publisher? (something similar to reports bursting).
    Right now I can only select one format at a time.
    Thank you,
    Ana-Maria

    Hi Ana-Maria,
    When you enable printing on a report region or add a button to download a report query to your application, then you get a single document download. How would you see this working with "multiple formats"? Given that APEX is a development environment, you can pretty much implement anything you like. The built-in printing capabilities in APEX come with an API that allow for customization of the default functionality, e.g. you can use apex_util.download_print_document to dynamically assign report layouts at rumtime or to use you own XML data sources or XSL-FO style sheets. More relevant to you question though, there's also apex_util.get_print_document. What that allows you to do is to generate report documents inside the database and e.g. store them in database tables or email them out to a list of recipients. You can call this API as often as you like to, requesting any combination of available report formats.
    The API function is documented here:
    http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_util.htm#CHDDECIA
    Regards,
    Marc

  • Sum function do not work in oracle reports enhanced spreadsheet format

    we are using oracle reports 10.1.2.3 in our oracle application server 10gr2 and we are creating enhanced spreed sheet.And the report opens in MS excel fine.But we can not apply any formula like VALUE,SUM,AVG on that report after opening it into excel.First we thought that it may be because of the comma in the number filed.we removed that comma from the filed but t still gives the error "Error in value"

    Hi,
    I hope you already solved this problem, I had the same issue after spending an hour I found the workaround, this is just for the guys who experience the same issue. Try to format your number columns either at database level(not via Report builder property palette) with TO_CHAR(...) OR use this Format Mask at Report level to format your numbers -NNNGNNNGNN0D000(negative sign must be there to avoid space in output Excel).
    Hope it helps,
    Regards,
    Syed Khawar

  • I want to download a report into Excel sheet with color Heading..Is it Poss

    Hi All
    I want to download error records into Excel sheet with color Heading..Is it Possible to download into excel with Color Heading?
    here i am <b>using the 3 sheets in one</b>
    t_error-bkpf -> Sheet1
    t_error-bseg-> sheet 2
    t-error-bsec -> sheet3.
    Rgds
    Raghav

    <b>The following thread has the code which will put data into multiple sheets</b>
    Download to multiple sheets in Excel
    FOR COLOR LOGIC  JUST REFER THIS PROGRAM
    *& Report  ZNEGI17                                                     *
    REPORT  ZNEGI17  NO STANDARD PAGE HEADING.
    * this report demonstrates how to send some ABAP data to an
    * EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    * handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
    H_MAPL TYPE OLE2_OBJECT, " list of workbooks
    H_MAP TYPE OLE2_OBJECT, " workbook
    H_ZL TYPE OLE2_OBJECT, " cell
    H_F TYPE OLE2_OBJECT. " font
    TABLES: SPFLI.
    DATA H TYPE I.
    * table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *& Event START-OF-SELECTION
    START-OF-SELECTION.
    * read flights
    SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    * display header
    ULINE (61).
    WRITE: / SY-VLINE NO-GAP,
    (3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
    ULINE /(61).
    * display flights
    LOOP AT IT_SPFLI.
    WRITE: / SY-VLINE NO-GAP,
    IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
    ENDLOOP.
    ULINE /(61).
    * tell user what is going on
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    * PERCENTAGE = 0
    TEXT = TEXT-007
    EXCEPTIONS
    OTHERS = 1.
    * start Excel
    CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    * PERFORM ERR_HDL.
    SET PROPERTY OF H_EXCEL 'Visible' = 1.
    * CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:kis_excel.xls'
    * PERFORM ERR_HDL.
    * tell user what is going on
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    * PERCENTAGE = 0
    TEXT = TEXT-008
    EXCEPTIONS
    OTHERS = 1.
    * get list of workbooks, initially empty
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    PERFORM ERR_HDL.
    * add a new workbook
    CALL METHOD OF H_MAPL 'Add' = H_MAP.
    PERFORM ERR_HDL.
    * tell user what is going on
    * CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    * EXPORTING
    ** PERCENTAGE = 0
    * TEXT = TEXT-009
    * EXCEPTIONS
    * OTHERS = 1.
    * output column headings to active Excel sheet
    PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
    PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
    PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
    PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
    PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
    LOOP AT IT_SPFLI.
    * copy flights to active EXCEL sheet
    H = SY-TABIX + 1.
    PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
    PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
    PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
    PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
    PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
    ENDLOOP.
    * changes by Kishore - start
    * CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
    PERFORM ERR_HDL.
    * add a new workbook
    CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
    PERFORM ERR_HDL.
    * tell user what is going on
    SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
    * CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    * EXPORTING
    ** PERCENTAGE = 0
    * TEXT = TEXT-009
    * EXCEPTIONS
    * OTHERS = 1.
    * output column headings to active Excel sheet
    PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
    PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
    PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
    PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
    PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
    LOOP AT IT_SPFLI.
    * copy flights to active EXCEL sheet
    H = SY-TABIX + 1.
    PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
    PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
    PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
    PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
    PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
    ENDLOOP.
    * changes by Kishore - end
    * disconnect from Excel
    * CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:SKV.XLS'.
    FREE OBJECT H_EXCEL.
    PERFORM ERR_HDL.
    * FORM FILL_CELL *
    * sets cell at coordinates i,j to value val boldtype bold *
    FORM FILL_CELL1 USING I J BOLD VAL.
    data : color(5) type x value 'H80000008'.
    CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
    PERFORM ERR_HDL.
    SET PROPERTY OF H_ZL 'Value' = VAL .
    PERFORM ERR_HDL.
    GET PROPERTY OF H_ZL 'Font' = H_F.
    PERFORM ERR_HDL.
    SET PROPERTY OF H_F 'Bold' = BOLD .
    PERFORM ERR_HDL.
    SET PROPERTY OF H_F 'ColorIndex' = 3 .
    PERFORM ERR_HDL.
    ENDFORM.
    *& Form ERR_HDL
    * outputs OLE error if any *
    * --> p1 text
    * <-- p2 text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
    WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
    STOP.
    ENDIF.
    ENDFORM. " ERR_HDL
    *&      Form  FILL_CELL1
    *       text
    *      -->P_H  text
    *      -->P_1      text
    *      -->P_0      text
    *      -->P_IT_SPFLI_CARRID  text
    form FILL_CELL  using   I J BOLD VAL.
    CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
    PERFORM ERR_HDL.
    SET PROPERTY OF H_ZL 'Value' = VAL .
    PERFORM ERR_HDL.
    GET PROPERTY OF H_ZL 'Font' = H_F.
    PERFORM ERR_HDL.
    endform.                    " FILL_CELL1
    kishan negi

  • SAP report in PDF format

    Hello Gurus,
    How to get all the ECC repots in PDF format? I have tried doing the distiller as default printer, but didn't work out.
    I am using SAP ECC 6.
    Thanks and Regards,
    Rahul

    Hello,
    Auto convert SAP spool output to PDF file
    As of Release 4.6D, PDF format (Adobe Acrobat data format) can be created via the SAP spooler by using the device type "PDF1".
    As a workaround, a report (RSTXPDFT4) is made available for the missing "direct PDF printing", which can read spool requests, convert to PDF and perform a frontend download.
    Read OSS Note 317851 - Printing PDF files in 4.6C/4.6B/4.5B
    Note the restrictions specified in Note 323736 with the print output with PDF.
    Caution when modifying device type ZPDF1, see Note 437696.
    Version < 4.6D
    If you are in version less than 4.6D, you can configure an output type to convert the spool automatically into a PDF format into your local harddisk but not do a "direct PDF printing".
    When you print to this PDF output type, it will prompt you to enter the file name of your PDF file to be stored into your local harddisk.
    First you have to add a printer using
    Windows -> Start -> Settings -> Printers -> Generic / Text Only -> Port : Print to File
    Next create a new device type e.g. ZPDF -> Select device type ZPDF1
    Options for HostSpoolAccMethod -> Host spool access method : F : Printing on Frontend Computer
    Host Printer : __DEFAULT or Generic / Text Only
    Save your entries.
    When you print to the device type ZPDF, choose Generic / Text Only for the Frontend Computer if it is not the default type.
    A user prompt Print to File will appear to let you specify the Output File Name.
    Regards
    ismail KARAYAKA

  • Not able to download MCSI report in XXL format after installed OpenOffice

    Hey Friends,
    Very Good Morning~~~
    Now i am facing one problem in Downloading for MCSI report via OpenOffice.
    previously it was working with MSOffice but now we are not able to download the resport after installed
    OpenOffice~~
    Thanks and Regards
         Gopi.M
    Lucas Indian Service Ltd
    Chennai

    Hi,
    As per your query this is not related to SAP issue, this issue comes form msoffice. Pls re-install ms-office and download in SAP given format.
    Anil

  • Report in excel format with proper alignment

    Hi all,
    We are using Reports 10g R2.
    Users want to see the report (invoked from forms) in excel format. Of course, I gave "spreadsheet" as the des type and alignment is the major task. Already more than 500 & above reports are there. So it will not be easy to align the existing report.
    Please give me an idea to find a solution for this.
    Oracle Team -- Please Guide me.
    Regards
    Priya

    Read MetaLink Note 333080.1 for tips and techniques with using the spreadsheet output of Reports.

  • Download Interactive Reports to Spreadsheet - Aggregation rows?

    Is there any way to use the Interactive Report download formats (either XLS or CSV) so that the spreadsheet includes the aggregation rows (SUM, AVERAGE) for each control break displayed on the screen.
    I am on 3.1.0.00.32 (soon we will be at 4.1).
    When we create a customized report using the interactive tools, it only downloads the data, and not the sum rows.

    bhenderson wrote:
    Is there any way to use the Interactive Report download formats (either XLS or CSV) so that the spreadsheet includes the aggregation rows (SUM, AVERAGE) for each control break displayed on the screen.
    I am on 3.1.0.00.32 (soon we will be at 4.1).
    When we create a customized report using the interactive tools, it only downloads the data, and not the sum rows.A workaround would be to use SQL to provide the aggregation rows. The ROLLUP, CUBE and GROUPING SETS (my favourite) group functions are especially build for such a task.
    Here is an example in the docs: http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_10002.htm#i2091446

Maybe you are looking for