Download to Excel with Column Headings.

Hi All,
I have a very small issue.I want to download the Data from an internal table to an Excel Sheet Along with the Column heading of the corresponding Field...
I tried with ws_excel and gui_download... not reached to any conclusion,,,I cant go for OLE technique as i have huge amount of data in my internal table.
If anyone have faced the same problem ...please suggest something.
Thanks in advance,
Mayank.

Hi,
Once I also faced the same problem.It was solved by the below coding.In my coding i_download is the internal table with two fields werks and matnr .w_download is its workarea.
PARAMETERS    p_file  LIKE rlgrap-filename.     
  "File name
Local Variable declaration
  DATA lv_file TYPE string.
  lv_file = p_file.
  PERFORM f1710_populate_heading.
  CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
            filename                = lv_file
            filetype                = 'ASC'
            write_field_separator   = 'X'
       TABLES
            data_tab                = i_download
       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 i000 WITH text-005. "File downloded successfully
  ELSE.
    CASE sy-subrc.
      WHEN 1.
        MESSAGE i000 WITH text-014.
      WHEN 21.
        MESSAGE i000 WITH text-071.
    ENDCASE.
  ENDIF.
ENDFORM.                    " f1500_download_data
*&      Form  f1710_populate_heading
      Populate header records
FORM f1710_populate_heading.
  CLEAR w_download.
Design the text element to handle maximum length of
the output
  w_download-werks = text-001.
  w_download-matnr   = text-002. 
    INSERT w_download INTO i_download INDEX 1.
ENDFORM.                    " f1710_populate_heading
Hope this is clear.
If your problem is solved,could you please reward useful answers and close the thread.
Rgds,
J.Jayanthi

Similar Messages

  • ALV  download to EXCEL  with column headings etc.

    Getting data from a grid to EXCEL can be done in "List" mode vis system==>save etc but it's not particularly user friendly and in any case if you are displaying a nice ALV why should the user have to switch into LIST mode anyway.
    Anyway here's a decent way to do it and it gives great formatted column headings etc etc.
    1) in the ON_TOOLBAR method add this code
    method ON_TOOLBAR.
    type-pools icon.
    CLEAR ls_toolbar.
    MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'EXCEL' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_xxl TO ls_toolbar-icon.
        MOVE 'Excel' TO ls_toolbar-quickinfo.
        MOVE  'EXCEL' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    2) In the ON_USER_COMMAND method add the following
    (if you have a class defined with SE24 you don't need the commented code).
    method ON_USER_COMMAND.
           FOR EVENT before_user_command OF cl_gui_alv_grid
           IMPORTING
             e_ucomm
             sender.
    CASE e_ucomm.
         .......   other toolbar funcs if you have any
          WHEN 'EXCEL'.
            CALL METHOD me->download_to_excel.
        ENDCASE.
    endmethod.
    3) code this method to download to EXCEL
    method DOWNLOAD_TO_EXCEL.
    FIELD-SYMBOLS:
           <fs0> TYPE STANDARD TABLE,
           <fs1> TYPE STANDARD TABLE.
        ASSIGN g_outtab1->* TO <fs0>.
        ASSIGN g_fldcat1->* TO <fs1>.
           CALL FUNCTION  'LVC_TRANSFER_TO_KKBLO'
          EXPORTING
            it_fieldcat_lvc   = <fs1>
        is_layout_lvc     = m_cl_variant->ms_layout
             is_tech_complete  = ' '
          IMPORTING
            es_layout_kkblo   = ls_layout
            et_fieldcat_kkblo = lt_fieldcat.
        LOOP AT lt_fieldcat INTO lt_fieldcat_wa.
          CLEAR lt_fieldcat_wa-tech_complete.
          IF lt_fieldcat_wa-tabname IS INITIAL.
            lt_fieldcat_wa-tabname = '1'.
            MODIFY lt_fieldcat FROM lt_fieldcat_wa.
          ENDIF.
          l_tabname = lt_fieldcat_wa-tabname.
        ENDLOOP.
        CALL FUNCTION 'ALV_XXL_CALL'
             EXPORTING
                  i_tabname           = l_tabname
                  is_layout           = ls_layout
                  it_fieldcat         = lt_fieldcat
                  i_title             = sy-title
             TABLES
                  it_outtab           = <fs0>
             EXCEPTIONS
                  fatal_error         = 1
                  no_display_possible = 2
                  OTHERS              = 3.
        IF  sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    endmethod.
    You get nice column headings etc and decently formatted EXCEL spreadsheet.
    For Office 2007 I think you need to apply a SAP note but it certainly works with OFFICE 2003 which is what we are still using.
    Cheers
    jimbo

    Getting data from a grid to EXCEL can be done in "List" mode vis system==>save etc but it's not particularly user friendly and in any case if you are displaying a nice ALV why should the user have to switch into LIST mode anyway.
    Anyway here's a decent way to do it and it gives great formatted column headings etc etc.
    1) in the ON_TOOLBAR method add this code
    method ON_TOOLBAR.
    type-pools icon.
    CLEAR ls_toolbar.
    MOVE  0 TO ls_toolbar-butn_type.
        MOVE 'EXCEL' TO ls_toolbar-function.
        MOVE  space TO ls_toolbar-disabled.
        MOVE  icon_xxl TO ls_toolbar-icon.
        MOVE 'Excel' TO ls_toolbar-quickinfo.
        MOVE  'EXCEL' TO ls_toolbar-text.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    2) In the ON_USER_COMMAND method add the following
    (if you have a class defined with SE24 you don't need the commented code).
    method ON_USER_COMMAND.
           FOR EVENT before_user_command OF cl_gui_alv_grid
           IMPORTING
             e_ucomm
             sender.
    CASE e_ucomm.
         .......   other toolbar funcs if you have any
          WHEN 'EXCEL'.
            CALL METHOD me->download_to_excel.
        ENDCASE.
    endmethod.
    3) code this method to download to EXCEL
    method DOWNLOAD_TO_EXCEL.
    FIELD-SYMBOLS:
           <fs0> TYPE STANDARD TABLE,
           <fs1> TYPE STANDARD TABLE.
        ASSIGN g_outtab1->* TO <fs0>.
        ASSIGN g_fldcat1->* TO <fs1>.
           CALL FUNCTION  'LVC_TRANSFER_TO_KKBLO'
          EXPORTING
            it_fieldcat_lvc   = <fs1>
        is_layout_lvc     = m_cl_variant->ms_layout
             is_tech_complete  = ' '
          IMPORTING
            es_layout_kkblo   = ls_layout
            et_fieldcat_kkblo = lt_fieldcat.
        LOOP AT lt_fieldcat INTO lt_fieldcat_wa.
          CLEAR lt_fieldcat_wa-tech_complete.
          IF lt_fieldcat_wa-tabname IS INITIAL.
            lt_fieldcat_wa-tabname = '1'.
            MODIFY lt_fieldcat FROM lt_fieldcat_wa.
          ENDIF.
          l_tabname = lt_fieldcat_wa-tabname.
        ENDLOOP.
        CALL FUNCTION 'ALV_XXL_CALL'
             EXPORTING
                  i_tabname           = l_tabname
                  is_layout           = ls_layout
                  it_fieldcat         = lt_fieldcat
                  i_title             = sy-title
             TABLES
                  it_outtab           = <fs0>
             EXCEPTIONS
                  fatal_error         = 1
                  no_display_possible = 2
                  OTHERS              = 3.
        IF  sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    endmethod.
    You get nice column headings etc and decently formatted EXCEL spreadsheet.
    For Office 2007 I think you need to apply a SAP note but it certainly works with OFFICE 2003 which is what we are still using.
    Cheers
    jimbo

  • Download internal table with column headings

    Hai Friends,
    How can i download the internal table with column headings?. i used to download and do some manual calculations to cross check the output.

    Hello,
    You can do this with GUI_DOWNLOAD where you can provide seperate table for fieldnames.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        =
      FILETYPE                        = 'ASC'
      APPEND                          = ' '
      WRITE_FIELD_SEPARATOR           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
    IMPORTING
      FILELENGTH                      =
      TABLES                              ---> Table for sending column headings
        DATA_TAB                        =
      FIELDNAMES                      =
    Hope this helps!
    Thanks,
    Augustin.

  • Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Numbers does not have rotated text within cells.  You can place a text box over the cell that has rotated text but you cannot rotate text within a cell.

  • Does anyone have a report using cfdocument that produces a ledger type report with column headings?

    I need to see some sample source code of a report with column headings and detail data.  I can't get my column titles in the header to line up with the detail no matter what I do.  Can anyone spare me a good sample?
    I have tried to use tables to specify both col headings and detail, but no chance to get them to line up.  There has to be a way.  I can't use the report builder because I need more control of when page breaks print, what data is on each line, etc.  Hopefully some kind soul out there has a good sample.
    Thanks!
    Dave

    Your MBP is actually a mid-2010, not a 2008. That's what the 6,2 model indicates.There's an issue with the graphics module on that machine. There was a program in place to replace the motherboard within 3 years of purchase, but you're probably outside of that. Some folks have supposedly gotten theirs changed outside of that period, so you can try.
    http://support.apple.com/kb/TS4088?viewlocale=en_US&locale=en_US
    What you can do to use it is download gfxstatus from http:gfx.io and force the graphics to Intel. That would affect your work with Final Cut, but at least you might be able to use the machine.

  • Download to Excel with Header but one field data is repeating

    Hi All,
    I'm downloading to Excel with Header. But One field is repeating and another is not. This is happening only when I use   'CONCATENATE ' . With Out this key usage data download to excel is correct. But   CONCATENATE is required as constant need to add before the one field.
    My coding is as below.
    DATA: BEGIN OF IT_FINAL OCCURS 0,
          P1(10) TYPE C,
          SI(19) type c, 
            END OF IT_FINAL.
    DATA : BEGIN OF IT_HEADER OCCURS 0,
    TITLE(100) TYPE C,
    END OF IT_HEADER,WA_HEADER LIKE IT_HEADER.
    loop at it_final.
      CONCATENATE '894412' it_final-SI INTO IT_FINAL.
    modify it_final.
    endloop.
    CLEAR:WA_HEADER.
      WA_HEADER-TITLE = 'Mat No'.
      APPEND WA_HEADER TO IT_HEADER.
      CLEAR:WA_HEADER.
      WA_HEADER-TITLE = 'Serial'.
      APPEND WA_HEADER TO IT_HEADER.
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          FILE_NAME  = P_FILE " path offile where u need to download
        TABLES
          DATA_TAB   = IT_FINAL
          FIELDNAMES = IT_HEADER.
    CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          FILE_NAME  = P_FILE " path offile where u need to download
        TABLES
          DATA_TAB   = IT_FINAL
          FIELDNAMES = IT_HEADER.
    Excel OUT PUT:
    Mat No            Serial
    11Z52321     8944126000
    11Z52394     8944126000
    11Z52395     8944126000
    Thank You,
    Pranitha

    hi,
    it would have been better if u hve opt for creating workarea for ur internal table.
    Try to use "clear it_final" after
    CONCATENATE '894412' it_final-SI INTO IT_FINAL.
    n also change the modify statement :
    modify it_final transporting SI .
    hope this will surely help you
    Regards,
    Punit
    Edited by: punit raval on Aug 26, 2011 2:55 PM

  • Internal Table to Excel with Column Header line

    Hello everyone,
    I need to download Internal table data to excel with a column header line.
    My Code is as follows:
    TYPES:  BEGIN OF y_hdr,
            head(30) TYPE c,
            END OF y_hdr.
    Data:  t_hdr TYPE STANDARD TABLE OF y_hdr.
    Fill internal table t_adrcdata
    fill the header table t_hdr
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                      = C:\test.xls
            filetype                        = 'DBF'
        IMPORTING
          TABLES
            data_tab                        =  t_adrcdata
           fieldnames                       =  t_hdr
         EXCEPTIONS
           file_write_error                = 1
           no_batch                        = 2
    This code gives me a row with column headers.
    However they are all truncated after 10 chars.
    The truncation is independent of column data length. Data could be of length 2,5 or 40 but the header always displays upto 10 chars.
    Keeping the filename as test.xls, when I download it in ASC format instead of DBF the headers are of proper length.
    What could I be doing wrong?
    I know this topic has been discussed before but my question is pertaining to DBF Format download. The reason I chose DBF format is because it downloads the data in DB format and does not give in to Excel formatting.
    FOr example in ASC format:
    1, A field of type Char(12) used to get downloaded into excel without the leading zeros. 000012345678 --> 12345678
    2. Date in format dd-MMM-yyyy in a char(11) field used to get downloaded to excel in dd-MMM-yy format.
    When I chose DBF, this issue was resolved. However, the column headers got truncated at 10 chars.
    Please feel free to recommend any other way of downloading to Excel and preserving format if this method is incorrect/ there is a better way.

    Hi,
    Take 'ASC' format for file type.
    But when you declare your internal table to pass for FM you have to create all the fields with char.
    Example:
    data: begin of it_exl occurs 0,
            bukrs(04) type c,
            belnr(10) type c,
            buzei(03) type c,
    end of ut_exl.
    You need to manipulate your date format and other stuff before appending to this internal table.
    Thanks,
    Deepak.

  • Downloading to Excel with OLE concept

    Hi All,
      I have created a program in 6.0 version which gives my exact requirement.
    Please copy the code and execute the program.
    *& Report  ZSK123                                                      *
    REPORT  ZSK123                                  .
    type-pools: ole2.
    DATA: H TYPE I.
    data: g_sno(5) type n.
    DATA: H_ZL TYPE OLE2_OBJECT,
          H_F  TYPE OLE2_OBJECT.
    types: begin of x_comment,
            comment type string,
          end of x_comment.
    DATA:  H_EXCEL TYPE OLE2_OBJECT,        " EXCEL OBJECT
    H_MAPL TYPE OLE2_OBJECT,         " LIST OF WORKBOOKS
    H_MAP TYPE OLE2_OBJECT.          " WORKBOOK
    types: begin of x_jobs,
            sno(3) type n,
            jobname(50) type c,
            comment type string,"zrtr,
          end of x_jobs.
    DATA: W_STRING(2000) TYPE C.
    data: t_jobs type standard table of x_jobs,
          w_jobs type x_jobs.
    data: hexcel type ole2_object,
          hrange type ole2_object.
    data: l_string type string,
          w_tabix type sy-tabix.
    w_jobs-sno = 100.
    w_jobs-jobname = 'HAA'.
    APPEND W_JOBS TO T_JOBS.
    w_jobs-sno = 2.
    w_jobs-jobname = 'BAI'.
    APPEND W_JOBS TO T_JOBS.
    loop at t_jobs into w_jobs.
    w_tabix = sy-tabix.
    w_jobs-comment = 'What is your name'.
    concatenate w_jobs-comment 'My name is Subhani' into w_jobs-comment
              separated by cl_abap_CHAR_UTILITIES=>newline.
    modify t_jobs from w_jobs index w_tabix transporting comment.
    endloop.
    CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
      SET PROPERTY OF H_EXCEL  'VISIBLE' = 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.
    OUTPUT COLUMN HEADINGS TO ACTIVE EXCEL SHEET
      PERFORM FILL_CELL USING 1 1 1 000 'SNO'(001).
      PERFORM FILL_CELL USING 1 2 1 000 'JOBNAME'(002).
      PERFORM FILL_CELL USING 1 3 1 000 'COMMENT'(003).
      LOOP AT T_JOBS INTO W_JOBS.
    COPY DATATO ACTIVE EXCEL SHEET
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 000 W_JOBS-SNO.
        PERFORM FILL_CELL USING H 2 0 000 W_JOBS-JOBNAME.
        PERFORM FILL_CELL USING H 3 0 000 W_JOBS-COMMENT.
      ENDLOOP.
    CALL METHOD OF H_EXCEL 'WORKBOOKS' = H_MAPL.
      CALL METHOD OF H_EXCEL 'WORKSHEETS' = H_MAPL." EXPORTIN    G #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'.
      LOOP AT T_JOBS INTO W_JOBS.
    COPY FLIGHTS TO ACTIVE EXCEL SHEET
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 000 W_JOBS-SNO.
        PERFORM FILL_CELL USING H 2 0 000 W_JOBS-JOBNAME.
        PERFORM FILL_CELL USING H 3 0 000 W_JOBS-COMMENT.
      ENDLOOP.
      FREE OBJECT H_EXCEL.
    PERFORM ERR_HDL.
    *&      FORM  ERR_HDL
          OUTPUTS OLE ERROR IF ANY                                       *
    -->  P1        TEXT
    <--  P2        TEXT
    FORM ERR_HDL.
      IF SY-SUBRC <> 0.
        WRITE: / 'BATCH JOB AUTOMATION CARRIED OUT SUCCESFULLY'.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL             .
          FORM FILL_CELL                                                *
          SETS CELL AT COORDINATES I,J TO VALUE VAL BOLDTYPE BOLD       *
    FORM FILL_CELL USING I J BOLD COL 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.
      SET PROPERTY OF H_F 'BOLD' = BOLD .
    PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'COLOR' = COL.
    PERFORM ERR_HDL.
    ENDFORM.                    "FILL_CELL
    But in 4.6c there is no method called cl_abap_char_utilities=>newline. So how can i get the same output in 4.6c. please help.
    Regards,
    Subhani.

    I don't see any method in class cl_abap_char_utilities with name newline.
    But when i search class for this string, i see
    constants NEWLINE type ABAP_CHAR1 value %_NEWLINE. "#EC NOTEXT
    Check this once in your system too.
    And you can declare similar variable in 46C and use the same in the program.

  • Dynamic crystal report generation - issues with column headings

    Hi All,<br>
    I'm trying to generate a crystal report dynamically based on a "result set" data(Query: select REPORT_ID, REPORT_NAME, REPORT_DESC, RPT_FILE_NAME, LOCATION from IRS_REPORT_DETAILS). I'm able to generate the report run time, But the report is without columns heads. I would like to include the column headings as well. <br><br>
    I searched the API(RAS) and found that there is a 'add(java.lang.String fieldName, java.lang.String headingText) " method present in "ReportObjectController" using which we can add the headings.<br><br>
    ReportDefController reportDefController = clientDoc.getReportDefController();
    ReportObjectController reportObjectController = reportDefController.getReportObjectController();
    reportObjectController.add( "{Table.Field}", "FieldName" );
    <br><br>
    I'm facing problems in using this code. When trying to use this function for my fields(Ex: reportObjectController.add( "{ IRS_REPORT_DETAILS.REPORT_ID}", "Report ID" );) it is giving me the following error:<br><br>"com.crystaldecisions.sdk.occa.report.lib.ReportSDKGroupException: The field was not found.---- Error code:-2147213310 Error code name:fieldNotFound"<br><br>
    <b>The following is my dynamic crystal report generation code:</b><br><br>
    public ReportClientDocument execute(String repName, String query) {
              ReportClientDocument boReportClientDocument = null;
              try {
                   boReportClientDocument = new ReportClientDocument();
                   boReportClientDocument.newDocument();
                      // Add a table based on the given Resultset to the report.
                   dbConnResultSet mySampleResultSet = new dbConnResultSet();
                   //mySampleResultSet.execute(query);
                   boReportClientDocument.getDatabaseController().addDataSource(
                             mySampleResultSet.execute(query));
                   IReportSource test = boReportClientDocument.getReportSource();
                   // Access all the database fields
                   DatabaseController databaseController = boReportClientDocument
                             .getDatabaseController();
                   IDatabase database = databaseController.getDatabase();
                   Tables tables = database.getTables();
                   ITable table = (Table) tables.getTable(0);
                   int NO_OF_FIELDS = table.getDataFields().size();
                   int LEFT_POSITION = 200;
                   // Add all the database fields to the report document
                   for (int i = 0; i < NO_OF_FIELDS; i++) {
                        IField field = table.getDataFields().getField(i);
                        FieldObject fieldObject = new FieldObject();
                        fieldObject.setFieldValueType(field.getType());
                        fieldObject.setDataSource(field.getFormulaForm());
                        IReportObject rep = (IReportObject) fieldObject;
                        IObjectFormat objformat = rep.getFormat();
                        objformat.setEnableCanGrow(true);
                        objformat.setHorizontalAlignment(Alignment.from_int(1));
                        rep.setFormat(objformat);
                        rep.setLeft(LEFT_POSITION);
                        rep.setWidth(1000);
                        LEFT_POSITION = LEFT_POSITION + 1000 + 50;
                        ISection section = boReportClientDocument
                                  .getReportDefController().getReportDefinition()
                                  .getDetailArea().getSections().getSection(0);
                                   //***************** Data being added to the report here, But headings are not added*****************
                        boReportClientDocument.getReportDefController()
                                  .getReportObjectController().add(rep, section, i);
                   boReportClientDocument.createReport();
                   /*Some report saving code is present down*/
              } catch (ReportSDKException ex) {
                   ex.printStackTrace();
              } catch (Exception ex) {
                   ex.printStackTrace();
              return boReportClientDocument;
    <br><br>
    appreciate your help.

    IField field = table.getDataFields().getField(i);
    Here you are getting the first field in the array.  This may not be the field you want to add since we aren't sure how the arrays are ordered when retrieving fields from the report.  It is better to retrieve the fields with the findObjectByName method, thus ensuring you are retrieving the field you want to add to your heading.

  • ALV output download to excel with top of page

    Hi,
    i want to download ALV grid output to excel sheet including the top of page. i am using the icon in application tool bar. but only data's are download to excel sheet. i cannot download the top of page. with out write coding in program can we download it. if yes pls explain.
    thanks.

    I'm sorry but I can't find FM with DOWNLOAD_EXCEL_*.
    I want to know more detail thing.
    plz. give answer to me anytime.
    I'm waiting..
    Edited by: Kwang Seop Kim on Sep 26, 2008 6:57 AM

  • Customize download to excel with disclaimer

    I need to customize download link in dashboard so that results are downloaded to an Excel sheet but with client' s disclaimer message at the end. Client do not want the disclaimer to be shown on the dashboard. So basically we need to alter the download to Excel link at the system level, so that whenever it is clicked, the report gets downloaded to an excel with the disclaimer message at the end.
    I did some work and found that when we click on Download To Excel option, a function gets called from file \OracleBI\web\msgdb \viewscontrolmessages.xml, there we have:
    Download(&#39;@{command}&amp;Format=mht&am p;amp;Extension=.xls&#39;)
    I think someway we need to alter this download function so that it appends a disclaimer message to Excel after every download.
    Or let me know if you think any other way!
    We are using OBIEE 10g .
    Rahul

    This seems now "re-inventing the wheel" sort of requirement. I was looking into possibility of using GO URL to get the report in csv and then writing a java script to append the disclaimer text in the downloaded file . But am stuck on the front, how to store the file without any manual effort. Because when we use Go URL a save as pop-up throws, rather I want when user clicks on our customized Download link, it should download the data and store in a file and then append it with a disclaimer text and then throw a save as pop-up.
    Also has anyone any idea how to use the any OBIEE java functions in a java script written in text view ( with html enabled ) ?
    Let me know if anyone has any thoughts on how to do that!

  • Download to Excel with Images

    Hello
    The download to excel and PDF documents now includes images.  I have inlcuded images in my web templates to execute commands eg: Download to Excel, Bookmake etc.
    See below:
    img onclick="executeJS_EXPORT_XSLT120();" alt="Download to Excel" src="bwmimerep:///sap/bw/Mime/BEx/Icons/S_X_XLS.gif" border="0"
    These images are simply for command execution and look out of place and serve no purpose in the excel or PDF files.
    My Question:
    Is it possible to exclude these images in the docnload to excel and PDF?
    Thanks in advance.
    Ian
    Message was edited by:
            Ian Carbonel

    Thanks For your reply Prakash.
    This works well after some preliminary testing.
    Thanks
    Ian

  • Reg: ALV report download to excel currency columns

    Hi All,
    While downloading the alv report to excel, currency fields with negative sign(less than 0) is downloading without negative sign.
    And field catalog wad declared as 'CURR' field for that particular column, if I declared as 'CHAR', i am getting shortdump.
    Can any one tell me how to get the negative sign.
    Thanks in advance.

    Hi,
    Do you use ALV to excel standard functionality or your own code to excel?
    Please provide more information.
    Thanks,

  • Download to excel with multiple lines in header

    Hi experts,
    Is there any Funtion module available to download an internal table contents into Local directory of PC with multiple lines in header.
    i.e.  let us say i hv internal table of 5 entries with 3 columns...
    i need to download this 5 entries into an excel file with some texts above the table contents...
    For eg : in the below format...
    Sample line 1
    sample line 2
    sample line 3
    colheader1     colheader2     colheader3
    item1                              
    item2
    item3
    item4
    item5
    Please help.
    Edited by: Lakshmiraj on Jul 15, 2010 3:26 AM

    There is another option of using OLE automation Please check the link below
    http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-OLEAutomationusing+MS-Excel
    OR
    chek for the example program in Tcode DWDM ( OLE example )
    OR
    Use FM KCD_EXCEL_OLE_TO_INT_CONVERT ( Fm Uses the same OLE automation)
    Hope it helps
    Anup

  • EXport Data to Excel with Columns format

    Dear All,
    This may  be a basic question, however, I just need a tip to conclude my issue. 
    I have a Report that displays Financial Budget data (AFE).  I am able to download to the Excel sheet.  However, I need to conclude it with the column formatted at code itself and not given to the user.
    That is I want to set couple of column to Numeric, and Set Colum width defined at Code level itself.
    I am already using the Function module : MS_EXCEL_OLE_STANDARD_DAT
    Regards,
    Venkat

    data: go_excel       type ole2_object,
              Go_CELL        TYPE OLE2_OBJECT,
              go_workbooks   TYPE OLE2_OBJECT,
              go_workbook    TYPE OLE2_OBJECT,
              go_sheet       type OLE2_OBJECT,
              go_application type OLE2_OBJECT,
              go_activesheet type OLE2_OBJECT,
              go_text        type OLE2_OBJECT.
        gv_EXTRD = sy-datum.
        gv_EXTRT = sy-uzeit.
        concatenate pfile gv_EXTRD gv_EXTRT  'check.xls' into gv_file.
        clear: gt_export, gs_export.
    ****INITIATE EXCEL
    Create object Excel
        create object go_excel 'EXCEL.APPLICATION'.
        set property of go_excel 'Visible' = 0.
    Create workbook object
        call method of go_excel 'WORKBOOKS' = go_workbook .
      Add workbook
        call method of go_workbook 'Add' = go_workbook.
        lv_line = 0.
        loop at gt_collect ASSIGNING <collect>.
          lv_line = lv_line + 1.
          move-corresponding <collect> to gs_export.
          clear: gs_export-ZALDT.
          concatenate <collect>-ZALDT4(2) '-' <collect>-ZALDT6(2) '-' <collect>-ZALDT+0(4)
               into gs_export-ZALDT.
    Populate cells
          call method of go_excel 'Cells' = Go_CELL
            EXPORTING
              #1 = lv_line
              #2 = 1.
    **************SET UP PROPERTY WIDTH ****************************
          SET PROPERTY OF GO_CELL 'ColumnWidth' = '11'.
          SET PROPERTY OF GO_CELL 'Value' = gs_export-BANKL.
    ***********SET PROPERTY CELL NUMBER**************************************
          call method of go_excel 'Cells' = Go_CELL
            EXPORTING
              #1 = lv_line
              #2 = 4.
          SET PROPERTY OF go_cell 'NumberFormat' = '@'.     "PROPERTY NUMBER
          SET PROPERTY OF GO_CELL 'ColumnWidth' = '10'.
          SET PROPERTY OF GO_CELL 'Value' = gs_export-ZALDT.
    endloop.
    **CLOSE EXCEL**********
        CALL METHOD OF go_workbook 'SaveAs'
          EXPORTING #1 = gv_file
          #2 = 1.
        "file format
        CALL METHOD OF go_workbook 'close'.                                    "file format
        call method of go_excel 'QUIT'.
    ****OPEN CREATED EXCEL FILE ****************************
        call method of go_excel 'Workbooks' = go_workbooks.
        call method of go_workbooks 'Open'
          EXPORTING
            #1 = gv_file.
        set property of go_excel 'Visible' = 1.

Maybe you are looking for