Add dynamic fields to excel sheet

i need to o/p the data onto a excel sheet.But some of the fields are added at runtime.ie some of the fields cannot be known until runtime,For ex. for every bill_no there may exist one or more materials which r known at runtime and these if exist has to be added to the excel sheet on one line(one row).kindly let me know the procedure.Bill no is given in selection screen for data selection.

i need to o/p the data onto a excel sheet.But some of the fields are added at runtime.ie some of the fields cannot be known until runtime,For ex. for every bill_no there may exist one or more materials which r known at runtime and these if exist has to be added to the excel sheet on one line(one row).kindly let me know the procedure.Bill no is given in selection screen for data selection.

Similar Messages

  • Additional fields in excel sheet in bid

    Hi,
    I have to add some additional fields in excel sheet by using the badi
    BBP_BID_EVAL_DISPLAY.
    if any one already came across please provide some sample code .
    Thanks
    Ram

    hi
    just refer to the link below
    http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • How to add an image in Excel sheet

    hi,
    I cannot add an image in excel sheet. i have used apache POI for writing data in excel sheet. But i cannot add an image in excel sheet.
    Please help me about this
    Thanks
    Bina

    From
    http://jakarta.apache.org/poi/hssf/quick-guide.html#Images
    Images are part of the drawing support. To add an image just call createPicture() on the drawing patriarch. At the time of writing the following types are supported:
    PNG
    JPG
    DIB
    It is not currently possible to read existing images and it should be noted that any existing drawings may be erased once you add a image to a sheet.
        // Create the drawing patriarch.  This is the top level container for
        // all shapes. This will clear out any existing shapes for that sheet.
        HSSFPatriarch patriarch = sheet5.createDrawingPatriarch();
        HSSFClientAnchor anchor;
        anchor = new HSSFClientAnchor(0,0,0,255,(short)2,2,(short)4,7);
        anchor.setAnchorType( 2 );
        patriarch.createPicture(anchor, loadPicture( "src/resources/logos/logoKarmokar4.png", wb ));

  • Issue in displaying DATE field in Excel sheet

    Hi All,
    Kindly help me with the below issue:
    A report program when exexuted fetches the data's from database tables and populates in to an itab and the same is then moved to a itab which is declared like this:
    DATA: BEGIN OF t_downd OCCURS 0,
            line(4096) TYPE c,
          END OF t_downd.
    This T_DOWND will have all the obtained records and the same is used to pass the entries to GUI_DOWNLOAD function module inorder to save the excel sheet in '.csv' format to the desktop.
    The issue is the user wants the 'DATE' field to be displayed in 'DD-MM-YYYY' format in the excel sheet. So I have fetched the date based on the position(fdpos) and used the concatenate statement separated by '-'. Now when I run the program, some dates are not getting displayed in 'DD-MM-YYYY' format and some dates are getting displayed correctly as per the requirement.
    While debugging also, I could find the date value in T_DOWND in the 'DD-MM-YYYY' format only. Not sure where it is actually getting changed and why.
    Can some one please provide a soultion for this.
    Thanks,
    Deepa

    Hi Soumya,
    Thanks for the reply!
    I declared a constant in the below format for the quotes:
    constants : c_quotes type c value ''''. (i have put 4 quotes)
    Now i have concatenated the above quotes to my date value.
    But the output in the excel sheet is now getting displayed like this '30-02-2011
    All the dates are getting displayed in the correct expected format, but the only issue is we are getting an extra quotes in front of the date.
    Can you please suggest why this is happening.
    Thanks,
    Deepa
    Edited by: Deeparani.D on Jan 9, 2012 11:53 AM
    Edited by: Deeparani.D on Jan 9, 2012 11:54 AM

  • Uploading field from excel sheet only of length 4 into SAP Table

    Dear Friend,
    I want to upload fields like Compny Code & Business Area of length 4 characters into SAP Tables. But in the excel sheet at some places Co Code & Business Area of length less than 4 characters is maintained which I want to ignore ie. those items should not be updated into the tables.
    Plz guide me how this can b done, what code I shuld write for this.
    Thanks,
    Nishu

    Hi Nishu,
      There is no way you can validate the fields and their lengths before you ipload them into internal tables.
    First you should upload them and then loop the intrenal table to delete such records.
    loop at itab.
    if strlen(itab-comp_code) < 4.
    delete itab index sy-tabix.
    endif.
    endloop.
    Regards,
    Ravi

  • How To add dynamic field using struts?

    Hi All,
    I new to the struts. I wanted to add dynamic form field .

    Why do so many people ask struts questions here? It's an Apache project and it has a mailing list. Why not go directly to the source? [http://struts.apache.org/]
    Kaj

  • Downloading the multiple columns(Multiple fields) into excel sheet in OLE

    HI friends,
                    I am using OLE method to download 3 internal tables data into 3 worksheeets in one excel file. i am able to create 3 worksheets.but i am getting the whole data merged into one column(A column) where as i want 5 columns in one sheet if i have 5 database table fields.can anybody check my code and propose the solution for this.
      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.
      DATA gv_sheet_name(20) TYPE c .
    * start Excel IF h_excel-header = space OR h_excel-handle = -1.
      CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *--- get list of workbooks, initially empty
      CALL METHOD OF h_excel 'Workbooks' = h_mapl.
      SET PROPERTY OF h_excel 'Visible' = 1.
      CALL METHOD OF h_mapl 'Add' = h_map.
      gv_sheet_name = 'SM37'.
      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.
      GET PROPERTY OF h_cell 'Font' = gs_font.
      SET PROPERTY OF gs_font 'Bold' = 1 .
      DATA l_rc TYPE i.
      DATA : y_file TYPE string.
       y_file = x_file.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
          data = tab_sm37[]
      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.
      CALL METHOD OF h_excel 'Range' = range
           EXPORTING
                #1 = w_cell1
               #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
      gv_sheet_name = 'ST22'.
      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 = tab_sm37[]
      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.
      CALL METHOD OF h_excel 'Range' = range
             EXPORTING
                #1 = w_cell1
                #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
      gv_sheet_name = 'WE02'.
      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.
      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 = tab_sm37[]
      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.
      CALL METHOD OF h_excel 'Range' = range
              EXPORTING
                   #1 = w_cell1
                   #2 = w_cell2.
      CALL METHOD OF range 'Select'.
      CALL METHOD OF worksheet 'Paste'.
    *--- disconnect from Excel
      FREE OBJECT h_zl.
      FREE OBJECT h_mapl.
      FREE OBJECT h_map.
      FREE OBJECT h_excel.
    thanks in advance.
    Edited by: MAHESH MUMAR on Feb 27, 2009 2:58 PM

    try this code
    INCLUDE ole2incl.
    DATA: w_cell1 TYPE ole2_object,
    w_cell2 TYPE ole2_object.
    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.
    DATA gv_sheet_name(20) TYPE c .
    * start Excel IF h_excel-header = space OR h_excel-handle = -1.
    CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    *--- get list of workbooks, initially empty
    CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    SET PROPERTY OF h_excel 'Visible' = 1.
    CALL METHOD OF h_mapl 'Add' = h_map.
    gv_sheet_name = 'SM37'.
    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.
    GET PROPERTY OF h_cell 'Font' = gs_font.
    SET PROPERTY OF gs_font 'Bold' = 1 .
    DATA l_rc TYPE i.
    DATA : y_file TYPE string.
    y_file = x_file.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = tab_sm37
      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.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'ST22'.
    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' = 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.
    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                 = tab_sm37[]
      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.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'WE02'.
    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' = 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.
    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                 = tab_sm37[]
      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.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    free object h_zl.
    FREE OBJECT h_mapl.
    FREE OBJECT h_map.
    FREE OBJECT h_excel.

  • Add header line to excel sheet when using FM RH_START_EXCEL_WITH_DATA

    Hi
    I'm using FM RH_START_EXCEL_WITH_DATA to download an internal table to EXCEL. But when excel is started it's without a header line.
    What I would like to do, is to take the field-names/field-text from the abap dictionary, and use them as the header line. How do I achieve this ?
    Regards
    Morten Nielsen

    Hi ,
    See this sample code.
    Tables : zacg_cca,zacg_exsh.
    data: P_file like RLGRAP-FILENAME.
    Data: Begin of it_header occurs 0,
          Header(15) ,
          end of it_header.
    Data : begin of it_final occurs 0,
           ccode type zacg_cca-ccode,
           mat_cd type zacg_cca-mat_cd,
           ingr_desc type zacg_cca-ingr_desc,
           conc type  zacg_cca-conc,
           quantity type zacg_cca-quantity,
           percqty type zacg_cca-percqty,
           flag ,
           APP_DATE type zacg_cca-app_date,
           rsamnos type zacg_cca-rsamnos,
           end of it_final.
           SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-000.
           select-options : s_Date for zacg_cca-app_date.
           SELECTION-SCREEN  : END OF BLOCK blk.
           it_header-Header = 'Samp_code'.
           Append it_header.
           it_header-Header = 'Mat_code'.
           Append it_header.
           it_header-Header = 'Ingr_Desc'.
           Append it_header.
           it_header-Header = 'Conc'.
           Append it_header.
           it_header-Header = 'Quan'.
           Append it_header.
           it_header-Header = 'Perc'.
           Append it_header.
           it_header-Header = 'Flag'.
           Append it_header.
           it_header-Header = 'Date'.
           Append it_header.
           it_header-Header = 'Rsamnos'.
           Append it_header.
             it_header-Header = 'Mat_code'.
           Append it_header.
           select ccode
                  mat_cd
                  ingr_desc
                  conc
                  quantity
                  percqty
                  app_date
                  rsamnos
                  from zacg_cca  into corresponding
            fields of table
           it_final where  zacg_cca~app_date in s_date.
           loop at it_final.
           it_final-flag = 'T'.
           modify it_final.
           it_final-quantity = it_final-quantity * 2 .
           Modify it_final.
           endloop.
           CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
             EXPORTING
               FILE_NAME                       = 'E:\IT\P_FILE'
             CREATE_PIVOT                    = 0
             DATA_SHEET_NAME                 = ' '
             PIVOT_SHEET_NAME                = ' '
             PASSWORD                        = ' '
             PASSWORD_OPTION                 = 0
            TABLES
             PIVOT_FIELD_TAB                 =
              DATA_TAB                        = it_final[]
              FIELDNAMES                      = it_header[]
            EXCEPTIONS
              FILE_NOT_EXIST                  = 1
              FILENAME_EXPECTED               = 2
              COMMUNICATION_ERROR             = 3
              OLE_OBJECT_METHOD_ERROR         = 4
              OLE_OBJECT_PROPERTY_ERROR       = 5
              INVALID_PIVOT_FIELDS            = 6
              DOWNLOAD_PROBLEM                = 7
              OTHERS                          = 8
           IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    Regards
    ABG

  • Download Alv into excel sheet according to variant fields

    Hi All,
    I have more than 100 fields in the ALV report, now i want to download the report according to the fields are choosen in the variant. I am getting all the fields in excel sheet but i need some fileds that is selected in the variant.
    Thanks in advance.
    Rudhir

    use your own excel button and program this steps:

    * Get the frontend fieldcatalog
    CALL METHOD go_grid->get_frontend_fieldcatalog
    IMPORTING
    et_fieldcatalog = lt_fieldcat.
    DELETE lt_fieldcat WHERE no_out EQ 'X'.

    *create dynamic table with the frontend fieldcatalog
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = lt_fieldcat
    IMPORTING
    ep_table = lt_data
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc EQ 0.
    ASSIGN lt_data->* TO <lt_table>.
    ENDIF.
    3° Fill the dynamic table
    4° export to excel using
    CALL FUNCTION 'XXL_SIMPLE_API'
    TABLES
    col_text = xmplt_v1
    data = <lt_table>
    online_text = xmplt_o1
    print_text = xmplt_p1
    EXCEPTIONS
    dim_mismatch_data = 1
    file_open_error       =2
    file_write_error      = 3
    inv_winsys            =4
    inv_xxl                   =5
    OTHERS                = 6.
    Check the complete example here

  • Is there an add-on for Microsoft Skydrive to download Excel sheets?

    Looking for an add-on to download Excel sheets from Skydrive.

    Try [https://addons.mozilla.org/en-us/firefox/addon/grooveshredder/ Groove Shredder]

  • How to dowload data in particular cell of designed excel sheet

    hi everyone
    i want to dowload the data in a excel sheet, but this excel sheet is designed in such a format that i have download each field of internal table in a specified cell only , <b>gui_download</b> function module simply download the data in excel sheet by taking the first cell for first field but i dont want that

    Hi Neetu,
    you can use OLE in that case.
    REPORT  ZTEST_EXCEL             .
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
           workbook TYPE ole2_object,
           sheet TYPE ole2_object,
           cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0,
    first_name(10),
    last_name(10),
    END OF itab1.
    START-OF-SELECTION.
    itab1-first_name = '123445'.
    itab1-last_name = 'tesst'.
    append itab1.
    clear itab1.
    itab1-first_name = '123446'.
    itab1-last_name = 'tesst'.
    append itab1.
    clear itab1.
      CREATE OBJECT application 'excel.application'.
      SET PROPERTY OF application 'visible' = 1.
      CALL METHOD OF application 'Workbooks' = workbook.
      CALL METHOD OF workbook 'Add'.
    * Create first Excel Sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 1.
      CALL METHOD OF sheet 'Activate'.
      SET PROPERTY OF sheet 'Name' = 'Sheet1'.
      LOOP AT itab1.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Value' = itab1-first_name.
            index = index + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Value' = itab1-last_name.
      ENDLOOP.
    * Save excel speadsheet to particular filename
      CALL METHOD OF sheet 'SaveAs'
                     EXPORTING #1 = 'c:tempexceldoc1.xls'     "filename
                                #2 = 1.                          "fileFormat
    Regards
    vijay

  • Export ALV List into Excel Sheet

    Hi Friends,
    We are displaying an ALV List in report Program and we are exporting that into excel sheet using the icon "Spreadsheet(ctrlshiftF7)"provided by ALV Grid.
    But when it is displayed in Excel sheet it changes the sequence of columns (fields).
    And we observed that it displays all the CHAR fields first then the CURRENCY fields and then the DATE fields that we specified in field catalog.
    So, what should be done so that the fields are exported into Excel in the same order as specified in the field catalog of ALV List.

    Give this a look.
    REPORT ZEXCEL .
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
    workbook TYPE ole2_object,
    sheet TYPE ole2_object,
    cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0, formula(50), END OF itab3.
    *START-OF-SELECTION
    START-OF-SELECTION.
    APPEND: 'Peter' TO itab1, 'Ivanov' TO itab2,
    '=Sheet1!A1 & " " & Sheet2!A1' TO itab3,
    'John' TO itab1, 'Smith' TO itab2,
    '=Sheet1!A2 & " " & Sheet2!A2' TO itab3.
    CREATE OBJECT application 'excel.application'.
    SET PROPERTY OF application 'visible' = 1.
    CALL METHOD OF application 'Workbooks' = workbook.
    CALL METHOD OF workbook 'Add'.
    Create first Excel Sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 1.
    CALL METHOD OF sheet 'Activate'.
    SET PROPERTY OF sheet 'Name' = 'Sheet1'.
    LOOP AT itab1.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab1-first_name.
    ENDLOOP.
    Create second Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 2.
    SET PROPERTY OF sheet 'Name' = 'Sheet2'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab2.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab2-last_name.
    ENDLOOP.
    Create third Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 3.
    SET PROPERTY OF sheet 'Name' = 'Sheet3'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab3.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Formula' = itab3-formula.
    SET PROPERTY OF cells 'Value' = itab3-formula.
    ENDLOOP.
    Save excel speadsheet to particular filename
    CALL METHOD OF sheet 'SaveAs'
    EXPORTING #1 = 'c:\temp\exceldoc1.xls' "filename
    #2 = 1. "fileFormat
    Closes excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.

  • Changing layout into excel sheet.

    Hi experts's,
    In a ALV report (not OOP's concept) i want to display changing layout fields in EXCEL sheet. please send if you have sample program.
    please suggest how to solve this problem.
    Thanks and regard
    pavan.

    Hi experts's,
    In a ALV report (not OOP's concept) i want to display changing layout fields in EXCEL sheet. please send if you have sample program.
    please suggest how to solve this problem.
    Thanks and regard
    pavan.

  • How to export to excel sheet from Oracle APEX 4.0?

    Hello,
         I'm relatively new to Oracle APEX. I'm in need of a solution to address the above question. I want to export a report's contents to an excel sheet from Oracle APEX(Priority).
    The export should be customizable to add entries into the excel sheet as I need(Secondary). Can anybody help?

    Checkout this link:
    http://technology.amis.nl/2011/02/19/create-an-excel-file-with-plsql/
    Thank you,
    Tony Miller
    Ruckersville, VA

  • Downloading logo in excel sheet from application server

    hi all
    how can i download a logo in excel sheet from the application server(logo is in OAOR tcode) .you can also specify with OOPS concept.
    rewards assured.
    Reagrds
    Swarnali Basu

    hi naresh
    i think there is some miscommunication in case of my question,my requirement is to add a logo in excel sheet from application server,i mean when the user clicks to download the excel sheet the logo should immediately appear in the excel sheet,and it is not a fixed logo it can be anything which appears in applicaton server(on that program).
    as far as excel sheet stanalone is concerned i know to do it and as well as to get the logo  in the application server standalone ,but i cant download the logo in excel sheet from the application server.now does my question make sense ?
    Reagrds
    Swarnali

Maybe you are looking for

  • Global vriable is not being reflected in the portal

    Hi, I have to hide the element depening upon the value of the variable, the variable is global defined in the interface. My problem is that all the variables values are being reflected back in the form exept the global variable value. I have assigned

  • Visual Studio or LabWindows/CVI?

    I have a bit of a dilemma. I currently own Visual Studio 2010, IMAQ Vision Development Module 2013, and Measurement Studio (not sure of version). I currently do all of my programming in VB.net. Because IMAQ VDM is stuck in .Net framework 3.5 and ther

  • Why won't LR5.7 let me add files in a folder to its catalog?

    I accidentally imported files from an SD card into two different folders. Lightroom made me aware of this when I tried to copy them from folder A to the 'correct' folder B, by saying that they were already present in the destination folder. The stats

  • Error "Deserialisation failed" when trying to use BAPI via a web service

    I created a web service in BW with the help from the wizard WS_WZD_START. The web service contains (among others) the RFC BAPI_ODSO_READ_DATA_UC. The web service runs OK & can be used from the SAP Web Services Navigator. Now when i try to use the web

  • I don't understand how people can use AppleTV after v2.0

    Hi, Ever since version 2.0 came out, I've found the AppleTV completely unusable. For one, a minor annoyance is that when I switch to the AppleTV in the source list on my TV, there is a five second lag where the AppleTV is doing something before it be