Download to Excel is hiding rows in a pivot view

Hello ,
When downloading a report to excel from OBIEE Dashboard , certain rows are getting hidden . For instance , I have total 15 rows in my pivot view and when I download that report into excel format , the rows from 8-13 are not showing up . After 7th row I see 14th row .
But when I download the same report from Answers I can see all rows in the pivot view .
I tried looking at the formatting options of the pivot view and everything is normal . This is happening only with this particular report , other reports in dashboard download normally .
Please let me know if anybody has ideas .
Thank you
Karthik

karthik,
From where ur downloading to excel ...use the download option available at "preview " button ,if you are using the same go with report links download button option
Last option create a new report (without any filters in case if u have)
Thanks,
Saichand.v

Similar Messages

  • Row count in Pivotal View (10 rows per page)

    Hi
    I tried following options to restrict row count in Pivotal view of a report, however the out put is inconsistent in pivotal view.
    1. CEILING((RCOUNT(1))/10.0)
    2. TRUNCATE((RCOUNT(1)-1)/10, 0) +1
    3. Even Case statement also
    Appreciate the help extended

    just a note now its ok..i think its a transactional database ....some how the data has changed it modified the query and ur getting correct results am i correct ?
    think of a solution to get a bug free report ;)
    thanks,
    Saichand.v

  • ChartView and FilterView are overlapping whenever I download into Excel

    Hi,
    I have a report with chart view as well as filterview resides at the bottom of the chart.
    Whenever am trying to download the report into Excel the Filterview is over lapping on the Chart View.
    Can you guys please suggest how can i overcome this.
    Thanks in advance,
    Pramod

    This an extract from Oracle metalink..
    This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
    Applies to:
    Answers, Interactive Dashboard - Version: 10.1.3.4.1 [1900] - Release: 10g
    Information in this document applies to any platform.
    Symptoms
    When downloading reports that have multiple charts into Excel, the charts appear overlapping. The downloaded report(excel file) looks different from what it displayed in a dashboard.
    Cause
    There is a defect around downloading a request to excel that has multiple views on the report
    This is as per a number of bugs already raised around this issue:
    Bug 8825314: TABLE VIEW OVERLAPPED WITH CHART VIEW IN THE EXCEL SHEET
    Bug 8478529: DOWNLOADED EXCEL SHEET HAS VIEWS THAT OVERLAP EACH OTHER
    Bug 7700214: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE TABLE VIEW
    Bug 7501223: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE PIVOT TABLE
    Solution
    The following bugs already raised to address this issue:
    Bug 8825314: TABLE VIEW OVERLAPPED WITH CHART VIEW IN THE EXCEL SHEET
    Bug 8478529: DOWNLOADED EXCEL SHEET HAS VIEWS THAT OVERLAP EACH OTHER
    Bug 7700214: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE TABLE VIEW
    Bug 7501223: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE PIVOT TABLE
    Workaround at this stage would be to use download to html/powerpoint.
    Hope this helps!
    Regards..

  • Download to excel - long text in single row using gui_download

    Hi Experts,
    I want to download the long text (read_text) (500-600 characters) to excel in single row. the column width should be 60.
    i am using the gui_download FM as in my report i m using one gui_download for header data and 2nd one for details using APPEND . Can u suggest me the solutions for the same. Can i use word wrap option and if yes , then how to use it?
    For eg.
    Customer Satisfaction
    There are no escalations / adverse feedback from the customer
    Customer uses him/her for benchmarking others
    Regular status update to customer
    Proactively understands future needs of customer
    Increases customer's confidence so that there is an increase in quality / quantity of work
    This whole text should appear as single row.
    Thanks,
    Edited by: Khushi p on Nov 12, 2010 10:44 AM

    I tried alot to put this in a legible format by usingcode...code but still it is not putting the code in a correct format.May be some mentor will put it in a good format so that you can understand.Below is a wraper progrm which meets your objective.
    REPORT  ZSCRATCHPAD.
    TABLES:EKPO.
    TYPE-POOLS:slis.
    TYPES : BEGIN OF ty_ekpo,
             ebeln TYPE ekko-ebeln,
             ebelp TYPE ekpo-ebelp,
             txz01 TYPE ekpo-txz01,
             matnr TYPE ekpo-matnr,
             werks TYPE ekpo-werks,
             loekz TYPE ekpo-loekz,
             oic_ptrip TYPE ekpo-oic_ptrip,
             menge TYPE ekpo-menge,
             meins  TYPE ekpo-meins,
             umrez TYPE ekpo-umrez,
             umren TYPE ekpo-umren,
             text  TYPE string,
            END OF ty_ekpo.
    TYPES : BEGIN OF ty_text ,
            tdformat TYPE tline-tdformat,
            tdline TYPE tline-tdline,
            END OF ty_text.
    data:  g_t_ekpo TYPE STANDARD TABLE OF ty_ekpo WITH HEADER LINE,
           g_repid TYPE sy-repid,
           g_ebeln(15),
           l_fieldname1 LIKE ibipparms-path,
           l_fieldname2 TYPE string,
           g_objectid LIKE cdhdr-objectid,
           g_t_text TYPE STANDARD TABLE OF ty_text WITH HEADER LINE,
           g_t_text1 TYPE STANDARD TABLE OF ty_text WITH HEADER LINE.
    data:g_fieldcat type slis_t_fieldcat_alv with header line,
         g_events type slis_t_event,
         wa_events like line of g_events,
         g_listheader type slis_t_listheader,
         walistheader like line of g_listheader,
         g_layout type slis_layout_alv,
         g_top type slis_formname,
         g_sort type slis_t_sortinfo_alv with header line,
         g_sort1 type slis_sortinfo_alv,
         g_printparams type slis_print_alv,
         g_variant type disvariant,
         g_title type lvc_title,
         g_excluding type slis_t_extab,
         g_grid TYPE REF TO cl_gui_alv_grid.
    field-symbols: <fs> type lvc_title.
    SELECT-OPTIONS:P_EBELN FOR EKPO-EBELN NO INTERVALS.
    PARAMETERS:p_r1 radiobutton group grp1,
               p_r2 radiobutton group grp1.
    SELECT ebeln
           ebelp
           txz01
           matnr
           werks
           loekz
           oic_ptrip
           menge
           meins
           umrez
           umren
           INTO TABLE g_t_ekpo
           FROM ekpo
           WHERE ebeln IN p_ebeln
           AND loekz NE 'L'.
    IF sy-subrc <> 0.
      CLEAR g_t_ekpo.
    ENDIF.
    define m_fieldcat.
      g_fieldcat-fieldname = &1.
      g_fieldcat-col_pos = &2.
      g_fieldcat-seltext_l = &3.
      g_fieldcat-do_sum = &4.
      g_fieldcat-outputlen = &5.
      g_fieldcat-checkbox = &6.
      append g_fieldcat to g_fieldcat.
      clear  g_fieldcat.
    end-of-definition.
    if p_r1 = 'X'.
    PERFORM summary_display.
    else.
    perform download.
    endif.
    FORM summary_display .
      concatenate 'Test' ' ' into g_title separated by space.
      assign g_title to <fs>.
      g_repid = sy-repid.
      m_fieldcat 'EBELN'     ''  'EBELN'     ''  10   ''.
      m_fieldcat 'EBELP'     ''  'EBELP'     ''  05   ''.
      m_fieldcat 'TXZ01'     ''  'TXZ01'     ''  40   ''.
      m_fieldcat 'MATNR'     ''  'MATNR'     ''  10   ''.
      m_fieldcat 'WERKS'     ''  'WERKS'     ''  04   ''.
      m_fieldcat 'LOEKZ'     ''  'LOEKZ'     ''  01   ''.
      m_fieldcat 'OIC_PTRIP' ''  'OIC_PTRIP' ''  16   ''.
      m_fieldcat 'MENGE'     ''  'MENGE'     ''  13   ''.
      m_fieldcat 'MEINS'     ''  'MEINS'     ''  03   ''.
      m_fieldcat 'UMREZ'     ''  'UMREZ'     ''  05   ''.
      m_fieldcat 'UMREN'     ''  'UMREN'     ''  05   ''.
      g_layout-zebra = 'X'.
      g_layout-colwidth_optimize = 'X'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       =  g_repid
    *     i_callback_pf_status_set = 'SET_PF_STATUS'
          is_layout                =  g_layout
          i_callback_user_command  =  'LIST1'
          i_grid_title             = <fs>
    *     i_callback_top_of_page   = ' '
          it_fieldcat              = g_fieldcat[]
    *     it_excluding             = g_excluding
          i_save                   = 'A'
    *     is_variant               = ITVARIANT
          it_events                = g_events[]
    *     is_print                 = ITPRINTPARAMS
    *     it_sort                  = itsort[]
        tables
          t_outtab                 =  g_t_EKPO[]
          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.
      clear:g_fieldcat.
      refresh:g_fieldcat.
    ENDFORM.                    " summary_display
    form list1 using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
      case r_ucomm.
        when '&IC1'.
          REFRESH g_t_text.
          if rs_selfield-fieldname = 'EBELN'.
            READ TABLE g_t_ekpo INDEX rs_selfield-tabindex.
            CONCATENATE g_t_ekpo-ebeln  g_t_ekpo-ebelp  INTO g_ebeln. "CRQ94538-Capture text
            SHIFT g_ebeln LEFT DELETING LEADING space.
            PERFORM read_text USING g_ebeln g_t_text[].
            IF g_t_text[] IS NOT INITIAL.
              PERFORM pop_up_with_table .
            ENDIF.
          endif.
        when 'OTHERS'.
          leave to screen 0.
      endcase.
    endform.                                                    "list1
    FORM read_text  USING    p_ebeln   p_t_itab LIKE g_t_text1[].
      PERFORM fill_readtext USING p_ebeln 'EKPO' 'F01' p_t_itab.
    ENDFORM.                    " f0008_read_text
    FORM fill_readtext  USING    p_vbeln
                                 p_object
                                 p_textid
                                 pt_itab  LIKE g_t_text[] .
      DATA: ls_itab LIKE LINE OF g_t_text,
            l_header LIKE thead,
            l_tdname LIKE thead-tdname.
      CLEAR pt_itab.
      REFRESH pt_itab.
      MOVE p_vbeln TO l_tdname.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          client                  = sy-mandt
          id                      = p_textid
          language                = sy-langu
          name                    = l_tdname
          object                  = p_object
        IMPORTING
          header                  = l_header
        TABLES
          lines                   = pt_itab
        EXCEPTIONS
          id                      = 1
          language                = 2
          name                    = 3
          not_found               = 4
          object                  = 5
          reference_check         = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
    endform.                    "fill_readtext
    FORM pop_up_with_table .
      CALL FUNCTION 'POPUP_WITH_TABLE'
        EXPORTING
          endpos_col   = 82
          endpos_row   = 20
          startpos_col = 10
          startpos_row = 10
          titletext    = ' '
        TABLES
          valuetab     = g_t_text
        EXCEPTIONS
          break_off    = 1
          OTHERS       = 2.
      IF sy-subrc NE 0.
        CLEAR g_t_text.
      ENDIF.
    ENDFORM.                    " f4000_pop_up_with_table
    FORM download .
      if g_t_ekpo[] is not initial.
        loop at g_t_ekpo.
    *      concatenate text-001 g_t_ekpo-matnr into g_t_ekpo-matnr.
          PERFORM convert_table_to_string.
          modify g_t_ekpo.
          clear g_t_ekpo.
        endloop.
      endif.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'C:/KKVT/TEST.XLS'
          filetype                = 'ASC'
          write_field_separator   = 'X'
        TABLES
          data_tab                = g_t_ekpo
        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.
      else.
      message: 'file downloaded' type 'S'.
      ENDIF.
    ENDFORM.                    " download
    FORM convert_table_to_string .
      DATA: str TYPE string,
            len TYPE i,
            tot_len TYPE i.
      FIELD-SYMBOLS <fs1> TYPE ANY.
      IF g_t_ekpo-ebeln IS NOT INITIAL.
        CONCATENATE g_t_ekpo-ebeln  g_t_ekpo-ebelp  INTO g_ebeln. "CRQ94538-Capture text
        SHIFT g_ebeln LEFT DELETING LEADING space.
        PERFORM read_text USING g_ebeln g_t_text[].
        IF g_t_text[] IS NOT INITIAL.
          CLEAR: len,
                 tot_len,
                  str.
          DO.
            ASSIGN COMPONENT sy-index OF STRUCTURE g_t_text TO <fs1>.
            IF sy-subrc NE 0.
              EXIT.
            ENDIF.
            DESCRIBE FIELD <fs1> LENGTH len IN CHARACTER MODE.
            ADD len TO tot_len.
          ENDDO.
          CALL FUNCTION 'CONVERT_TABLE_TO_STRING'
            EXPORTING
              i_tabline_length = tot_len
            IMPORTING
              e_string         = str
            TABLES
              it_table         = g_t_text[].
          IF sy-subrc = 0.
            g_t_ekpo-text = str.
          ENDIF.
        ELSE.
          CLEAR: g_t_ekpo-text,
                 tot_len,
                 len,
                 str.     .
        ENDIF.
      ENDIF.
    ENDFORM.                    " convert_table_to_string
    Edited by: Kiran K on Nov 18, 2010 5:21 AM

  • Maximum no of rows that can be downloaded to excel in obiee 11g

    Hi
    Please let me know the Maximum no of rows that can be downloaded to excel in obiee 11g and the respective parameter(s) to change in the instanceconfig etc.
    Thanks

    Hello,
    You can find informations about your request here :http://lamont-consulting.com/index.php/blog/obiee/11g/126-obiee-maxcells
    Bye

  • OBIEE 11g - Download All/Display All of rows in Answers

    Hi All,
    I have created a request in OBIEE 11g and now displaying it on dashboard.
    by default shows 25 rows, can extend it fo 500 rows, next i should keep on clicking to see full data.
    Also download of data is possible for the rows available on page only i.e. 500 rows are only getting exported to excel.
    Any way to view all data on dashboard at once and download as well?
    Please help, thanks.
    Regards,
    srl

    Hi ,
    To implement the solution, please do:
    1. Change instanceconfig.xml file in <biee11g_install>\instances\instance1\config\OracleBIPresentationServicesComponent\coreapplication_obips1 as following
    <Views>
    <Pivot>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
    <DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
    <DefaultRowsDisplayedInDownload>2500</DefaultRowsDisplayedInDownload>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
    <DisableAutoPreview>false</DisableAutoPreview>
    <MaxVisibleColumns>5000</MaxVisibleColumns>
    <MaxVisiblePages>2500</MaxVisiblePages>
    <MaxVisibleRows>500000</MaxVisibleRows>
    <MaxVisibleSections>5000</MaxVisibleSections>
    </Pivot>
    <Table>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
    <DefaultRowsDisplayedInDelivery>75</DefaultRowsDisplayedInDelivery>
    <!--This Configuration setting is managed by Oracle Business Intelligence Enterprise Manager-->
    <DefaultRowsDisplayedInDownload>2500</DefaultRowsDisplayedInDownload>
    <MaxVisiblePages>2500</MaxVisiblePages>
    <MaxVisibleRows>500000</MaxVisibleRows>
    <MaxVisibleSections>5000</MaxVisibleSections>
    </Table>
    </Views>
    3. Note the new elements added are the following to both <Pivot> and <Table>, the Pivot part controls Pivot view, and Table part controls Table View, my testing was done with Table View.
    <MaxVisiblePages>2500</MaxVisiblePages>
    <MaxVisibleRows>500000</MaxVisibleRows>
    <MaxVisibleSections>5000</MaxVisibleSections>
    4. Restart Presentation Server from EM, then run your request, do excel export to verify.
    Thanks...

  • How can i bring the column heading downloaded in excel sheet?

    hi all,
    I am using  FM SAP_CONVERT_TO_XLS_FORMAT to downloading populated internal table data into excel sheet by using filename type rlgrap-filename.
    Now I need the column heading(field name) for downloaded data in excel sheet.
    pls tell me how can i merge the col heading with data perfectly. Is there any FM fulfills this requirement.
    pls give me a suitable approch.
    Thanks
    PRR

    HI,
    Go thru this code.
    REPORT  ZRMM0056  NO STANDARD PAGE HEADING
                          MESSAGE-ID ZZ
                          LINE-SIZE 300
                          LINE-COUNT 65.
    Program              : ZRMM0056
    Title                : Non Inventory PO's
    Description          : Non Inventory Purchase Orders details with
                           Vendor and Invoice Receipts and Goods Receipts.
    Input  :
           Select-options  : 1. G/L Account No
           Parameters      : 1.File Paths for the Excel sheet
           Others (Specify):
    Output : Extract Files in the application server
           Report  :
    Hear Ticket #        : 113392
    Created by           : Srinivas Rao.M
    Created on           : 12/15/2005
    Version              : 1
    Request              : D10K944304
    Transaction Code     : Z420
    Change History                                                       *
    Date         Programmer  Search String   Description                 *
    12/19/2005   Srinivas    D10K944316      Removed Purchasing document
                                             Company code and Plant from
                                             Select-Options and Inculded
                                             G/L Account No and changed
                                             code accordingly.
    T A B L E S                                                          *
    TABLES: EKBE,              " History of Purchasing Document
            EKPO,              " Purchasing Document Item
            EKKO,              " Purchasing Document Header
            LFA1,              " Vendor master (general section)
            EKKN.              " Account Assignment in Purchasing Doc
                        INTERNAL TABLES
    *--Internal table to store Purchasing document header data
    DATA : BEGIN OF IT_POHEADER OCCURS 0,
            EBELN LIKE EKKO-EBELN,      "Purchasing document
            AEDAT LIKE EKKO-AEDAT,      "Created on
            ERNAM LIKE EKKO-ERNAM,      "Created by
            LIFNR LIKE EKKO-LIFNR,      "Vendor
          END OF IT_POHEADER.
    *--Internal table to store Purchasing document Item data
    DATA : BEGIN OF IT_POITEM OCCURS 0,
            EBELN LIKE EKPO-EBELN,       "Purchasing document
            EBELP LIKE EKPO-EBELP,       "Item Number
            MATNR LIKE EKPO-MATNR,       "Material number
            BUKRS LIKE EKPO-BUKRS,       "Company code
            WERKS LIKE EKPO-WERKS,       "Plant
            MATKL LIKE EKPO-MATKL,       "Material Group
            MENGE LIKE EKPO-MENGE,       "Order Quantity
            NETPR LIKE EKPO-NETPR,       "Net Price
            PEINH LIKE EKPO-PEINH,       "Price unit
            NETWR LIKE EKPO-NETWR,       "Net Value
          END OF IT_POITEM.
    *--Internal table to hold final display data.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
             EBELN LIKE EKKO-EBELN,       "Purchasing document
             EBELP LIKE EKPO-EBELP,       "Item Number
             AEDAT LIKE EKKO-AEDAT,       "Created on
             ERNAM LIKE EKKO-ERNAM,       "Created by
             MATNR LIKE EKPO-MATNR,       "Material number
             BUKRS LIKE EKPO-BUKRS,       "Company code
             WERKS LIKE EKPO-WERKS,       "Plant
             MATKL LIKE EKPO-MATKL,       "Material Group
             MENGE LIKE EKPO-MENGE,       "Order Quantity
             NETPR LIKE EKPO-NETPR,       "Net Price
             PEINH LIKE EKPO-PEINH,       "Price unit
             NETWR LIKE EKPO-NETWR,       "Net Value
             LIFNR LIKE EKKO-LIFNR,       "Vendor
             NAME1 LIKE LFA1-NAME1,       "Vendor Name
             GSBER LIKE EKKN-GSBER,      "Business area
    *--IR details
            IR_BELNR LIKE EKBE-BELNR,     "IR-Number of Material Document
            IR_BUZEI LIKE EKBE-BUZEI,     "IR-Item in material Document
            IR_BUDAT LIKE EKBE-BUDAT,     "IR-Posting date
            IR_MENGE LIKE EKBE-MENGE,     "IR-Quantity
    *--GR details
            GR_BELNR LIKE EKBE-BELNR,     "GR-Number of Material Document
            GR_BUZEI LIKE EKBE-BUZEI,     "GR-Item in material Document
            GR_BUDAT LIKE EKBE-BUDAT,     "GR-Posting date
            GR_MENGE LIKE EKBE-MENGE,     "GR-Quantity
          END OF IT_FINAL.
    *--Internal table to store History per Purchasing Document data
    DATA : BEGIN OF IT_HISTORY OCCURS 0,
            EBELN LIKE EKBE-EBELN,        "Purchasing document
            EBELP LIKE EKBE-EBELP,        "Item
            VGABE LIKE EKBE-VGABE,        "Trans/Event type
            BELNR LIKE EKBE-BELNR,        "Number of Material Document
            BUZEI LIKE EKBE-BUZEI,        "Item in material Document
            BUDAT LIKE EKBE-BUDAT,        "Posting date
            MENGE LIKE EKBE-MENGE,        "Quantity
            BEWTP LIKE EKBE-BEWTP,        "Posting history category
           END OF IT_HISTORY.
    *--Internal table to store vendor name.
    DATA : BEGIN OF IT_VENDOR OCCURS 0,
             LIFNR LIKE LFA1-LIFNR,      "Vendor Number
             NAME1 LIKE LFA1-NAME1,      "Vendor Name
           END OF IT_VENDOR.
    *--Internal table to store Business area for Purchasing document
    DATA : BEGIN OF IT_BUSINESS OCCURS 0,
             EBELN LIKE EKKN-EBELN,      "Purchasing document
             EBELP LIKE EKKN-EBELP,      "Purchasing Item
             SAKTO LIKE EKKN-SAKTO,      "G/L Account No
             GSBER LIKE EKKN-GSBER,      "Business area
           END OF IT_BUSINESS.
    DATA : BEGIN OF FIELDNAMES OCCURS 0,
           TEXT(40),
          END OF FIELDNAMES.
                    VARIABLES DECLARATION                                *
    DATA: V_FILE LIKE IBIPPARMS-PATH,         "File path
           V_FLD  LIKE DYNPREAD-FIELDNAME,     "Dynpread fieldname
           V_FLAG(1) VALUE SPACE.              "FLAG VARIABLE
                            SELECTION-SCREEN                             *
    SELECTION-SCREEN BEGIN OF BLOCK S1 WITH FRAME TITLE TEXT-001.
    *--Begin of change D10K944316
    SELECT-OPTIONS : S_SAKTO FOR EKKN-SAKTO.  "G/L Accoun no.
    *--End of change D10K944316
    SELECTION-SCREEN END OF BLOCK S1.
    SELECTION-SCREEN BEGIN OF BLOCK S2 WITH FRAME TITLE TEXT-002.
    PARAMETERS : P_EXCEL    AS CHECKBOX DEFAULT ' ' .  " download to excel
    PARAMETERS : C_FILE(128) DEFAULT : 'C:\ZRMM0056.xls'.
    SELECTION-SCREEN END OF BLOCK S2.
    A T   S E L E C T I O N - S C R E E N                                *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR C_FILE.
    *-Form to get file path for download of data
      PERFORM GET_FILE_PATH.
    AT SELECTION-SCREEN.
      PERFORM SCREEN_VALIDATIONS.
    START-OF-SELECTION
    START-OF-SELECTION.
    *--Extract Purchasing document header data.
       PERFORM GET_PO_HEADER_DATA.
    *--Extract Purchasing document Item data.
       IF NOT IT_BUSINESS[] IS INITIAL.
         PERFORM GET_PO_ITEM_DATA.
    *--Get complete required data in final internal table
         PERFORM GET_FINAL_DATA.
       ENDIF.
    END-OF-SELECTION
    END-OF-SELECTION.
      IF V_FLAG IS INITIAL.
    *--Display Purchasing document details
        IF NOT IT_FINAL[] IS INITIAL.
           PERFORM DISPLAY_PODATA.
          IF P_EXCEL = 'X'.
    *--To down load data to excel sheet
            PERFORM DOWN_LOAD_TO_EXCEL.
          ENDIF.
        ENDIF.
      ELSE.
           MESSAGE I001(ZZ) WITH 'No data found'(003).
      ENDIF.
    TOP-OF-PAGE
    TOP-OF-PAGE.
    *--To display page header
      PERFORM PAGE_HEADER.
    *&      Form  GET_PO_HEADER_DATA
          To Get Purchasing header data
    FORM GET_PO_HEADER_DATA .
    *--To extract Business Area details
           CLEAR IT_BUSINESS.
           REFRESH IT_BUSINESS.
            SELECT EBELN    "Purchasing document
                   EBELP    "Purchasing document item
                   SAKTO    "G/L Account no
                   GSBER    "Business area
                   FROM EKKN
                   INTO TABLE IT_BUSINESS
                   WHERE SAKTO IN S_SAKTO.
      IF SY-SUBRC <> 0.
        V_FLAG = 'X'.
        MESSAGE I001(ZZ)  WITH
        'No data selected for the given selection criteria'(004).
        STOP.
      ELSE.
    *--To extract Purchasing document details with respect
    to G/L Account no
           CLEAR   IT_POHEADER.
           REFRESH IT_POHEADER.
           SELECT EBELN       "Purchasing document
                  AEDAT       "Created on
                  ERNAM       "Created by
                  LIFNR       "Vendor
                FROM EKKO
                INTO TABLE IT_POHEADER
                FOR ALL ENTRIES IN IT_BUSINESS
                WHERE EBELN = IT_BUSINESS-EBELN.
             IF NOT IT_POHEADER[] IS INITIAL.
                CLEAR   IT_VENDOR.
                REFRESH IT_VENDOR.
    *--Extracting Vendor details
                SELECT LIFNR   "Vendor #
                       NAME1   "Name
                     FROM LFA1
                     INTO TABLE IT_VENDOR
                     FOR ALL ENTRIES IN IT_POHEADER
                     WHERE LIFNR = IT_POHEADER-LIFNR.
            ENDIF.
      ENDIF.
    ENDFORM.                    " GET_PO_HEADER_DATA
    *&      Form  GET_PO_ITEM_DATA
          To extract Purchasing document item data
    FORM GET_PO_ITEM_DATA .
    CLEAR   IT_POITEM.
    REFRESH IT_POITEM.
       SELECT EBELN        "Purchasing document
              EBELP        "Item Number
              MATNR        "Material number
              BUKRS        "Company code
              WERKS        "Plant
              MATKL        "Material Group
              MENGE        "Order Quantity
              NETPR        "Net Price
              PEINH        "Price unit
              NETWR        "Net Value
           FROM EKPO
           INTO TABLE IT_POITEM
           FOR ALL ENTRIES IN IT_BUSINESS
           WHERE EBELN = IT_BUSINESS-EBELN
            AND  EBELP = IT_BUSINESS-EBELP.
    IF NOT IT_POITEM[] IS INITIAL.
       CLEAR   IT_HISTORY.
       REFRESH IT_HISTORY.
       SELECT EBELN    "Purchasing document
              EBELP    "Item
              VGABE    "Trans/Event type
              BELNR    "Number of Material Document
              BUZEI    "Item in material Document
              BUDAT    "Posting date
              MENGE    "Quantity
              BEWTP    "Posting history category
            FROM EKBE
            INTO TABLE IT_HISTORY
            FOR ALL ENTRIES IN IT_POITEM
            WHERE EBELN = IT_POITEM-EBELN
              AND EBELP = IT_POITEM-EBELP
              AND ( VGABE = '1' OR VGABE = '2' )   "1 = GR , 2 = IR
              AND ( BEWTP =  'Q' OR BEWTP = 'E' ). "Q = GR , R = IR
       IF SY-SUBRC = 0.
         SORT IT_HISTORY BY EBELN EBELP.
       ENDIF.
    ENDIF.
    ENDFORM.                    " GET_PO_ITEM_DATA
    *&      Form  GET_FILE_PATH
          Select file path
    FORM GET_FILE_PATH .
    CLEAR V_FILE.
      MOVE 'p_flname' TO V_FLD.
      MOVE C_FILE TO V_FILE.
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                PROGRAM_NAME  = SYST-CPROG
                DYNPRO_NUMBER = SYST-DYNNR
                FIELD_NAME    = V_FLD
           IMPORTING
                FILE_NAME     = V_FILE
           EXCEPTIONS
                OTHERS        = 1.
      MOVE V_FILE TO C_FILE.
    ENDFORM.                    " GET_FILE_PATH
    *&      Form  PAGE_HEADER
           To Print page header and other details
    FORM PAGE_HEADER .
    *--Page Header
    ULINE AT /1(300).
      FORMAT COLOR 1.
      WRITE:/ 'Run Date:'(005), SY-DATUM, 45 'Stanley Works'(006),
             100 'Page No:'(007), SY-PAGNO LEFT-JUSTIFIED, 298 ''.
      WRITE:/ 'Run Time:'(008), SY-UZEIT, 43 SY-TITLE, 100 SY-UNAME, 298 ''.
      WRITE:/ 'Source  :'(009), SY-SYSID, 100 SY-CPROG, 298 ''.
      FORMAT COLOR OFF.
      ULINE AT /1(300).
      FORMAT COLOR 4.
      WRITE : / SY-VLINE , (10) 'Purchasing Doc'(010),
                SY-VLINE,  (5)  'Item'(011),
                SY-VLINE,  (10) 'Created On'(012),
                SY-VLINE,  (7)  'Crea By'(013),
                SY-VLINE,  (10) 'Material'(014),
                SY-VLINE,  (6)  'Com cd'(015),
                SY-VLINE,  (5)  'Plant'(016),
                SY-VLINE,  (10) 'Mat Group'(017),
                SY-VLINE,  (13) 'Order Qty'(018),
                SY-VLINE,  (11) 'Net Price'(019),
                SY-VLINE,  (10) 'Price Unit'(020),
                SY-VLINE,  (13) 'Net Value'(021),
                SY-VLINE,  (8)  'Bus Area'(022),
                SY-VLINE,  (10) 'Vendor'(023),
                SY-VLINE,  (28) 'Vendor Name'(024),
    *--IR details
                SY-VLINE,  (10) 'IR-Mat Doc'(025),
                SY-VLINE,  (5)  'IR-It'(026),
                SY-VLINE,  (9) 'IR-Post dt'(027),
                SY-VLINE,  (13) 'IR-Quantity'(028),
    *--GR details
                SY-VLINE,  (10) 'GR-Mat Doc'(029),
                SY-VLINE,  (5)  'GR-It'(030),
                SY-VLINE,  (9) 'GR-Post dt'(031),
                SY-VLINE,  (13) 'GR-Quantity'(032), SY-VLINE.
      FORMAT COLOR OFF.
      ULINE AT /1(300).
    ENDFORM.                    " PAGE_HEADER
    *&      Form  SCREEN_VALIDATIONS
          Selection screen validations
    FORM SCREEN_VALIDATIONS .
    *--Validation for G/L Account No
    IF NOT S_SAKTO IS INITIAL.
        SELECT SAKNR UP TO 1 ROWS
               INTO EKKN-SAKTO
               FROM SKA1 WHERE
               SAKNR IN S_SAKTO.
        ENDSELECT.
        IF SY-SUBRC <> 0.
          MESSAGE E001(ZZ) with 'Please enter a valid G/L Account no'(048).
        ENDIF.
      ENDIF.
    *--Validation for Excel file path
    IF P_EXCEL = 'X'.
        IF C_FILE = ' '.
          MESSAGE E001(ZZ) with 'Please enter a valid Excle Path'(035).
        ENDIF.
      ENDIF.
    ENDFORM.                    " SCREEN_VALIDATIONS
    *&      Form  DISPLAY_PODATA
          To Display Purchasing Document details
    FORM DISPLAY_PODATA .
    FORMAT COLOR 2.
    SORT IT_FINAL BY EBELN EBELP AEDAT BUKRS WERKS.
    LOOP AT IT_FINAL.
         WRITE : / SY-VLINE ,(10)  IT_FINAL-EBELN,     "Purchasing Doc
                   SY-VLINE,  (5)  IT_FINAL-EBELP,     "Item
                   SY-VLINE,  (10) IT_FINAL-AEDAT,     "Created On
                   SY-VLINE,  (7) IT_FINAL-ERNAM,      "Created By
                   SY-VLINE,  (10) IT_FINAL-MATNR,     "Material
                   SY-VLINE,  (6) IT_FINAL-BUKRS,      "Company code
                   SY-VLINE,  (5)  IT_FINAL-WERKS,     "Plant
                   SY-VLINE,  (10) IT_FINAL-MATKL,     "Material Group
                   SY-VLINE,  (13) IT_FINAL-MENGE, "#EC UOM_IN_MES
                                                       "Order Qty
                   SY-VLINE,  (11) IT_FINAL-NETPR, "#EC UOM_IN_MES
                                                       "Net Price
                   SY-VLINE,  (10) IT_FINAL-PEINH, "#EC UOM_IN_MES
                                                       "Price Unit
                   SY-VLINE,  (13) IT_FINAL-NETWR, "#EC UOM_IN_MES
                                                        "Net Value
                   SY-VLINE,  (8)  IT_FINAL-GSBER,     "Bus Area
                   SY-VLINE,  (10) IT_FINAL-LIFNR,     "Vendor
                   SY-VLINE,  (28) IT_FINAL-NAME1,     "Vendor name
    *--IR details
                   SY-VLINE,  (10) IT_FINAL-IR_BELNR,  "IR-Mat Doc
                   SY-VLINE,  (5)  IT_FINAL-IR_BUZEI,  "IR-It
                   SY-VLINE,  (9) IT_FINAL-IR_BUDAT,   "IR-Post dt
                   SY-VLINE,  (13) IT_FINAL-IR_MENGE,  "#EC UOM_IN_MES
                                                        "IR-Quantity
    *--GR details
                   SY-VLINE,  (10) IT_FINAL-GR_BELNR,  "GR-Mat Doc
                   SY-VLINE,  (5)  IT_FINAL-GR_BUZEI,  "GR-It
                   SY-VLINE,  (9) IT_FINAL-GR_BUDAT,   "GR-Post dt
                   SY-VLINE,  (13) IT_FINAL-GR_MENGE, SY-VLINE.
                                                       "#EC UOM_IN_MES
                                                       "GR-Quantity
      ENDLOOP.
      FORMAT COLOR OFF.
    ENDFORM.                    " DISPLAY_PODATA
    *&      Form  DOWN_LOAD_TO_EXCEL
          text
    FORM DOWN_LOAD_TO_EXCEL .
      <b>REFRESH FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-010.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-011.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-012.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Created By'(036).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-014.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Company Code'(037).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-016.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Material Group'(038).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Order Quantity'(039).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-019.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-020.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-021.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'Business Area'(040).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-023.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-024.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'IR Material Doc'(041).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'IR Item'(042).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'IR Posting Date'(043).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-028.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'GR Material Doc'(044).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'GR Item'(045).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = 'GR Posting Date'(046).
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
      FIELDNAMES-TEXT = TEXT-032.
      APPEND FIELDNAMES.CLEAR FIELDNAMES.
    *--FM to download data to Excel sheet
    CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
                FILENAME                = C_FILE
                FILETYPE                = 'DAT'
                TABLES
                DATA_TAB                = IT_FINAL
                FIELDNAMES              = FIELDNAMES
           EXCEPTIONS
                FILE_OPEN_ERROR         = 1
                FILE_WRITE_ERROR        = 2
                INVALID_FILESIZE        = 3
                INVALID_TABLE_WIDTH     = 4
                INVALID_TYPE            = 5
                NO_BATCH                = 6
                UNKNOWN_ERROR           = 7
                GUI_REFUSE_FILETRANSFER = 8
                OTHERS                  = 9.
      IF SY-SUBRC <> 0.
         MESSAGE E001(ZZ) WITH 'Data could not downloaded'(047).
      ENDIF.</b>ENDFORM.                    " DOWN_LOAD_TO_EXCEL
    *&      Form  GET_FINAL_DATA
          To Populate required data in final internal table
    FORM GET_FINAL_DATA .
    CLEAR   IT_FINAL.
    REFRESH IT_FINAL.
    LOOP AT IT_POITEM.
       CLEAR IT_POHEADER.
       READ TABLE IT_POHEADER WITH KEY EBELN = IT_POITEM-EBELN.
       IF SY-SUBRC = 0.
        MOVE :  IT_POHEADER-EBELN TO IT_FINAL-EBELN,     "Purchasing Doc
                IT_POITEM-EBELP   TO IT_FINAL-EBELP,     "Item
                IT_POHEADER-AEDAT TO IT_FINAL-AEDAT,     "Created On
                IT_POHEADER-ERNAM TO IT_FINAL-ERNAM,     "Created By
                IT_POITEM-MATNR   TO IT_FINAL-MATNR,     "Material
                IT_POITEM-BUKRS   TO IT_FINAL-BUKRS,     "Company code
                IT_POITEM-WERKS   TO IT_FINAL-WERKS,     "Plant
                IT_POITEM-MATKL   TO IT_FINAL-MATKL,     "Material Group
                IT_POITEM-MENGE   TO IT_FINAL-MENGE,     "Order Qty
                IT_POITEM-NETPR   TO IT_FINAL-NETPR,     "Net Price
                IT_POITEM-PEINH   TO IT_FINAL-PEINH,     "Price Unit
                IT_POITEM-NETWR   TO IT_FINAL-NETWR,     "Net Value
                IT_POHEADER-LIFNR TO IT_FINAL-LIFNR.     "Vendor
    *--To Insert IR details
        CLEAR IT_HISTORY.
        READ TABLE IT_HISTORY WITH KEY EBELN = IT_POITEM-EBELN
                                       EBELP = IT_POITEM-EBELP
                                       VGABE = '2'
                                       BEWTP = 'Q'.
          IF SY-SUBRC = 0.
            MOVE :
              IT_HISTORY-BELNR TO IT_FINAL-IR_BELNR,  "IR-Number of Mat Doc
              IT_HISTORY-BUZEI TO IT_FINAL-IR_BUZEI,  "IR-Item in mat Doc
              IT_HISTORY-BUDAT TO IT_FINAL-IR_BUDAT,  "IR-Posting date
              IT_HISTORY-BUDAT TO IT_FINAL-IR_MENGE.   "IR-Quantity
          ENDIF.
    *--To insert GR details
        CLEAR IT_HISTORY.
        READ TABLE IT_HISTORY WITH KEY EBELN = IT_POITEM-EBELN
                                       EBELP = IT_POITEM-EBELP
                                       VGABE = '1'
                                       BEWTP = 'E'.
          IF SY-SUBRC = 0.
            MOVE :
              IT_HISTORY-BELNR TO IT_FINAL-GR_BELNR,  "IR-Number of Mat Doc
              IT_HISTORY-BUZEI TO IT_FINAL-GR_BUZEI,  "IR-Item in mat Doc
              IT_HISTORY-BUDAT TO IT_FINAL-GR_BUDAT,  "IR-Posting date
              IT_HISTORY-BUDAT TO IT_FINAL-GR_MENGE.  "IR-Quantity
          ENDIF.
    *--To insert Vendor details
         CLEAR IT_VENDOR.
         READ TABLE IT_VENDOR WITH KEY LIFNR = IT_POHEADER-LIFNR.
         IF SY-SUBRC = 0.
          MOVE : IT_VENDOR-NAME1 TO IT_FINAL-NAME1.
         ENDIF.
    *--To insert Business area
         CLEAR IT_BUSINESS.
         READ TABLE IT_BUSINESS WITH KEY EBELN = IT_POITEM-EBELN
                                         EBELP = IT_POITEM-EBELP.
         IF SY-SUBRC = 0.
           MOVE : IT_BUSINESS-GSBER TO IT_FINAL-GSBER.
         ENDIF.
          APPEND IT_FINAL.
          CLEAR  IT_FINAL.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_FINAL_DATA
    thanks
    Sunil

  • Regarding Download to Excel

    hi,
    by ALV_GRID is it possible to filter the no of columns download into Excel?
    EX: if my ALV(report) contains 30 fileds and i am diplaying only 10 fileds on output by using variant.. is it possible to down load that displayed 10 feilds into excel sheet not total 30 fileds..
    sample codes are welcome......
    Regards
    Ashok Parupalli.
    Message was edited by: Ashok Parupalli

    Hi Ashok,
    You need to download the total excel sheet into Internal table, there is a one way to ignore excel sheet rows, but you can ignore records only starts from first in the excel sheet, you can not ignore the middle of records in the excel sheet, i mean if the excle sheer is having 30 rows, then you can take from 20th row to 30th row, but you can not ignore the middle of records while uploading the excel sheet.
    i do not know whether it is possible with OLE, anyways Look at transaction DWDM for demo/examples, there's lots of tricks with OLEobjects
    look at the below program, this is OO concept
    http://www.sapgenie.com/abap/code/abap41.htm
    Thanks
    Sudheer

  • Download to Excel.

    Hi,
    I have to download data into excel .
    Now this data is not predefined .. as in its picked up from custom table . If no of records selected from custom table is 6 then 6 columns in final_itab. If 10 records selcted then 10 columns .
    Now I have managed to create two internal tables
    1. itab1
    this contains header texts
    row  column   text
    1     1       Name
    1     2       Quantity
    1     3       Price
    2, itab2   contains - values
    row column   value
    1    1       'ABC'
    1    2       '33'
    1    3       '34.56'
    2    1       'CDF'
    2    2       '66'
    2    3       '234'
    How do I make it into one internal table for download to excel.
    If I think of the option of printing it as a report so that the user will save file as spread sheet .. this is also not possible as the text size for each is 70 and it will exceed the maximum permissible which is 1023.
    Culd Anyoen suggest something in this regard please .

    Hi neelim,
    first declare your internal table that will contains the headre of the colomn
    DATA: BEGIN OF gt_header OCCURS 1,
           ZONE(60) TYPE C,
          END OF gt_header.
    then the table that will contains the values.
    DATA: BEGIN OF gt_val OCCURS 0,                  
            matnr(18),
            werks(4),
          end of gt_val.
    after updating your table with value and header text
    call function:
    CALL FUNCTION 'GUI_DOWNLOAD'
             EXPORTING
                  FILENAME            = P_file
                  FILETYPE            = 'DAT'
             TABLES
                  DATA_TAB            = gt_val
                  FIELDNAMES          = gt_header
             EXCEPTIONS
                  FILE_OPEN_ERROR     = 1
                  FILE_WRITE_ERROR    = 2
                  INVALID_FILESIZE    = 3
                  INVALID_TABLE_WIDTH = 4
                  INVALID_TYPE        = 5
                  NO_BATCH            = 6
                  UNKNOWN_ERROR       = 7
                  OTHERS              = 8.
    it should works.
    joseph

  • Limit the number of record to download to excel from a report

    I am just wondering if there is a way to limit the number of rows that I want to download to excel from a report in apex, right now when I click download to excel it downloads all records. If I am displaying 15 records on report page I want the ability to download only those records.
    Any help with that would be appreciated.
    Kind Regards,
    Sofia.

    Sofia,
    The same report query runs for downloading the data into excel, I don't think you can limit the number of records in download.
    You can achieve it using custom code, like on click of download excel redirect to another page and then restrict the data as per your need, or you can use the custom procedure to download the limited data.
    Denes' utility to download into excel.
    http://htmldb.oracle.com/pls/otn/f?p=31517:108:1476564836494581:::RP,::
    Regards,
    Manish

  • Hi friends, Problems with Special Characters in Table download to Excel.

    Hi friends,
    I am using Binary Cache method to download to excel. The problem is that there are certain fields in the back end R/3  that has special characters in it eg : & * £ # etc.
    As a result, the download is not working for these rows. Please can any of you tell me how to get rid of this. As an example let's say I wan to replace the "&" with "and".
    Please help.
    Thank You.
    Avik

    hi,
    Hope you find tgis of some help !!
    public void ReplaceMethod( )
        //@@begin ReplaceMethod()
        // get the string value of the cell (for you from the table cell, for eg, Pinki & Rakesh)
        test = wdContext.currentTestStringConversionElement().getInput();
        // calculate the total length of the String
        n=test.length ();
        if(n!=0)
                for(i=1;i<=n;i++)
    // catching each character from the String
                            c = test.charAt (i-1);
            // checking if any character within the String (eg, Pinki & Rakesh)  is “&”            
                               if (c=='&')
                                                                wdContext.currentTestStringConversionElement().setOutput(Character.toString(c));
                                                                no=i;
                                                                break;
                String val = Integer.toString(no);
                               //wdContext.currentTestStringConversionElement().setNo(val);
                // breaking the String and adding “ and” in place of “&”            
                            sub1=   test.substring(0,i-1);
                            sub2= "  and  ";
                            sub3= test.substring(i,n);
                      //Concatenating the String   
                            test1 = sub1sub2sub3;
                      //Printing the String  
                            wdContext.currentTestStringConversionElement().setOutput(test1);

  • Download to Excel comes blank

    Hello Gurus:
    I am having an issue when I try to download a particular report to excel.
    It is a pivot table, and It only displays some rows when I download it to Excel.
    It doesnt display all the rows.
    Most of the rows are column formulas, those are the rows which doesnt get displayed.
    Is there any workaround for this?
    Please help me out.
    Thanks.
    ~Vinay.

    Alright I got the answer.
    Actually I am using "Filter (...) USING (..)" in couple of column formula.
    Now it looks like Print PDF, or download to excel is not working with it.. Because Once I remove it, and use a global filter instead, then everything prints fine.
    Oracle bug may be.. I am using 10.1.3.2 by the way..
    So I just removed those filters and report is working great now.
    Thanks for your help Madan..
    ~Vinay

  • Download to Excel - multiple sheets

    hi All,
    I successfully create a xls with multiple worksheets
    <b>Method 1:</b>(http://www.sapdevelopment.co.uk/ms/ms_excel.htm)
    CREATE OBJECT application 'excel.application'
    CALL METHOD OF sheet 'Cells' = cells
       EXPORTING #1 = myY  #2 = myX.
        SET PROPERTY OF cells 'Value' = 'hello'.
    But this way of cell by cell populating, is too slow; I have 10,000 rows of records to download to excel as report.
    Then i tried second way <b>Method 2:</b>
    CALL FUNCTION 'XXL_SIMPLE_API'
    This is much faster, but it does not allow me to have multiple sheets.
    Can anyone advise how to speed up the process using method 1 ?
    Thanks in advance.
    Ee Siong

    Try this....
    *& Report  ZETA_EXCEL_DOWNLOAD_CLIPBOARD                               *
    report  zeta_excel_download_clipboard           .
    include ole2incl.
    data:  w_cell1     type ole2_object,
           w_cell2     type ole2_object.
    *--- Ole data Declarations
    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
          gs_interior type ole2_object,        " Pattern
          worksheet   type ole2_object,
          h_cell      type ole2_object,
          h_cell1     type ole2_object,
          range       type ole2_object,
          h_sheet2    type ole2_object,
          h_sheet3    type ole2_object,
          gs_font     type ole2_object,
          flg_stop(1) type c.
              Internal table Declaration
    data: begin of t_excel occurs 0,
    vkorg(20) type c, "Sales Org
    vbtyp(20) type c, "Document Category
    auart(20) type c, "Document Type
    ernam(20) type c, "Created By
    vbeln(20) type c, "Document Number
    posnr(20) type c, "Item Number
    erdat(20) type c, "Created Date
    vdatu(20) type c, "Header Requested Delivery Date
    reqdat(20) type c, "Request date
    condat(20) type c, "Confirm date
    lifsk(20) type c, "Header Block
    txt30(30) type c, "Order User Status Description
    lifsp(20) type c, "Line Block
    dispo(20) type c, "MRP Controller
    dsnam(20) type c, "MRP Controller Description
    vmsta(20) type c, "Material Sales Status
    kunnr(20) type c, "Sold To
    cname(35) type c, "Sold To Name
    regio(20) type c, "State
    cufd(10) type c, "CUD
    bstnk(20) type c, "PO#
    bsark(20) type c, "Ordering Method
    matnr(20) type c, "Material
    maktx(35) type c, "Material Description
    t200(20) type c, "T200
    vtext(20) type c, "T200 Description
    matkl(20) type c, "Material Group
    zzbomind(7) type c, "BOM Indicator
    ostat(20) type c, "Order Status
    cmgst(20) type c, "CRD
    inco1(20) type c, "Incoterms
    oqty(20) type c, "Order Quantity
    pqty(20) type c, "Open Quantity
    unit(20) type c, "UOM
    onet(20) type c, "Order Value
    pnet(20) type c, "Open Value
    curr(20) type c, "Currency key
    so_bezei like tvkbt-bezei,"Sales Office
    sg_bezei like tvgrt-bezei,"Sales Group
    bname(20) type c, "Ordering Party
    contact(20) type c, "Contact Name
    telf1(20) type c, "Contact telf1
    reqqty(20) type c, "Item Request qty
    reqval(20) type c, "Item Request value
    conqty(20) type c, "Item Confirm qty
    conval(20) type c, "Item Confirm value
    zzrev(02) type c, "Revenue recognition acceptance
    bezei(20) type c, "Revenue recognition text
    vgbel(20) type c, "Reference Order for RETURNS
    0008text(255) type c, "Internal Order Comment Text
    end of t_excel.
    data: t_excel_bckord like t_excel occurs 0 with header line,
          t_excel_bcklog like t_excel occurs 0 with header line,
          t_excel_blkord like t_excel occurs 0 with header line.
      types: data1(1500) type c,
             ty          type table of data1.
      data:  it          type ty with header line,
    it_2          type ty with header line,
    it_3          type ty with header line,
             rec         type sy-tfill,
             deli(1)     type c,
             l_amt(18)   type c.
    data: begin of hex,
             tab type x,
            end of hex.
      field-symbols: <fs>      .
      constants cns_09(2) type n value 09.
      assign deli to <fs> type 'X'.
      hex-tab = cns_09.
      <fs> = hex-tab.
    data gv_sheet_name(20) type c .
    M A C R O Declaration
    define ole_check_error.
      if &1 ne 0.
        message e001(zz) with &1.
        exit.
      endif.
    end-of-definition.
    t_excel_bckord-vkorg = 'ABC'.
    t_excel_bckord-vbtyp = 'DEF'.
    t_excel_bckord-auart = 'GHI'.
    t_excel_bckord-ernam = 'JKL'.
    t_excel_bckord-vbeln = 'MNO'.
    t_excel_bckord-0008text = 'XYZ'.
    append t_excel_bckord.
    t_excel_bckord-vkorg = 'ABC1'.
    t_excel_bckord-vbtyp = 'DEF1'.
    t_excel_bckord-auart = 'GHI1'.
    t_excel_bckord-ernam = 'JKL1'.
    t_excel_bckord-vbeln = 'MNO1'.
    t_excel_bckord-0008text = 'XYZ1'.
    append t_excel_bckord.
    t_excel_bckord-vkorg = 'ABC2'.
    t_excel_bckord-vbtyp = 'DEF2'.
    t_excel_bckord-auart = 'GHI2'.
    t_excel_bckord-ernam = 'JKL2'.
    t_excel_bckord-vbeln = 'MNO2'.
    t_excel_bckord-0008text = 'XYZ2'.
    append t_excel_bckord.
    t_excel_bcklog-vkorg = 'ABC'.
    t_excel_bcklog-vbtyp = 'DEF'.
    t_excel_bcklog-auart = 'GHI'.
    t_excel_bcklog-ernam = 'JKL'.
    t_excel_bcklog-vbeln = 'MNO'.
    t_excel_bcklog-0008text = 'XYZ'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC1'.
    t_excel_bcklog-vbtyp = 'DEF1'.
    t_excel_bcklog-auart = 'GHI1'.
    t_excel_bcklog-ernam = 'JKL1'.
    t_excel_bcklog-vbeln = 'MNO1'.
    t_excel_bcklog-0008text = 'XYZ1'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC2'.
    t_excel_bcklog-vbtyp = 'DEF2'.
    t_excel_bcklog-auart = 'GHI2'.
    t_excel_bcklog-ernam = 'JKL2'.
    t_excel_bcklog-vbeln = 'MNO2'.
    t_excel_bcklog-0008text = 'XYZ2'.
    append t_excel_bcklog.
    t_excel_bcklog-vkorg = 'ABC3'.
    t_excel_bcklog-vbtyp = 'DEF3'..
    t_excel_bcklog-auart = 'GHI3'.
    t_excel_bcklog-ernam = 'JKL3'.
    t_excel_bcklog-vbeln = 'MNO3'.
    t_excel_bcklog-0008text = 'XYZ3'.
    append t_excel_bcklog.
    t_excel_blkord-vkorg = 'ABC'.
    t_excel_blkord-vbtyp = 'DEF'.
    t_excel_blkord-auart = 'GHI'.
    t_excel_blkord-ernam = 'JKL'.
    t_excel_blkord-vbeln = 'MNO'.
    t_excel_blkord-0008text = 'XYZ'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC1'.
    t_excel_blkord-vbtyp = 'DEF1'.
    t_excel_blkord-auart = 'GHI1'.
    t_excel_blkord-ernam = 'JKL1'.
    t_excel_blkord-vbeln = 'MNO1'.
    t_excel_blkord-0008text = 'XYZ1'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC2'.
    t_excel_blkord-vbtyp = 'DEF2'.
    t_excel_blkord-auart = 'GHI2'.
    t_excel_blkord-ernam = 'JKL2'.
    t_excel_blkord-vbeln = 'MNO2'.
    t_excel_blkord-0008text = 'XYZ2'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC3'.
    t_excel_blkord-vbtyp = 'DEF3'..
    t_excel_blkord-auart = 'GHI3'.
    t_excel_blkord-ernam = 'JKL3'.
    t_excel_blkord-vbeln = 'MNO3'.
    t_excel_blkord-0008text = 'XYZ3'.
    append t_excel_blkord.
    t_excel_blkord-vkorg = 'ABC4'.
    t_excel_blkord-vbtyp = 'DEF4'..
    t_excel_blkord-auart = 'GHI4'.
    t_excel_blkord-ernam = 'JKL4'.
    t_excel_blkord-vbeln = 'MNO4'.
    t_excel_blkord-0008text = 'XYZ4'.
    append t_excel_blkord.
    loop at t_excel_bckord.
    concatenate
    t_excel_bckord-vkorg
    t_excel_bckord-vbtyp
    t_excel_bckord-auart
    t_excel_bckord-ernam
    t_excel_bckord-vbeln
    t_excel_bckord-posnr
    t_excel_bckord-erdat
    t_excel_bckord-vdatu
    t_excel_bckord-reqdat
    t_excel_bckord-condat
    t_excel_bckord-lifsk
    t_excel_bckord-txt30
    t_excel_bckord-lifsp
    t_excel_bckord-dispo
    t_excel_bckord-dsnam
    t_excel_bckord-vmsta
    t_excel_bckord-kunnr
    t_excel_bckord-cname
    t_excel_bckord-regio
    t_excel_bckord-cufd
    t_excel_bckord-bstnk
    t_excel_bckord-bsark
    t_excel_bckord-matnr
    t_excel_bckord-maktx
    t_excel_bckord-t200
    t_excel_bckord-vtext
    t_excel_bckord-matkl
    t_excel_bckord-zzbomind
    t_excel_bckord-ostat
    t_excel_bckord-cmgst
    t_excel_bckord-inco1
    t_excel_bckord-oqty
    t_excel_bckord-pqty
    t_excel_bckord-unit
    t_excel_bckord-onet
    t_excel_bckord-pnet
    t_excel_bckord-curr
    t_excel_bckord-so_bezei
    t_excel_bckord-sg_bezei
    t_excel_bckord-bname
    t_excel_bckord-contact
    t_excel_bckord-telf1
    t_excel_bckord-reqqty
    t_excel_bckord-reqval
    t_excel_bckord-conqty
    t_excel_bckord-conval
    t_excel_bckord-zzrev
    t_excel_bckord-bezei
    t_excel_bckord-vgbel
    t_excel_bckord-0008text
    into it
    separated by deli.
    append it.
        clear it.
    endloop.
    loop at t_excel_bcklog.
    concatenate
    t_excel_bcklog-vkorg
    t_excel_bcklog-vbtyp
    t_excel_bcklog-auart
    t_excel_bcklog-ernam
    t_excel_bcklog-vbeln
    t_excel_bcklog-posnr
    t_excel_bcklog-erdat
    t_excel_bcklog-vdatu
    t_excel_bcklog-reqdat
    t_excel_bcklog-condat
    t_excel_bcklog-lifsk
    t_excel_bcklog-txt30
    t_excel_bcklog-lifsp
    t_excel_bcklog-dispo
    t_excel_bcklog-dsnam
    t_excel_bcklog-vmsta
    t_excel_bcklog-kunnr
    t_excel_bcklog-cname
    t_excel_bcklog-regio
    t_excel_bcklog-cufd
    t_excel_bcklog-bstnk
    t_excel_bcklog-bsark
    t_excel_bcklog-matnr
    t_excel_bcklog-maktx
    t_excel_bcklog-t200
    t_excel_bcklog-vtext
    t_excel_bcklog-matkl
    t_excel_bcklog-zzbomind
    t_excel_bcklog-ostat
    t_excel_bcklog-cmgst
    t_excel_bcklog-inco1
    t_excel_bcklog-oqty
    t_excel_bcklog-pqty
    t_excel_bcklog-unit
    t_excel_bcklog-onet
    t_excel_bcklog-pnet
    t_excel_bcklog-curr
    t_excel_bcklog-so_bezei
    t_excel_bcklog-sg_bezei
    t_excel_bcklog-bname
    t_excel_bcklog-contact
    t_excel_bcklog-telf1
    t_excel_bcklog-reqqty
    t_excel_bcklog-reqval
    t_excel_bcklog-conqty
    t_excel_bcklog-conval
    t_excel_bcklog-zzrev
    t_excel_bcklog-bezei
    t_excel_bcklog-vgbel
    t_excel_bcklog-0008text
    into it_2
    separated by deli.
    append it_2.
        clear it_2.
    endloop.
    loop at t_excel_blkord.
    concatenate
    t_excel_blkord-vkorg
    t_excel_blkord-vbtyp
    t_excel_blkord-auart
    t_excel_blkord-ernam
    t_excel_blkord-vbeln
    t_excel_blkord-posnr
    t_excel_blkord-erdat
    t_excel_blkord-vdatu
    t_excel_blkord-reqdat
    t_excel_blkord-condat
    t_excel_blkord-lifsk
    t_excel_blkord-txt30
    t_excel_blkord-lifsp
    t_excel_blkord-dispo
    t_excel_blkord-dsnam
    t_excel_blkord-vmsta
    t_excel_blkord-kunnr
    t_excel_blkord-cname
    t_excel_blkord-regio
    t_excel_blkord-cufd
    t_excel_blkord-bstnk
    t_excel_blkord-bsark
    t_excel_blkord-matnr
    t_excel_blkord-maktx
    t_excel_blkord-t200
    t_excel_blkord-vtext
    t_excel_blkord-matkl
    t_excel_blkord-zzbomind
    t_excel_blkord-ostat
    t_excel_blkord-cmgst
    t_excel_blkord-inco1
    t_excel_blkord-oqty
    t_excel_blkord-pqty
    t_excel_blkord-unit
    t_excel_blkord-onet
    t_excel_blkord-pnet
    t_excel_blkord-curr
    t_excel_blkord-so_bezei
    t_excel_blkord-sg_bezei
    t_excel_blkord-bname
    t_excel_blkord-contact
    t_excel_blkord-telf1
    t_excel_blkord-reqqty
    t_excel_blkord-reqval
    t_excel_blkord-conqty
    t_excel_blkord-conval
    t_excel_blkord-zzrev
    t_excel_blkord-bezei
    t_excel_blkord-vgbel
    t_excel_blkord-0008text
    into it_3
    separated by deli.
    append it_3.
        clear it_3.
    endloop.
      if h_excel-header = space or h_excel-handle = -1.
    start Excel
        create object h_excel 'EXCEL.APPLICATION'.
      endif.
    PERFORM err_hdl.
    *--- get list of workbooks, initially empty
      call method of h_excel 'Workbooks' = h_mapl.
    PERFORM err_hdl.
      set property of h_excel 'Visible' = 1.
    add a new workbook
      call method of h_mapl 'Add' = h_map.
    PERFORM err_hdl.
    *GV_SHEET_NAME = '1st SHEET'.
    gv_sheet_name = 'Back Orders'.
      get property of  h_excel 'ACTIVESHEET' = worksheet.
    set property of worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
            data l_rc type i.
      call method cl_gui_frontend_services=>clipboard_export
        importing
          data                 = it[]
        changing
          rc                   = l_rc
        exceptions
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          others               = 4.
      call method of h_excel 'Cells' = w_cell1
        exporting
          #1 = 1
          #2 = 1.
      call method of h_excel 'Cells' = w_cell2
        exporting
          #1 = 1
          #2 = 1.
    PERFORM err_hdl.
       call method of h_excel 'Range' = range
        exporting
          #1 = w_cell1
          #2 = w_cell2.
      call method of range 'Select'.
    PERFORM err_hdl.
      call method of worksheet 'Paste'.
    PERFORM err_hdl.
    CALL METHOD OF h_excel 'QUIT'.
    *GV_SHEET_NAME = '2ND SHEET'.
    gv_sheet_name = 'Backlog'.
    get property of h_excel 'Sheets' = h_sheet2 .
      call method of h_sheet2 'Add' = h_map.
    set property of h_map 'Name' = gv_sheet_name .
      get property of  h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
      call method cl_gui_frontend_services=>clipboard_export
        importing
          data                 = it_2[]
        changing
          rc                   = l_rc
        exceptions
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          others               = 4.
      call method of h_excel 'Cells' = w_cell1
        exporting
          #1 = 1
          #2 = 1.
      call method of h_excel 'Cells' = w_cell2
        exporting
          #1 = 1
          #2 = 1.
    PERFORM err_hdl.
       call method of h_excel 'Range' = range
        exporting
          #1 = w_cell1
          #2 = w_cell2.
      call method of range 'Select'.
    PERFORM err_hdl.
      call method of worksheet 'Paste'.
    *GV_SHEET_NAME = '3rd SHEET'.
    gv_sheet_name = 'Blocked Orders'.
    get property of h_excel 'Sheets' = h_sheet3 .
      call method of h_sheet3 'Add' = h_map.
    set property of h_map 'Name' = gv_sheet_name .
      get property of  h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    call method of h_excel 'Cells' = w_cell1
    exporting
    #1 = 1
    #2 = 1.
    call method of h_excel 'Cells' = w_cell2
    exporting
    #1 = 1
    #2 = 50.
    call method of h_excel 'Range' = h_cell
    exporting
    #1 = w_cell1
    #2 = w_cell2.
    get property of h_cell 'Font' = gs_font .
    set property of gs_font 'Bold' = 1 .
      call method cl_gui_frontend_services=>clipboard_export
        importing
          data                 = it_3[]
        changing
          rc                   = l_rc
        exceptions
          cntl_error           = 1
          error_no_gui         = 2
          not_supported_by_gui = 3
          others               = 4.
      call method of h_excel 'Cells' = w_cell1
        exporting
          #1 = 1
          #2 = 1.
      call method of h_excel 'Cells' = w_cell2
        exporting
          #1 = 1
          #2 = 1.
    PERFORM err_hdl.
       call method of h_excel 'Range' = range
        exporting
          #1 = w_cell1
          #2 = w_cell2.
      call method of range 'Select'.
    PERFORM err_hdl.
      call method of worksheet 'Paste'.
    *--- disconnect from Excel
      free object h_zl.
      free object h_mapl.
      free object h_map.
      free object h_excel.

  • Download-to-excel vs. web print to excel

    There is an old how-to guide about downloading web report to Excel and it worked fine. Now we are implementing the web print to Excel function. However, two concerns:
    1) what's the advantage of web print to excel over download to excel function?
    2) in web print to excel, the header is fine but the cells of rows are all aligned in first column vertically! I only imported the classes and used the HELP class but did not configure the XML tags.

    Using the old How to guide (2.0B) you will only download the data on the screen, if you had multiple pages it will not download any of those extra pages.
    The new Excel print is based on MS Office HTML, here you have more options for setting print options by default in the template, like page orientation, repeating column headers, paper size (legal, A4 etc..), report header etc... you can also have a print specific template using the device types.
    One more advantage over the 3.0B Excel download is if you use Table APIs for manipulating data it will be taken into account with the new soltuion. This also supports multiple data providers.
    Thanks.

  • 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

Maybe you are looking for

  • Issue with fill in the blank field and back button.

    I am working in CP4 AS2.  I have create a page of fill in the blank fields to simulate filling in a form.  On the next slide, I show the answers by extracting the variables into text boxes.  I have a back and a next button and instruct the user to re

  • Adding User Loops

    I'd like to confirm the results an experiment I tried with adding loops that seems like a bug. I created a loop using the Apple Loop Utility and set the bpm and key. Then I imported the loop into GB. GB correctly interpreted the bpm and key when I ch

  • Set message MEPO 852 to warning

    Hello All, My issue is as follows... We have maintained vendor rebate agreement for our vendor. Purchase order is created for a vendor for which vendor rebate agreement is maintained. purchase order was put on "Hold" for the first time. Then user has

  • Colour Profile Question - Press PDF

    Hi I've got a quick question regarding colour profiles. I've designed an A5 flyer for a client and I have my CS3 suite colour settings set to Adobe 1998 for RGB and Euro Coated for CMYK. The client has decided that this flyer is now to be printed on

  • How to install Oracle 10g on Solaris 10 non-global zone.

    Hi, I want to install Oracle 10g on Solaris non global zone with ASM. I need complete doc for doing the same. REgards S.Ali