Heading for excel sheet

Hi everyone,
                 I am downloading an internal table into an excel sheet using function module using GUI_DOWNLOAD . Now i need to have a heading line in the excel sheet. How should i do this? I kindly request you to help me in this issue. Thanks in advance.

hiii
yes you right..that is the only problem you are having..without using FIELDNAMES you can get header like following program..just check follwoing program it will solve your problem...as that parameter is not used in FM gui_download
TABLES:
  mara.
*                        T Y P E S                                     *
TYPES:
  BEGIN OF type_a090,
    kschl TYPE a090-kschl,             " Condition type
    vbeln TYPE a090-vbeln,             " Sales document number
    posnr TYPE a090-posnr,             " Item number
    matnr TYPE a090-matnr,             " Material number
    datbi TYPE a090-datbi,             " Valid from
    datab TYPE a090-datab,             " Valid to
  END OF type_a090.
TYPES:
  BEGIN OF type_mara,
    matkl TYPE mara-matkl,             " Material group
    matnr TYPE mara-matnr,             " Material number
  END OF type_mara.
TYPES:
  BEGIN OF type_makt,
    maktx TYPE makt-maktx,             " Material description
    matnr TYPE makt-matnr,             " Material number
  END OF type_makt.
TYPES:
  BEGIN OF type_output,
    kschl TYPE a090-kschl,             " Condition type
    vbeln TYPE a090-vbeln,             " Sales document number
    posnr TYPE a090-posnr,             " Item number
    matnr TYPE a090-matnr,             " Material number
    datbi(10) TYPE c,                  " Valid from
    datab(10) TYPE c,                  " Valid to
    matkl TYPE mara-matkl,             " Material group
    maktx TYPE makt-maktx,             " Material description
  END OF type_output.
TYPES:
  BEGIN OF type_final,
    string TYPE string,
  END OF type_final.
*                            D A T A                                   *
DATA:wa_a090 TYPE type_a090,
     i_a090  TYPE STANDARD TABLE OF type_a090,
     wa_mara TYPE type_mara,
     i_mara  TYPE STANDARD TABLE OF type_mara,
     wa_makt TYPE type_makt,
     i_makt  TYPE STANDARD TABLE OF type_makt,
     wa_output TYPE type_output,
     i_output  TYPE TABLE OF type_output,
     wa_final TYPE type_final,
     i_final  TYPE STANDARD TABLE OF type_final.            "#EC NEEDED
*                 S E L E C T I O N     S C R E E N                    *
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE text-se1.
SELECT-OPTIONS:
  s_matnr          FOR mara-matnr,     " Material Number
  s_mtart          FOR mara-mtart.     " Material Type
PARAMETERS p_kschl TYPE konp-kschl  DEFAULT text-000.
" Condition Type
SELECTION-SCREEN END   OF BLOCK sel1.
SELECTION-SCREEN BEGIN OF BLOCK sel2 WITH FRAME TITLE text-se2.
SELECTION-SCREEN BEGIN OF BLOCK sel3 WITH FRAME TITLE text-se3.
PARAMETERS:
  p_app_a          RADIOBUTTON GROUP file,
  p_filea          type rlgrap-filename,
                                       " Local file for upload/download
  p_app_p          RADIOBUTTON GROUP file,
  p_filep          type rlgrap-filename.
" Local file for upload/download
SELECTION-SCREEN END   OF BLOCK sel3.
SELECTION-SCREEN BEGIN OF BLOCK sel4 WITH FRAME TITLE text-se4.
PARAMETERS:
  p_price          type rlgrap-filename OBLIGATORY
    DEFAULT text-001.
SELECTION-SCREEN END   OF BLOCK sel4.
SELECTION-SCREEN END   OF BLOCK sel2.
* Selection screen processing
AT SELECTION-SCREEN ON p_filea.
  IF NOT p_app_a IS INITIAL.
    IF p_filea IS INITIAL.
      MESSAGE e398
        WITH text-002 '' '' ''.
    ENDIF.                             " IF p_filea IS INITIAL
  ENDIF.                               " IF NOT p_app_a IS INITIAL
AT SELECTION-SCREEN ON p_filep.
  IF NOT p_app_p IS INITIAL.
    IF p_filep IS INITIAL.
      MESSAGE e398
        WITH text-003 '' '' ''.
    ENDIF.                             " IF p_filep IS INITIAL
  ENDIF.                               " IF NOT p_app_p
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM output_data.
  PERFORM header.
*&      Form  get_data                                                 *
* Fetching data from the tables.
*  There are no interface parameters to be passed.                     *
FORM get_data .
  SELECT   kschl                       " Condition type
           vbeln                       " Sales document number
           posnr                       " Item number
           matnr                       " Material number
           datbi                       " Valid from
           datab                       " Valid to
           FROM a090
           INTO TABLE i_a090
           WHERE matnr IN  s_matnr AND
           kschl EQ p_kschl
           AND datab LE syst-datum
           AND datbi GE syst-datum.
  IF sy-subrc EQ 0.
    SELECT matkl                         " Material group
           matnr                         " Material number
           FROM mara
           INTO TABLE i_mara
           FOR ALL ENTRIES IN i_a090
           WHERE matnr = i_a090-matnr.
  ENDIF.
  IF sy-subrc EQ 0.
    SELECT maktx                         " Material description
           matnr                         " Material number
           FROM makt
           INTO TABLE i_makt
           FOR ALL ENTRIES IN i_mara
           WHERE matnr = i_mara-matnr
           AND spras = 'EN'.
  ENDIF.
ENDFORM.                               " get_data
*&      Form  output_data                                              *
*  Populating the final output table.
* There are no interface parameters to be passed.                      *
FORM output_data .
  DATA:
    w_date2(10) TYPE c,                " For date formate
    w_date1(10) TYPE c.                " For date formate
  LOOP AT i_a090 INTO wa_a090.
    CONCATENATE wa_a090-datbi+6(2) wa_a090-datbi+4(2) wa_a090-datbi+0(4)
    INTO w_date1 SEPARATED BY '/'.
    CONCATENATE wa_a090-datab+6(2) wa_a090-datab+4(2) wa_a090-datab+0(4)
    INTO w_date2 SEPARATED BY '/'.
    wa_output-kschl = wa_a090-kschl.
    wa_output-vbeln = wa_a090-vbeln.
    wa_output-posnr = wa_a090-posnr.
    wa_output-matnr = wa_a090-matnr.
    wa_output-datbi = w_date1.
    wa_output-datab = w_date2.
    READ TABLE i_mara INTO wa_mara WITH KEY matnr = wa_a090-matnr.
    IF sy-subrc EQ 0.
      wa_output-matkl = wa_mara-matkl.
    ENDIF.
    READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_a090-matnr.
    IF sy-subrc EQ 0.
      wa_output-maktx = wa_makt-maktx.
    ENDIF.
    APPEND wa_output TO i_output.
    CLEAR wa_output.
  ENDLOOP.                             " LOOP AT i_a090
  DELETE ADJACENT DUPLICATES FROM i_output COMPARING ALL FIELDS.
  LOOP AT i_output INTO wa_output.
    CONCATENATE wa_output-kschl
                wa_output-vbeln
                wa_output-posnr
                wa_output-matnr
                wa_output-datbi
                wa_output-datab
                wa_output-matkl
                wa_output-maktx
           INTO wa_final-string
           SEPARATED BY ','.
    APPEND wa_final TO i_final.
  ENDLOOP.                             " LOOP AT i_output...
ENDFORM.                               " output_data
*&      Form  header                                                   *
*  Formating the header.                                               *
*  There are no interface parameters to be passed.                     *
FORM header .
  CONCATENATE text-004
              text-005
              text-006
              text-007
              text-008
              text-009
              text-010
              text-011
         INTO wa_final-string
         SEPARATED BY ','.
  INSERT wa_final
  INTO i_final INDEX 1.
  PERFORM f901_output.
ENDFORM.                               " header
*&      Form  f901_output                                              *
*  Downloading the final output table to the presentation server or    *
*  application server.                                                 *
*      -->P_I_OUTPUT  text                                             *
*      -->P_P_PRICE  text                                              *
FORM f901_output .
  IF p_app_p = 'X'.
    PERFORM f903_file_to_presentation
      USING p_price.
  ELSE.
    PERFORM f904_file_to_application
      USING p_price.
  ENDIF.                               " IF p_app_p
ENDFORM.                               " f901_output
*&      Form  f903_file_to_presentation                                *
*  Dowload the file to the presentation server.                        *
*      -->P_P_PRICE  text                                              *
FORM f903_file_to_presentation  USING    p_p_price.
  DATA:
    lwa_file            TYPE string.  "#EC NEEDED     "rlgrap-filename.
  CONCATENATE p_filep p_p_price INTO lwa_file.
*      Download the file
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
*   BIN_FILESIZE                    = BIN_FILESIZE
      filename                        = lwa_file
      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'
*   WK1_N_FORMAT                    = ' '
*   WK1_N_SIZE                      = ' '
*   WK1_T_FORMAT                    = ' '
*   WK1_T_SIZE                      = ' '
* IMPORTING
*   FILELENGTH                      = FILELENGTH
    TABLES
      data_tab                        = i_final
*   FIELDNAMES                      = FIELDNAMES
    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
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.                               " f903_file_to_presentation
regards
twinkal

Similar Messages

  • Problem while exporting ALV column header to excel sheet.

    Hi,
    I am able to export an ALV grid details to an excel sheet. But the ALV column headers when exported to excel sheet are getting truncated.
    For eg: if my column header in ALV grid is displayed as 'Material' then the column header in excel sheet is 'Mater' only. Remaining portion is getting truncated.
    How can I view the entire column header text?
    Kindly assist.
    Thanks.

    I have the same problem with you, when user export to excel. I fixed it by using
    w_layo-colwidth_optimize = 'X'. <<<<<<<<<<<<This
    perform generate_fcat_reftab
        using 'PRUEFLOS' 'T_INPUT' '' '' 'Inspection Lot' 0.
    form generate_fcat_reftab  using    p_fieldname
                                        p_tabname
                                        p_ref_tabname
                                        p_ref_fieldname
                                        p_output_text
                                        p_output_lenght.
      clear w_fcat.
      w_fcat-fieldname = p_fieldname.
      w_fcat-tabname   = p_tabname.
      w_fcat-ref_fieldname = p_ref_fieldname.
      w_fcat-ref_tabname = p_ref_tabname.
      w_fcat-seltext_s = p_output_text.
      w_fcat-seltext_m = p_output_text.
      w_fcat-seltext_l = p_output_text.
      w_fcat-outputlen = p_output_lenght.
      w_fcat-ddictxt = 'L'. <<<<<<<<<<<<<<<<<<This
      append w_fcat to t_fcat.
    endform.

  • KM Docs iView for Excel sheet

    Hi All,
    I have created a KM Document iView for excel sheet and gave the path of excel sheet from KM.
    When I launch the iView, it is opening in a new excel sheet. Is it possible to open the Excel sheet in a browser (html/iView) itself.
    Thanks
    Chinna.

    Chinna,
    Check [this|http://www.mrexcel.com/archive/Hyperlinks/16530.html] out and see if it serves your purpose.
    Cheers!
    Sandeep Tudumu

  • How to download logo and heading in excel sheet.

    Hi ,
    can any one tell me how i will download the logo in the excel sheet by using program.
    Regards,
    Priti shrivastava

    Hope you are comfortable with inserting header in to excel sheet.
    Regarding Logo see the below code snippet:-
    TABLES:
      sflight.
    * header data................................
    DATA :
      header1 LIKE gxxlt_p-text VALUE 'Suresh',
      header2 LIKE gxxlt_p-text VALUE 'Excel sheet'.
    * Internal table for holding the SFLIGHT data
    DATA BEGIN OF t_sflight OCCURS 0.
            INCLUDE STRUCTURE sflight.
    DATA END   OF t_sflight.
    * Internal table for holding the horizontal key.
    DATA BEGIN OF  t_hkey OCCURS 0.
            INCLUDE STRUCTURE gxxlt_h.
    DATA END   OF t_hkey .
    * Internal table for holding the vertical key.
    DATA BEGIN OF t_vkey OCCURS 0.
            INCLUDE STRUCTURE gxxlt_v.
    DATA END   OF t_vkey .
    * Internal table for holding the online text....
    DATA BEGIN OF t_online OCCURS 0.
            INCLUDE STRUCTURE gxxlt_o.
    DATA END   OF t_online.
    * Internal table to hold print text.............
    DATA BEGIN OF t_print OCCURS 0.
            INCLUDE STRUCTURE gxxlt_p.
    DATA END   OF t_print.
    * Internal table to hold SEMA data..............
    DATA BEGIN OF t_sema OCCURS 0.
            INCLUDE STRUCTURE gxxlt_s.
    DATA END   OF t_sema.
    * Retreiving data from sflight.
    SELECT * FROM sflight
             INTO TABLE t_sflight.
    * Text which will be displayed online is declared here....
    t_online-line_no    = '1'.
    t_online-info_name  = 'Created by'.
    t_online-info_value = 'SURESH KUMAR PARVATHANENI'.
    APPEND t_online.
    * Text which will be printed out..........................
    t_print-hf     = 'H'.
    t_print-lcr    = 'L'.
    t_print-line_no = '1'.
    t_print-text   = 'This is the header'.
    APPEND t_print.
    t_print-hf     = 'F'.
    t_print-lcr    = 'C'.
    t_print-line_no = '1'.
    t_print-text   = 'This is the footer'.
    APPEND t_print.
    * Defining the vertical key columns.......
    t_vkey-col_no   = '1'.
    t_vkey-col_name = 'MANDT'.
    APPEND t_vkey.
    t_vkey-col_no   = '2'.
    t_vkey-col_name = 'CARRID'.
    APPEND t_vkey.
    t_vkey-col_no   = '3'.
    t_vkey-col_name = 'CONNID'.
    APPEND t_vkey.
    t_vkey-col_no   = '4'.
    t_vkey-col_name = 'FLDATE'.
    APPEND t_vkey.
    * Header text for the data columns................
    t_hkey-row_no = '1'.
    t_hkey-col_no = 1.
    t_hkey-col_name = 'PRICE'.
    APPEND t_hkey.
    t_hkey-col_no = 2.
    t_hkey-col_name = 'CURRENCY'.
    APPEND t_hkey.
    t_hkey-col_no = 3.
    t_hkey-col_name = 'PLANETYPE'.
    APPEND t_hkey.
    t_hkey-col_no = 4.
    t_hkey-col_name = 'SEATSMAX'.
    APPEND t_hkey.
    t_hkey-col_no = 5.
    t_hkey-col_name = 'SEATSOCC'.
    APPEND t_hkey.
    t_hkey-col_no = 6.
    t_hkey-col_name = 'PAYMENTSUM'.
    APPEND t_hkey.
    * populating the SEMA data..........................
    t_sema-col_no  = 1.
    t_sema-col_typ = 'STR'.
    t_sema-col_ops = 'DFT'.
    APPEND t_sema.
    t_sema-col_no = 2.
    APPEND t_sema.
    t_sema-col_no = 3.
    APPEND t_sema.
    t_sema-col_no = 4.
    APPEND t_sema.
    t_sema-col_no = 5.
    APPEND t_sema.
    t_sema-col_no = 6.
    APPEND t_sema.
    t_sema-col_no = 7.
    APPEND t_sema.
    t_sema-col_no = 8.
    APPEND t_sema.
    t_sema-col_no = 9.
    APPEND t_sema.
    t_sema-col_no = 10.
    t_sema-col_typ = 'NUM'.
    t_sema-col_ops = 'ADD'.
    APPEND t_sema.
    CALL FUNCTION 'XXL_FULL_API'
      EXPORTING
    *   DATA_ENDING_AT          = 54
    *   DATA_STARTING_AT        = 5
       filename                = 'TESTFILE'
       header_1                = header1
       header_2                = header2
       no_dialog               = 'X'
       no_start                = ' '
        n_att_cols              = 6
        n_hrz_keys              = 1
        n_vrt_keys              = 4
       sema_type               = 'X'
    *   SO_TITLE                = ' '
      TABLES
        data                    = t_sflight
        hkey                    = t_hkey
        online_text             = t_online
        print_text              = t_print
        sema                    = t_sema
        vkey                    = t_vkey
    EXCEPTIONS
       cancelled_by_user       = 1
       data_too_big            = 2
       dim_mismatch_data       = 3
       dim_mismatch_sema       = 4
       dim_mismatch_vkey       = 5
       error_in_hkey           = 6
       error_in_sema           = 7
       file_open_error         = 8
       file_write_error        = 9
       inv_data_range          = 10
       inv_winsys              = 11
       inv_xxl                 = 12
       OTHERS                  = 13
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  • FM for excel sheet download

    Is there any function module which can help me download data from an internal table into mutiple sheets on an excel workbook ?
    My internal table contains more than 65536 records.

    Check it out !!
    *& Report  Y_EXCEL_MULTIPLE                                            *
    REPORT  Y_EXCEL_MULTIPLE.
    parameters: p_fname like RLGRAP-FILENAME
                 default 'C:\temp\testNN.xls'.
    data: fname like p_fname,
          kn like sy-repid.
    data: cnt type i value 0.
    data: sheetname(10) value 'TEST ',c_row type i,
          scnt type i,
          val(20), wb(2).
    parameters: p_exvis as checkbox default 'X',
                p_workbk(2) type p default '01',
                p_wsheet(2) type p default '01'.
    CONSTANTS: OK TYPE I VALUE 0.
    INCLUDE OLE2INCL.
    DATA: EXCEL     TYPE OLE2_OBJECT,
          WORKBOOK  TYPE OLE2_OBJECT,
          SHEET     TYPE OLE2_OBJECT,
          CELL      TYPE OLE2_OBJECT,
          CELL1     TYPE OLE2_OBJECT,
          COLUMN    TYPE OLE2_OBJECT,
          RANGE     TYPE OLE2_OBJECT,
          BORDERS   TYPE OLE2_OBJECT,
          button    TYPE OLE2_OBJECT,
          int      TYPE OLE2_OBJECT,
          FONT      TYPE OLE2_OBJECT,
          ROW       TYPE OLE2_OBJECT.
    data: application type ole2_object,
          book        type ole2_object,
          books       type ole2_object.
    data: ole_book    TYPE ole2_object.
    do p_workbk times.
      move p_fname to fname.
      unpack sy-index to wb.
      replace 'NN' with wb into fname.
      perform create_EXCEL.
    create sheets and save
      perform sheet.
      perform save_book.
    enddo.
    write: ' Done'.
          FORM create_excel                                             *
    form create_excel.
      CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
      if sy-subrc ne 0.
         write: / 'No EXCEL creation possible'.
         stop.
      endif.
      set property of EXCEL 'DisplayAlerts' = 0.
      CALL METHOD  OF EXCEL 'WORKBOOKS' = WORKBOOK .
    Put Excel in background
      if p_exvis eq 'X'.
        SET PROPERTY OF EXCEL 'VISIBLE' = 1.
      else.
        SET PROPERTY OF EXCEL 'VISIBLE' = 0.
      endif.
    Create worksheet
      set property of excel 'SheetsInNewWorkbook' = 1.
      call method of workbook   'ADD'.
    endform.
          FORM save_book                                                *
    form save_book.
      get property of excel 'ActiveSheet' = sheet.
      free object sheet.
      free object workbook.
      GET PROPERTY OF EXCEL 'ActiveWorkbook' = WORKBOOK.
      call method of workbook 'SAVEAS' exporting #1 = p_fname #2 = 1.
      call method of workbook 'CLOSE'.
      call method of excel 'QUIT'.
      free object sheet.
      free object workbook.
      free object excel.
    endform.
          FORM sheet                                                    *
    form sheet.
      do p_wsheet times.
        unpack sy-index to sheetname+5(2).
        if sy-index gt 1.
          CALL METHOD  OF EXCEL 'WORKSHEETS' = sheet.
          call method of sheet  'ADD'.
          free object sheet.
        endif.
        scnt = sy-index.
        call method  of excel     'WORKSHEETS' = SHEET EXPORTING #1 = scnt.
        call method  of sheet     'ACTIVATE'.
        SET PROPERTY OF SHEET     'NAME'       = sheetname.
        free object sheet.   "OK
        perform fill_sheet.
        CALL METHOD OF EXCEL 'Columns' = COLUMN.
        CALL METHOD OF COLUMN 'Autofit'.
        free object COLUMN.
       call method of sheet 'BUTTON' = button.
       call method of button 'ADD'.
       set property of button 'fmButtonStyle' = 0.
         exporting #1 = '96.75' #2 = '372' #3 = '123.75' #4 = '12'.
       set property of button 'Characters' = 'ButtonTest'.
        free object button.
        free object font.
        free object int.
        free object cell.
        free object: cell1.
        free object range.
        free object borders.
        free object: column, row.
      enddo.
      free object font.
      free object int.
      free object cell.
      free object cell1.
      free object range.
      free object borders.
      free object column.
      free object row.
      free object sheet.
    endform.
          FORM border                                                   *
    -->  we                                                            *
    form border using we.
    *left
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
      set property of borders 'LineStyle' = '1'.
      set property of borders 'WEIGHT' = we.                    "4=max
      free object borders.
    right
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
      set property of borders 'LineStyle' = '2'.
      set property of borders 'WEIGHT' = we.
      free object borders.
    top
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
      set property of borders 'LineStyle' = '3'.
      set property of borders 'WEIGHT' = we.
      free object borders.
    bottom
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
      set property of borders 'LineStyle' = '4'.
      set property of borders 'WEIGHT' = we.
       set property of borders 'ColorIndex' = 'xlAutomatic'.
      free object borders.
    endform.
          FORM border2                                                  *
    -->  we                                                            *
    form border2 using we.
    *left
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
      set property of borders 'LineStyle' = '5'.
      set property of borders 'WEIGHT' = we.                    "4=max
      free object borders.
    right
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
      set property of borders 'LineStyle' = '6'.
      set property of borders 'WEIGHT' = we.
      free object borders.
    top
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
      set property of borders 'LineStyle' = '7'.
      set property of borders 'WEIGHT' = we.
      free object borders.
    bottom
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
      set property of borders 'LineStyle' = '8'.
      set property of borders 'WEIGHT' = we.
       set property of borders 'ColorIndex' = 'xlAutomatic'.
      free object borders.
    endform.
          FORM border3                                                  *
    -->  we                                                            *
    form border3 using we.
    *left
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '1'.
      set property of borders 'LineStyle' = '9'.
      set property of borders 'WEIGHT' = we.                    "4=max
      free object borders.
    right
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '2'.
      set property of borders 'LineStyle' = '10'.
      set property of borders 'WEIGHT' = we.
      free object borders.
    top
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '3'.
      set property of borders 'LineStyle' = '11'.
      set property of borders 'WEIGHT' = we.
      free object borders.
    bottom
      call method of CELL 'BORDERS' = BORDERS exporting #1 = '4'.
      set property of borders 'LineStyle' = '12'.
      set property of borders 'WEIGHT' = we.
       set property of borders 'ColorIndex' = 'xlAutomatic'.
      free object borders.
    endform.
          FORM fill_cell                                                *
    -->  color                                                         *
    -->  pattern                                                       *
    form fill_cell using color pattern.
      call method of cell 'INTERIOR' = int.
      set property of int 'ColorIndex' = color.
      set property of int 'Pattern' = pattern.
      free object int.
    endform.
          FORM font                                                     *
    -->  bold                                                          *
    -->  size                                                          *
    form font using bold size.
      call method  of CELL 'FONT' = font.
      set property of font 'BOLD' = bold.
      set property of font 'SIZE' = size.
      free object font.
    endform.
          FORM fill_sheet                                               *
    form fill_sheet.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'A1'.
      perform font          using 1 '14'.
      SET PROPERTY OF CELL    'VALUE' = 'Counter'.
      perform fill_cell     using '15' '1'.
      perform border        using '2'.
      free object cell.
      val = 'Workbook-Count'.
      move wb to val+16.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'B1'.
      SET PROPERTY OF CELL    'VALUE' = val.
      perform fill_cell using '14' '1'.
      perform border using '4'.
      free object cell.
      val = 'Sheet-Count'.
      unpack sy-index to val+12.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'C1'.
      SET PROPERTY OF CELL    'VALUE' = val.
      perform fill_cell using '12' '1'.
      perform border using '4'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'E3'.
      perform border        using '1'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'E5'.
      perform border        using '2'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'E7'.
      perform border        using '3'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'E9'.
      perform border        using '4'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'F3'.
      perform border2       using '1'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'F5'.
      perform border2       using '2'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'F7'.
      perform border2       using '3'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'F9'.
      perform border2       using '4'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'G3'.
      perform border3       using '1'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'G5'.
      perform border3       using '2'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'G7'.
      perform border3       using '3'.
      free object cell.
      CALL METHOD  OF EXCEL   'RANGE' = CELL EXPORTING #1 = 'G9'.
      perform border3       using '4'.
      free object cell.
      val = 'ROW-Count'.
      do 19 times.
        c_row = sy-index + 1.
        unpack c_row to val+12(4).
        CALL METHOD  OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 2.
        SET PROPERTY OF CELL1    'VALUE' = val.
        free object cell1.
        CALL METHOD  OF excel 'CELLS' = CELL1 EXPORTING #1 = c_row #2 = 4.
        SET PROPERTY OF CELL1    'VALUE' = val.
        free object cell1.
      enddo.
    endform.
    You find SAP OLE programs under development Class 'SOLE'             *
    MSTAPPL  Table Maintenance APPL                                     *
    RSOLEDOC Document list                                              *
    RSOLEIN0 OLE Load Type Information                                  *
    RSOLEINT Type Info Loaded                                           *
    RSOLETI0 OLE Object Browser                                         *
    RSOLETI1 OLE Object Browser                                         *
    RSOLETI2 OLE Object Browser                                         *
    RSOLETI3 F4 Help For OLE Objects                                    *
    RSOLETT1 OLE 2.0 Automation Demo Program                            *
    Transactions:                                                        *
    SOLE                                                                 *
    SOLO  - List of OLE applcations with loaded type info                *
    You will find the decription of possible objects and methods in the  *
    windows help file for excel.                                         *
    Hope this’ll give you idea!!
    <b>P.S award the points.!!! !!!</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • Header in EXCEL Sheet

    Hi all,
    I'm trying to download the file into excel sheet getting data into excel but header is missing in SAP4.7 version , when i check my code in ECC6.0 then the header is coming. Below is my code.
    TYPES: BEGIN OF it_int,
            sales(3) TYPE n,
            name(30) TYPE c,
           END OF it_int.
    DATA: t_int TYPE STANDARD TABLE OF it_int,
          fs_int TYPE it_int.
    DATA:
      BEGIN OF t_header  OCCURS 0,
        header(50) TYPE c,
      END OF t_header.
    fs_int-sales = 001.
    fs_int-name = 'Urea'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    fs_int-sales = 002.
    fs_int-name = 'Ammonia'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    t_header-header = 'Sales'.
    APPEND t_header.
    t_header-header = 'ItemName'.
    APPEND t_header.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      filename  =
      'C:\SAELS.xls'
         filetype= 'ASC'
         append  = 'X'
         write_field_separator = 'X'
        TABLES
          data_tab   = t_int
          fieldnames = t_header.
    What needs to be done to get header in SAP4.7 version ?
    Thanks in Advance.
    Regards
    VENk@

    Hi Venkat reddy,
    <li>Try this way .I tried to change your program. it works
    REPORT ztest.
    TYPES: BEGIN OF it_int,
            sales(3) TYPE n,
            name(30) TYPE c,
           END OF it_int.
    DATA: t_int TYPE STANDARD TABLE OF it_int,
          fs_int TYPE it_int.
    DATA:BEGIN OF t_header OCCURS 0,
            field1(50) TYPE c,
            field2(50) TYPE c,
         END OF t_header.
    fs_int-sales = 001.
    fs_int-name = 'Urea'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    fs_int-sales = 002.
    fs_int-name = 'Ammonia'.
    APPEND fs_int TO t_int.
    CLEAR fs_int.
    t_header-field1 = 'Sales'.
    t_header-field2 = 'ItemName'.
    APPEND t_header.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = 'C:\SAELS.xls'
        filetype              = 'ASC'
    *    append                = 'X'
        write_field_separator = 'X'
      TABLES
        data_tab              = t_header.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename              = 'C:\SAELS.xls'
        filetype              = 'ASC'
        append                = 'X'
        write_field_separator = 'X'
      TABLES
        data_tab              = t_int.
    Thanks
    Venkat.O

  • Code for excel sheets

    Hi,
    This is Employee Survey Application.
    Environment:Java,Servlets,HTML,Windows2000,Oracle.
    Our problem is ,we could able generate Reports from database to EXCEL sheet format.
    We have prepared database to HTML reports.
    Our client requirement is to generate Excel format reports.
    I want java code for genrating Excel reports from database(oracle) and How to run this xsl reports.

    Hi,
    you can use the HSSF component of the jakarta POI API (http://jakarta.apache.org/poi/index.html)
    Hi,
    This is Employee Survey Application.
    Environment:Java,Servlets,HTML,Windows2000,Oracle.
    Our problem is ,we could able generate Reports from
    database to EXCEL sheet format.
    We have prepared database to HTML reports.
    Our client requirement is to generate Excel format
    reports.
    I want java code for genrating Excel reports from
    database(oracle) and How to run this xsl reports.

  • Data Writing Speed for Excel Sheet while taking data from PCI DAQ card

    Dear All,
              I am taking the data form the card EX-92026 pci card and writing those datas into the Excel sheet, now i want the data at the speed of max of 10 miliseconds but while writing the data into excel sheet, it shows the diff of 15 ms betn 2 readings, and the card specs says it takes the time of 500 microsecs to give the data, so is there any effect of timing, while writing data into excel sheet? is labview take more time, i am using the Open file, write file and close file method and write to spreadsheet file method, but none of them is giving me the effective timing that i wamt, so can u tell me how can i reduce it??????
    Thanks,
    Nishant

    Hi Nishant:
    I think I don't understand you very well. If you are using OpenFile, CloseFile and WriteToSpreadsheet VIs, you are not dealing with excel files, but text files.
    Writing to file is costly in time. You can:
    Open the file just once and
    during de process use just file writing VIs as 'write to spreadsheet'... or a more simple one 'write file'
    Close the file once at the end.
    If you need the process to be faster, you can save all the data at 10ms rate in an array and write to file at the end.
    Or write to file every second what you got the last second.
    Hope it helps
    Aitortxo.
    Aitortxo.

  • Display header for excel output using FM GUI_DOWNLOAD

    Good morning experts,
                     I've been exporting my output in excel using the FM GUI_DOWNLOAD.  The problem is, my header is not displaying.  Kindly check what I've done wrong.  Below is how I declared my header.
    DATA: BEGIN OF header OCCURS 0,
            head1(15),
            head2(15),
          END OF header.
    *&      FORM USER_COMMAND
          COMMAND for ALV Grid Buttons
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    PERFORM write_header.
    CASE r_ucomm.
      WHEN 'XCEL'.
        CONCATENATE: 'C:\' fname sy-datum INTO fname.
        CONCATENATE: fname '.XLS' INTO FILENAME.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME = FILENAME
            WRITE_FIELD_SEPARATOR = 'X'
          TABLES
            DATA_TAB = jtab
            FIELDNAMES = header
          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.
          ELSEIF sy-subrc = 0.
            MESSAGE S000(38) WITH 'File ' fname 'saved in Drive C.'.
          ENDIF.
    ENDCASE.
    ENDFORM.
    *&      Form  write_header
          text
    -->  p1        text
    <--  p2        text
    FORM write_header.
    DATA: ctr(2) TYPE p.
    DO 6 TIMES.
      ADD 1 TO ctr.
      CASE ctr.
        WHEN 1. header-head1 = 'EMPLOYEE'.
                header-head2 = '   NO   '.
        WHEN 2. header-head1 = 'EMPLOYEE'.
                header-head2 = '  NAME  '.
        WHEN 3. header-head1 = 'LOAN'.
                header-head2 = 'TYPE'.
        WHEN 4. header-head1 = 'APPROVAL'.
                header-head2 = '  DATE  '.
        WHEN 5. header-head1 = 'LOAN'.
                header-head2 = 'CODE'.
        WHEN 6. header-head1 = '   MONTHLY  '.
                header-head2 = 'AMORTIZATION'.
      ENDCASE.
      APPEND header.
      CLEAR: header.
    Please help me.  All helpful advice will be rewarded points.  Thanks a lot.

    Follow this Example. You can do it in the below manner
    You need not add HEADER1 HEADER2 to the internal table. You can just declare one field like below and append all the header columns to the internal table HEADER
    data : begin of IT_HEADING occurs 0,
             TEXT(15),
           end of IT_HEADING.
        IT_HEADING-TEXT = 'Company Code'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Number'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Line Item'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Number'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Line Item'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Quantity'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Unit'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Amount'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'PO Currency'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'Job Number'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Quantity'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Unit'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Amount'.
        append IT_HEADING.
        IT_HEADING-TEXT = 'SO Currency'.
        append IT_HEADING.
        move P_FNAME to L_FNAME.
        call function 'GUI_DOWNLOAD'
          exporting
            FILENAME                = L_FNAME
            FILETYPE                = 'DAT'
          tables
            DATA_TAB                = IT_FINAL
            FIELDNAMES              = IT_HEADING
          exceptions
            FILE_WRITE_ERROR        = 1
            NO_BATCH                = 2
            GUI_REFUSE_FILETRANSFER = 3
            INVALID_TYPE            = 4
            NO_AUTHORITY            = 5
            UNKNOWN_ERROR           = 6
            HEADER_NOT_ALLOWED      = 7
            SEPARATOR_NOT_ALLOWED   = 8
            FILESIZE_NOT_ALLOWED    = 9
            HEADER_TOO_LONG         = 10
            DP_ERROR_CREATE         = 11
            DP_ERROR_SEND           = 12
            DP_ERROR_WRITE          = 13
            UNKNOWN_DP_ERROR        = 14
            ACCESS_DENIED           = 15
            DP_OUT_OF_MEMORY        = 16
            DISK_FULL               = 17
            DP_TIMEOUT              = 18
            FILE_NOT_FOUND          = 19
            DATAPROVIDER_EXCEPTION  = 20
            CONTROL_FLUSH_ERROR     = 21
            others                  = 22.
        if SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        endif.
    Regards
    Gopi

  • Report header on Excel Sheet

    Hi to all there,
    I am generatating my report output in excel format,
    I am getting the records but my report header is not coming on Excel.
    I have developed this report using reports6i.
    can anybody help me.
    Thanks in advance
    Manvar

    its not the "layout model" which defines the XML structure but it is the "Data Model", if you include your parameters / variables in one query in data model, you can find the information in the output XML ..
    Hope this helps..

  • Heading line in excel sheet.

    Hi Experts,
               I am working in R/3 4.7 system. I am populating an excel sheet with values from an internal table. Now I want to include a row for heading in the beginning of the excel
    sheet. In ECC 6.0 there is a parameter in GUI_DOWNLOAD for heading. But it is not available
    in 4.7 system. How should i proceed?
    Thanks in advance.

    Hi,
    Refer Below code
    *&      Form  down_desktop_file
          text
    -->  p1        text
    <--  p2        text
    FORM down_desktop_file .
    *--Local Variables
      DATA : l_file   TYPE string.
      SELECT * FROM zsd_ra
          INTO TABLE it_sd_ra.
    *-- for Heading in excel sheet
      st_head-name = text-031.
      APPEND st_head TO it_head.
      st_head-name = text-032.
      APPEND st_head TO it_head.
      st_head-name = text-033.
      APPEND st_head TO it_head.
      st_head-name = text-034.
      APPEND st_head TO it_head.
      st_head-name = text-035.
      APPEND st_head TO it_head.
      st_head-name = text-036.
      APPEND st_head TO it_head.
      st_head-name = text-037.
      APPEND st_head TO it_head.
      st_head-name = text-038.
      APPEND st_head TO it_head.
      LOOP AT it_sd_ra INTO st_ra1.
        st_data-gjahr               = st_ra1-gjahr.
        MOVE st_ra1-monat TO st_data-monat.
        st_data-zzprojectid         = st_ra1-zzprojectid.
        st_data-zwbs                = st_ra1-zwbs.
        st_data-zeac_amount         = st_ra1-zeac_amount.
        st_data-zlabor             = st_ra1-zlabor.
        st_data-zmaterial           = st_ra1-zmaterial.
        st_data-zohead              = st_ra1-zohead.
        APPEND st_data TO it_data.
        CLEAR: st_ra1,
               st_data.
      ENDLOOP.
    Down load TAB delimited file
      l_file = p_filep.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_file
          filetype                = 'ASC'
          write_field_separator   = c_chk
        TABLES
          data_tab                = it_data
          fieldnames              = it_head
        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 i368(00) WITH 'Error writing file'(m03)  l_file.
      ELSE.
        WRITE:/ 'file downloaded',  l_file.
      ENDIF.
    ENDFORM.                    " down_desktop_file
    Regards,
    Prashant

  • Problem in the downloading the excel sheet.

    hi i am using the following code,i am getting the data into internal table,but it is not comming in to excel sheel can any body tell why the data is not comming,
    it_head is the table for headers.
    report ztest1.
    TABLES: EKKO.
    *PARAMETERS : P_EBELN TYPE EBELN.
    SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN OBLIGATORY.
    TYPES: BEGIN OF T_PO,
             EBELN TYPE EBELN,
           END OF T_PO.
    DATA: IT_PO TYPE STANDARD TABLE OF T_PO,
          WA_PO TYPE T_PO.
    DATA : IT_ITEMS TYPE TABLE OF BAPIEKPO WITH HEADER LINE.
    DATA: PO_ITEMS_SHEDULE TYPE TABLE OF BAPIEKET WITH HEADER LINE.
    DATA: PO_ITEM_TEXT TYPE TABLE OF BAPIEKPOTX WITH HEADER LINE.
    DATA: PO_ITEM_ACCOUNT_ASSIGNMENT TYPE TABLE OF BAPIEKKN
    WITH HEADER LINE.
    DATA: PO_HEADER_TEXTS TYPE TABLE OF BAPIEKKOTX WITH HEADER LINE.
    DATA: PO_HEADER TYPE BAPIEKKOL.
    DATA: RETURN1 TYPE TABLE OF BAPIRETURN WITH HEADER LINE.
    SELECT EBELN INTO TABLE IT_PO FROM EKKO WHERE EBELN IN S_EBELN.
    PERFORM DOWNLOAD_DATA: TABLES IT_ITEMS USING SPACE 'BAPIEKPO'.
    LOOP AT IT_PO INTO WA_PO.
      CLEAR: PO_HEADER_TEXTS[], IT_ITEMS[], PO_ITEM_ACCOUNT_ASSIGNMENT[],
             PO_ITEMS_SHEDULE[], PO_ITEM_TEXT[], RETURN1[].
      CALL FUNCTION 'BAPI_PO_GETDETAIL'
        EXPORTING
          PURCHASEORDER              = WA_PO-EBELN
          ITEMS                      = 'X'
          ACCOUNT_ASSIGNMENT         = 'X'
          SCHEDULES                  = ' '
          HISTORY                    = 'X'
          ITEM_TEXTS                 = 'X'
          HEADER_TEXTS               = 'X'
        TABLES
          PO_HEADER_TEXTS            = PO_HEADER_TEXTS
          PO_ITEMS                   = IT_ITEMS
          PO_ITEM_ACCOUNT_ASSIGNMENT = PO_ITEM_ACCOUNT_ASSIGNMENT
          PO_ITEM_SCHEDULES          = PO_ITEMS_SHEDULE
          PO_ITEM_TEXTS              = PO_ITEM_TEXT
          RETURN                     = RETURN1.
      PERFORM DOWNLOAD_DATA: TABLES PO_HEADER_TEXTS USING 'X' 'BAPIEKKOTX',
                             TABLES IT_ITEMS USING 'X' 'BAPIEKPO',
                             TABLES PO_ITEM_ACCOUNT_ASSIGNMENT USING 'X'
      'BAPIEKKN',
                             TABLES PO_ITEMS_SHEDULE USING 'X' 'BAPIEKET',
                             TABLES PO_ITEM_TEXT USING 'X' 'BAPIEKPOTX'.
    ENDLOOP.
    *&      Form  DOWNLOAD_DATA
    FORM DOWNLOAD_DATA  TABLES   IT_TAB
                        USING    P_APP
                                 STRUC_NAME.
      DATA: IT_DD03P TYPE TABLE OF DD03P WITH HEADER LINE,
            IT_DD03P1 TYPE TABLE OF DD03P WITH HEADER LINE.
      TYPES: BEGIN OF T_HEAD,
               TEXT TYPE AS4TEXT,
             END OF T_HEAD.
      DATA: IT_HEAD TYPE TABLE OF T_HEAD.
      IF NOT IT_TAB[] IS INITIAL.
        CALL FUNCTION 'DD_GET_DD03P_ALL'
          EXPORTING
            TABNAME       = STRUC_NAME
          TABLES
            A_DD03P_TAB   = IT_DD03P
            N_DD03P_TAB   = IT_DD03P1
          EXCEPTIONS
            ILLEGAL_VALUE = 1
            OTHERS        = 2.
        IF SY-SUBRC EQ 0.
          LOOP AT IT_DD03P.
            APPEND IT_DD03P-DDTEXT TO IT_HEAD.
          ENDLOOP.
        ENDIF.
      ENDIF.
    break-point.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                = 'C:\poextract.xls'
          APPEND                  = P_APP
          WRITE_FIELD_SEPARATOR   = 'X'
        TABLES
          DATA_TAB                = IT_TAB
          FIELDNAMES              = IT_HEAD
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DOWNLOAD_DATA

    HI HILEMEN,
    in 4.7 we have option to download the data ,like this
    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'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      tables
        data_tab                        =
      FIELDNAMES                      =
    any how i need the filed names in the header ,in excel sheet i need column heading but it is not comming can any body tell.

  • Alv output splitting into two rows when converting into excel sheet.

    Hi frends,
    I have alv report with 60 fields . The report output is coming currently .  But when i am exporting into excel sheet from the option local file--> speadsheet  each row is splitting into two rows including header in excel sheet.
    Please provide your valuable suggestions to avoid this.
    Regards,
    Ramu .
    Edited by: Ramu.K on Sep 8, 2009 5:59 PM

    Hi,
    Please use the grid option and with the Spreadsheet button (CntrShiftF7). Do  "Save as" and save it as excel. It should work.
    Regards,
    Pradyumna

  • SSRS/Powerview to compare SQL table and excel sheet

    I have a SQL table and an excel sheet with some data...
    I want to be able to compare the two and find out which Excel rows are missing in the SQL table...
    Would it be easier to do this report in SSRS or would it be better to do it in Excel PowerView?
    If so how do I go about it?
    Thanks in advance for your help...
    Dhananjay Rele

    Hi Dhananjay,
    According to your description, you want to compare the data of a SQL table and an excel sheet. To achieve this goal, we can create two tables in Reporting Services report, one for SQL table with SQL Server connection type, another for excel sheet with ODBC
    connection type.
    For more details about how to create the report, please see the following steps:
    Create a report server project with SQL Server Data Tools (SSDT) Business Intelligence Templates list.
    Create a new report definition file in Solution Explorer.
    Create a Data Source named DataSource1 with Microsoft SQL Server Type, then select the SQL table database from the corresponding server.
    Create a Data Source named DataSource2 with ODBC Type, then select the excel file.
    Create two datasets which returns the SQL data and Excel sheet data based on the two data source, one for DataSource1, another for DataSource2.
    Create two table next to each other based on the datasets on the design surface.
    References:
    Create a Basic Table Report (SSRS Tutorial)
    Create SSRS report using Excel Data Source Step by Step
    If there are any other questions, please feel free to ask.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Populate and header for an excel sheet in SALV

    Hi,
    I want to download an excel sheet with header in SALV.
    Please let me know how to do that.
    Thanks & Regards
    Santhosh

    Hi,
    I’m not sure if I understand your question correctly, so please correct me if I have any misunderstandings.
    For the defined names, I assume you mean the named range. If so, you can create the binding to the named range through
    Bindings.addFromNamedItemAsync method.
    For the styles, I think the article below may give you some help.
    How to: Format tables in apps for Excel
    By the way, there are no methods to iterate the styles and named range through the current Office JavaScript API.
    If this is a feature you want to include in future versions of Office JavaScript API, please submit a feedback to
    Office Development Platform User Voice.
    Regards,
    Jeffrey
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Trying to understand the MODEL clause

    Hi All, I'm finally biting the bullet and learning how to use the model clause, but I'm having a bit of trouble. The following example data comes from a book "Advanced CQL Functions in Oracle 10g". with sales1 as (select 'blueberries' product        

  • White Lines/ Foreign Patterns in Fonts only  while Playing

    Vram in use 64K, Keynote 2.0.2 Does anyone know how to correct this problem? It seems that whenever i play the slide presentation white lines are running through the entire slides and foreign patterns appear in the fonts. i have changed the display,

  • Hi, i've accidentally deleted my imessage, how can i reinstall it?

    Hi, i've accidentally deleted my imessage, how can i reinstall it?

  • Open & Save Dialog Window Location

    It's a hard one to give a name to, that's why I can't seem to find it on a search. Basically, I'm wondering if anyone knows of a way to get the "save dialog" to not sit over the top of a program when it comes up. Best example is MS Word 2008 (mac) -

  • Erroneous, derogatory credit report

    I have been a longstanding, loyal, and very consistent Verizon Wireless customer for over 10 years.  In all the years I have been a Verizon Wireless customer, I have ALWAYS paid my bill on time, every month.  In early 2011, I went through a divorce &