Home > Default > Heading line in excel sheet.

Heading line in excel sheet.

October 11Hits:0
Advertisement
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.

Answers

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

Read other 5 answers

Tags:

Related Articles

  • Mutiple lines in Excel sheet.October 11

    Hi Experts, In my excel sheet I have 400 characters text is there for a single field. I tried by using FM ALSM_EXCEL_TO_INTERNAL_TABLE and TEXT_CONVERT_XLS_TO_SAP but the filds here is only 45, and 250 characters only. How to upload taht 400 characte

  • Printer does not print all grid lines of EXCEL sheetNovember 30

    Running Micrsoft Vista.  When printing an EXCEL sheet that has gride lines, the ENVY 5530 printer only prints some of the lines.Hello , and welcome to the HP Forums! I see you're having issues printing from Excel.  I would like to help! Do you have

  • How to add a header line to excel sheet?November 30

    Hi Guru's I have download the scheduling agreement report in a excel sheet, I want to know how to add the header line  to that excel sheet.Hi See this sample code: Tables : zacg_cca,zacg_exsh. data: P_file like RLGRAP-FILENAME. Data: Begin of it_head

  • Heading line in excel sheet.October 11

    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

  • Grid lines on excel sheetNovember 30

    HP Officejet j4550 All-In-One does not print all of the grid lines on my excel document. I have downloaded driver and updates with no results. I am on Windows 7 32 bit. What's next???Hi - Do you see the gridlines in print preview?  If not, it is most

  • Add header line to excel sheet when using FM RH_START_EXCEL_WITH_DATANovember 30

    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

  • Download into excel sheetOctober 11

    Hi All, In a ALV report, i would like to donwload the final internal table into an excel sheet. The requirement is that the data should be filled from 8th row of excel sheet. I am using GUI_DOWNLOAD and it makes the data to dump from first line of ex

  • How to send mail attachment excel sheet correctlyNovember 30

    Hi, I  am working one program and there the out put should be sent in mail attachment in excel sheet. I have used one Function module SO_DOCUMENT_SEND_API1. I am able to send the output data mail attachment excel sheet. But one problem I am facing th

  • Alv output download to excel sheet spliting into three lineOctober 11

    hi, i have developed alv report with 62 fields (62 colums).when i download this output into excel sheet each line spliting into three line.each field has 20 char length.i want download each row as single line. i am using local file  (ctrl + shift+F9)

  • Unable to download the data perfectly into excel sheetOctober 11

    Hi Frnds, when i am trying to download the data from the output of a report into excel, some of the records(line items/rows) are getting stored in one of column of the excel sheet. Fog eg: my report outputs 500 line items. In excel after 100 rows the

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.484 s.