I want to download a report into Excel sheet with color Heading..Is it Poss

Hi All
I want to download error records into Excel sheet with color Heading..Is it Possible to download into excel with Color Heading?
here i am <b>using the 3 sheets in one</b>
t_error-bkpf -> Sheet1
t_error-bseg-> sheet 2
t-error-bsec -> sheet3.
Rgds
Raghav

<b>The following thread has the code which will put data into multiple sheets</b>
Download to multiple sheets in Excel
FOR COLOR LOGIC  JUST REFER THIS PROGRAM
*& Report  ZNEGI17                                                     *
REPORT  ZNEGI17  NO STANDARD PAGE HEADING.
* this report demonstrates how to send some ABAP data to an
* EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
* handles for OLE objects
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
TABLES: SPFLI.
DATA H TYPE I.
* table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
* read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
* display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
* display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
* start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
* PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
* CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:kis_excel.xls'
* PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 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.
* tell user what is going on
* CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
* EXPORTING
** PERCENTAGE = 0
* TEXT = TEXT-009
* EXCEPTIONS
* OTHERS = 1.
* output column headings to active Excel sheet
PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
* copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
* changes by Kishore - start
* CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #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'.
* CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
* EXPORTING
** PERCENTAGE = 0
* TEXT = TEXT-009
* EXCEPTIONS
* OTHERS = 1.
* output column headings to active Excel sheet
PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
* copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
* changes by Kishore - end
* disconnect from Excel
* CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
* FORM FILL_CELL *
* sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL1 USING I J BOLD VAL.
data : color(5) type x value 'H80000008'.
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 'ColorIndex' = 3 .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
* outputs OLE error if any *
* --> p1 text
* <-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
*&      Form  FILL_CELL1
*       text
*      -->P_H  text
*      -->P_1      text
*      -->P_0      text
*      -->P_IT_SPFLI_CARRID  text
form FILL_CELL  using   I J BOLD 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.
endform.                    " FILL_CELL1
kishan negi

Similar Messages

  • Download internal table data into excel sheet with column heading and data

    Hi,
      I am having one internal table with column headings and other table with data.
    i want to download the data with these tables into an excel sheet.
    It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
    Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
    what we have to do for storing the file name in runtime.
    Can anyone help me on this.
    Thanks,
    Rose.

    Hi Camila,
        Try this
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = PATH2
       FILETYPE                        = 'XLS'
      TABLES
        DATA_TAB                        = IT_DATA
       FIELDNAMES                      = IT_HEADINGS
    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

  • Formatting problem in download report into EXCEL Sheet

    I have requirement that the Column in the report have values as 1.50,1.5,3.50,when i'm downloading the report into Excel sheet,The values are rounded and appearing as 1.5,1.5,3.5.
    Can anyone please let me know how to resolve this requirement

    hi,
    1) Excel will not take zero's after decimal(1.50) it will roundup(1.5) the values.
    2) you can do like in formula section use CAST(column_name as CHAR) and download it to excel then u will get the zero i think...i didn't tried
    or Column properties--->Data format --> Select Number--->use 1000's Seperator for 1 decimal and save the report and download it
    but it should work!
    thanks,
    saichand.v
    Edited by: saichand on Oct 27, 2009 4:11 PM
    Edited by: saichand on Oct 27, 2009 4:12 PM

  • Download ALV report to excel sheet

    halo fellow SAPiens,
    i want to download my alv report into excel sheet...........for tht i used UGI_DOWNLOAD........here if i use the file type as 'ASC' all the leading zeros of numeric values are removed and date format is "yyyy/mm/dd".......
    i need the leading zeros and date format in "dd/mmyyy"
    when i use file type 'DBF' i get the leading zeros but my date is replaced by '#####.............wht shld i do...........

    To get the leading zeros to come, append an apostrophe to the start of each field that has the leading zeros as shown
    loop at itab.
    concatenate '''' itab-field1 into itab-field1.
    modify itab.
    endloop.
    note that
    1. This sometimes doesnt show correctly in excel and you may have to double click on the cell to prevent the apostrophe from displaying in the sheet
    2. You field needs to have an extra character to add the apostrophe

  • How export report into excel sheet automatically using SSRS 2010?

    Hi,
    I have created many reports using SQL Server Data Tool 2010 and at my work, we are using active batch to ran reports every month.
    Now question is, my boss want me to set up reports such a way that when active batch is ran, reports should be exported into excel sheet automatically with the default values given for parameters at some specific folder location. How can I export report
    into excel sheet automatically when active batch is executed?
    Please help me on this. Thanks for the help in advance.
    Vicky

    Check this:
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'C:/test.xls'
          filetype                = 'ASC'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_output
    Regards.

  • Dump in prodcution server while downloading ALV report to excel sheet

    HI ALL,
    ALV report is working fine in bother DEV and PROD servers....but in production while downloading report to excel sheet it is going to dump.
    "dump is below:
    Short text
    Field symbol has not yet been assigned.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLKKBL" had to be terminated because it has
        come across a statement that unfortunately cannot be executed. "
    But in development this problem is not there, iam able to download ALV report to EXCEL sheet.
    Any help experts......
    Thanks in advance
    Ram

    Hi,
    I had the same problem,
    Run a consistency check for your ALV and you will find out. See if you havent passed any unnecessary parameter to FM.
    /people/rainer.hbenthal/blog/2009/09/25/sos--my-alv-report-is-not-working
    Dump while printing ALV (field symbol not assigned)
    Sumit

  • How to Convert Report into Excel Sheet when Sending Mail.

    Dear Friends,
    i want to send mail to HOD of Product with an Excel Sheet .
    i want to send Pending Issue details to HOD in Excel Sheet attachment .
    here i have pending issue report now i need to send it in Excel Sheet attachment .
    i have table where i have manage Product ID and HOD OF PRODUCT.
    CREATE TABLE  "MAP_USER_PRODUCT_DTL"
       (     "ID" NUMBER NOT NULL ENABLE,
         "PRODUCT_ID"NUMBER,
         "USER_ID" VARCHAR2(5) NOT NULL ENABLE,
         "HOD_PROD" VARCHAR2(100)========================================Value is Y OR N IF HOD then Y else N
         CONSTRAINT "MAP_USER_PRODUCT_DTL_PK" PRIMARY KEY ("ID") ENABLE
    /i have one more table where all complete issue detail insert.
    CREATE TABLE  "CRM_ISSUE_PROBLEM"
       (     "ID" NUMBER,
         "SUBJECT" VARCHAR2(255) NOT NULL ENABLE,
         "CLIENT_ID" NUMBER,
         "ASSIGNED_TO_ID" VARCHAR2(100),
         "ASSIGNED_ON" DATE,
         "DESCRIPTION" VARCHAR2(4000),
         "PRODUCT_ID" NUMBER NOT NULL ENABLE,
         "STATUS_ID" NUMBER NOT NULL ENABLE,
          CONSTRAINT "CRM_ISSUE_PROBLEM_PK" PRIMARY KEY ("ID") ENABLE
    Here STATUS_ID is Like Pending ISsue,Open Issue and Close Issue .i want to send mail to HOD with Pending Issue Report convert into Excel Sheet and send to HOD?
    How can i do this.
    Thanks
    Edited by: Vedant on Oct 12, 2011 12:36 AM
    Edited by: Vedant on Oct 12, 2011 2:22 AM

    Hello Vedant,
    Would it suffice if you send a CSV file?
    If yes, then see following code.. run the code under APEX > Home > SQL Workshop > SQL Commands
    DECLARE
            ln_id NUMBER;
            lc_clob CLOB;
         lb_blob BLOB;
         li_in PLS_INTEGER := 1;
         li_out PLS_INTEGER := 1;
         li_lang PLS_INTEGER := 0;
         li_warning PLS_INTEGER := 0;
         lv_mail_rcpts VARCHAR2(2000) := '[email protected]';
         lv_mail_from VARCHAR2(100) := '[email protected]';     
           lv_clmn_separator VARCHAR2(1) := ',';
    BEGIN
         -- Build file content as CLOB
      -- Replace with your query
         FOR i IN (select object_id A, object_name B, object_type C, status D, temporary E, generated F, secondary G,namespace H from user_objects where rownum < 10)               
         LOOP
        IF lc_clob IS NULL THEN
          lc_clob := i.A||lv_clmn_separator||i.B||lv_clmn_separator||i.C||lv_clmn_separator||i.D||lv_clmn_separator||i.E||lv_clmn_separator||i.F||lv_clmn_separator||i.G||lv_clmn_separator||i.H;
        ELSE
          lc_clob := lc_clob||CHR(10)||i.A||lv_clmn_separator||i.B||lv_clmn_separator||i.C||lv_clmn_separator||i.D||lv_clmn_separator||i.E||lv_clmn_separator||i.F||lv_clmn_separator||i.G||lv_clmn_separator||i.H;
        END IF;
         END LOOP; 
         -- Convert CLOB to BLOB
         DBMS_LOB.CREATETEMPORARY(lb_blob,TRUE);
         DBMS_LOB.convertToBlob(lb_blob,lc_clob,DBMS_LOB.LOBMAXSIZE,li_in,li_out,DBMS_LOB.DEFAULT_CSID,li_lang,li_warning);
         -- Send mail
         ln_id:= APEX_MAIL.SEND(
           p_to        => lv_mail_rcpts,
                 p_from      => lv_mail_from,
                 p_subj      => 'Subject Goes here',
                 p_body      => 'Body goes here'
           -- add CSV file as attachment
         APEX_MAIL.ADD_ATTACHMENT
           p_mail_id   => ln_id,
           p_attachment => lb_blob,
           p_filename   => 'filename.csv',
           p_mime_type  => 'application/csv'
      -- push mail queue
      APEX_MAIL.PUSH_QUEUE;
         -- empty temporary space
         DBMS_LOB.FREETEMPORARY ( lob_loc =>  lb_blob);       
         COMMIT;
    END;Regards,
    Hari

  • Downloading PO's into excel sheet?

    Hello All!
    I am trying to download the po's into excel sheet through a programm. In this regard i would like to know the procedure for that.
    Presently my plan is to collect all the fields into two internal tables (one for header and another for item data).Now how to append the two internal table into a single itab. I want to use this itab in gui_download funtion module!
    Am i doing right. If i am going wrong plz guide me.
    Mail me to [email protected]
    Regards,
    LN

    hi,
    no need to download the header and data seperately.
    dowload the data only.
    kindly chek the below code.
    here 'v_start_row' is '2', so it avoid the header. if u wants the header make it as '1'.
    v_end_col means the numbers of columns u have
    DATA : int_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA : v_start_col TYPE i VALUE '1',
           v_start_row TYPE i VALUE '2', "only from data row
           v_end_col   TYPE i VALUE '6', "no of columns.
           v_end_row   TYPE i VALUE '1000'.
      PERFORM f_upload.
    *&      Form  f_upload
          text
    -->  p1        text
    <--  p2        text
    FORM f_upload .
      CLEAR : int_excel, int_excel[].
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = wf_filename
          i_begin_col             = v_start_col
          i_begin_row             = v_start_row
          i_end_col               = v_end_col
          i_end_row               = v_end_row
        TABLES
          intern                  = int_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    *Message is 'Unable to upload data from  '  wf_filename.
        MESSAGE e169(zm050) WITH wf_filename.
      ELSE.
        SORT int_excel BY row col.
        REFRESH : record.
        CLEAR   : record.
        LOOP AT int_excel.
          CASE int_excel-col.
            WHEN 1.
              record-wf_mf_zone_code_003  = int_excel-value.
            WHEN 2.
              record-wf_mf_country_code_004 = int_excel-value.
            WHEN 3.
              record-wf_country_code_001 = int_excel-value.
            WHEN 4.
              record-wf_zone_desc_002 = int_excel-value.
            WHEN 5.
              record-wf_loekz = int_excel-value.
          ENDCASE.
          AT END OF row.
            APPEND record.
            CLEAR record.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " f_upload
    hope this helps u.
    if so pls reward points
    regards,
    anversha
    [email protected]

  • Downloading table data into Excel sheet - Webdynpro Java

    Hi All,
    We have developed a custom webdynpro application that executes an RFC and displays data in Table UI element. We have provided a button to download the data in excel sheet. When data is huge like, total number of rows filled up in the table are around 11,000 & columns are 32, and when user tries to download whole 11000 rows in excel sheet, the timeout occurs after 20 mins due to huge data. But when I apply filtering on the same table data and then try to download some 700 rows out of 11000 into excel, it took me around 3.36 mins.
    If anyone encountered such scenario in past, please guide in this regard to speed-up the download to excel functionality or suggest any other alternative.
    We are using 7.3 Portal and tableUtilities java class for export to excel functionality.
    Thanks,
    Amol.

    hi monica ,
    sorry im not able to understand properly ,
    The server don't restarts automatically when we uploading a huge data, onlly we open the file instead of save the file.
    If we save the file the problem is that when we try to open this, the process can take hours and sometimes excel is blocked
    you mean that after saving the file to your desktop , having huge data you are not able to open the file i.e the excel file. your file gets blocked or consumes more time to open the file ,
    or else when you are prompted for saving or opening , on click of opening  you are facing the problem ?
    let me be clear with your part , here your application deals with uploading the data from webdynpro table to excel sheet and allowing the end user to save or open the file  right .
    Regards
    Govardan Raj S

  • Downloading the data into excel sheet , how can i maintain page numbers

    I need some information. In output screen pagenumber is displayed.
    when i am downloading the data from se38 into excel sheet.
    How can i write the code to display the page number in excel sheet . waiting for your response

    Hi
    Please see below code for ur requirement.
    DATA: BEGIN OF li_field OCCURS 0,
              field(16) TYPE c,
           END OF li_field.
      CLEAR li_field[].
      REFRESH li_field.
      li_field-field = text-t01.
      APPEND li_field.
      CLEAR  li_field.
      li_field-field = text-006.
      APPEND li_field.
      CLEAR  li_field.
      li_field-field = text-t04.
      APPEND li_field.
      CLEAR  li_field.
      li_field-field = text-t05.
      APPEND li_field.
      CLEAR  li_field.
      CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
        EXPORTING
          file_name                 = file_path
        TABLES
          data_tab                  = data_table
          fieldnames                = li_field
        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.
    please reward points if helpful

  • Download report into excel sheet

    Hi
    I have  requirement like, in report output I want a button, if I press that button it has to ask where I have to save that output list in excel sheet format.
    Plz help me out
    Thanks in advance
    Regards
    Rao

    Pls do like...
    START-OF-SELECTION.
    * Select and Process the data .
      PERFORM select_and_process_data.
    * Display Records.
      PERFORM display_result.
    * Set the pf-status and user command.
      SET PF-STATUS '110_VAL'.   " create yr button here
    AT USER-COMMAND.
    * Download result to spreadsheet.
      PERFORM download_to_spreadsheet.
    END-OF-SELECTION
    FORM download_to_spreadsheet .
      DATA:
        l_filefilter  TYPE string,
        l_filename    TYPE string,
        l_path        TYPE string,
        l_fullpath    TYPE string,
        l_user_action TYPE i.
      IF sy-ucomm = 'DLOAD'.  " Button name (Function code)
        l_filefilter = 'EXCEL Files (*.XLS)|*.XLS|Text Files (*.TXT)|*.TXT|All files (*.*)|*.*||'.
        CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
          EXPORTING
            file_filter       = l_filefilter
            default_extension = 'xls'
          IMPORTING
            filename          = l_filename
            path              = l_path
            fullpath          = l_fullpath
            user_action       = l_user_action.
        IF l_user_action = 1 OR l_user_action = 0.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename                = l_fullpath
              filetype                = 'ASC'
            TABLES
              data_tab                = o_file
            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.
        ELSEIF l_user_action = 2.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              append                  = 'X'
              filename                = l_fullpath
              filetype                = 'ASC'
              trunc_trailing_blanks   = 'X'
            TABLES
              data_tab                = o_file
            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.
        ENDIF.
      ENDIF.
    ENDFORM.                    " download_to_spreadsheet
    " Note : Give the path according yr requirement.
    Regards,
    RH

  • Download the data into excel sheet

    hello experts,
    I am using the GUI_DOWNLOAD fm to download the data in to excell sheet on to the desktop but here i am getting some problem
    For some of the fields i put constant values like '004' or '001' when it is downloaded the data into to .xls its removing the leading zeros.. and just downloading the values as 4 or 1
    can anyone guide me how to hold those leading zeros
    its bit urgent plz

    These are XL Issue ,you can use diffrenet logic
    Check the below logic :
    REPORT ZTEST3 line-size 400.
    <b>DATA : V_CHAR(1) TYPE C VALUE ''''.</b>
    data : v_field(12) type c.
    data : begin of itab occurs 0,
           fld1(12) type c,
           end of itab.
    start-of-selection.
    v_field = '0000012345'.
    CONCATENATE V_CHAR  V_FIELD  INTO V_FIELD.
    itab-fld1 = v_field.
    append itab.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
        FILENAME                      =
        'C:\Documents and Settings\smaramreddy\Desktop\fff.xls'
       FILETYPE                      = 'ASC'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        DATA_TAB                      = itab
      FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       OTHERS                        = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I have used one field here ,i am not sure for many fields in internal table.
    Thanks
    Seshu

  • Regarding Downloading of Report[List] output into Excel Sheet

    Hi All,
    Hi i have written one Classical report. I got the output Correctly.
    Now i want to download that data into Excel Sheet in excatly the way it displayed in List[Report] output.
    I had followed the path <b>System->List->Save->LocalFile->Spread Sheet</b> and tried to download the same.
    Though it is downloaded it has not come in exact format.
    Now what i want is to add a button above that report & write a program in that to download that data into Excel Sheet.
    Can anybody tell me how can solve this issue. If i follow above procedure will the data[List Output] be downloaded into exact format into excel.
    If anybody knows other way please sujjest.
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hi Prasad,
    I have done a program which downloads the output in the excel sheet in the correct format.
    Just check the program. The code given in bold is what you have to use.
    REPORT zexp MESSAGE-ID f4  LINE-SIZE 195.
        Tables Used    ***********************************
    TABLES : bseg, bkpf, bsak, lfa1, payr .
    Declaring Internal Tables  **************************
    DATA :
    Internal table to hold header data  *************
    BEGIN OF header OCCURS 0,
          ext_date(10) TYPE c,
          delimit(1)   TYPE c,
          ext_time(8)  TYPE c,
    END OF header,
    Internal table to hold detail info  **************
    BEGIN OF i_data OCCURS 0,
        belnr LIKE bsak-belnr,
        gjahr LIKE bsak-gjahr,
        bukrs LIKE bsak-bukrs,
        bldat LIKE bsak-bldat,
        xblnr LIKE bsak-xblnr,
        blart LIKE bsak-blart,
        augdt LIKE bsak-augdt,
        augbl LIKE bsak-augbl,
        wrbtr LIKE bsak-wrbtr,
        shkzg LIKE bsak-shkzg,
        lifnr LIKE bsak-lifnr,
        name1 LIKE lfa1-name1,
        chect LIKE payr-chect,
        status(1) TYPE c,
    END OF i_data,
    Internal table to to collect  *****************
    BEGIN OF i_data1 OCCURS 0,
         belnr LIKE bsak-belnr,
         gjahr LIKE bsak-gjahr,
         bukrs LIKE bsak-bukrs,
         bldat LIKE bsak-bldat,
         xblnr LIKE bsak-xblnr,
         blart LIKE bsak-blart,
         augdt LIKE bsak-augdt,
         augbl LIKE bsak-augbl,
         wrbtr LIKE bsak-wrbtr,
       shkzg LIKE bsak-shkzg,
         lifnr LIKE bsak-lifnr,
         name1 LIKE lfa1-name1,
         sortl LIKE lfa1-sortl,
         chect LIKE payr-chect,
         status(1) TYPE c,
    END OF i_data1,
    String variables for formatting file data *************
        fidoc_year   TYPE string,
        comp_code    TYPE string,
        check_numbr  TYPE string,
        vendor       TYPE string,
        inv_date     TYPE string,
        inv_nbr      TYPE string,
        paid_dat     TYPE string,
        inv_amt      TYPE string,
        status       TYPE string,
        ref_doc      TYPE string,
    ************Internal table to store the file contents **************
    BEGIN OF i_final_file OCCURS 0,
        record(300) TYPE c,
    END OF i_final_file,
    Internal table to store the list of allowed document types ****
      BEGIN OF i_doctype OCCURS 0,
             blart LIKE bsak-blart,
      END OF i_doctype,
    Internal table to hold vendor information ************
      BEGIN OF i_lfa1 OCCURS 0,
         lifnr LIKE lfa1-lifnr,
         name1 LIKE lfa1-name1,
         sortl LIKE lfa1-sortl,
      END OF i_lfa1,
    Internal table to hold check information *************
      BEGIN OF i_payr OCCURS 0,
         chect LIKE payr-chect,
         vblnr LIKE payr-vblnr,
         gjahr LIKE payr-gjahr,
         zbukr LIKE payr-zbukr,
      END OF i_payr.
      Data declarations  **************************
    DATA : ws_stblg     TYPE bkpf-stblg,
           todate       TYPE bsak-augdt,
           fromdate     TYPE bsak-augdt,
           w_day        LIKE dtresr-weekday,
           day          LIKE scal-indicator,
           d            TYPE n,
           e_date       LIKE sy-datum,
           e_time       LIKE sy-uzeit,
           dd(2)        TYPE c,
           mm(2)        TYPE c,
           yy(4)        TYPE c,
           hh(2)        TYPE c,
           min(2)       TYPE c,
           sec(2)       TYPE c.
    DATA : wa_filepath(50)    TYPE c,
           wa_filename(50)    TYPE c,
           wa_c_filename(100) TYPE c,
           arch_path(50)      TYPE c.
    <b>* Data for downloading to list
    DATA : list LIKE TABLE OF abaplist WITH HEADER LINE.
    DATA : BEGIN OF list_asc OCCURS 0,
    msg(300) TYPE c,
    END OF list_asc.
    DATA: BEGIN OF i_invoiceheader OCCURS 0,
    name(30) TYPE c,
    END OF i_invoiceheader.
    RANGES dates FOR bkpf-budat.</b>
      Selection Screen  ************************
    SELECTION-SCREEN SKIP 2.
    SELECT-OPTIONS:
             s_bukrs     FOR  bkpf-bukrs ,
             s_blart     FOR  bkpf-blart ,
             s_augdt     FOR  bsak-augdt. " memory id todat TO fromdat.
    PARAMETERS :submit  AS CHECKBOX DEFAULT ' '  .
    <b>* Download list to file.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'LIST'.
          PERFORM download.
        WHEN 'BACK'.
          EXIT.
      ENDCASE.</b>
    <b>----
          FORM download                                                 *
    FORM download.
    if s_augdt is initial.
    dates-sign = 'I'.
    dates-option = 'BT'.
    dates-low = '20050901'.
    dates-high = '20050920'.
    APPEND dates.
    else.
      dates = s_augdt.
      append dates.
    endif.
    /* Submit the same program .
      SUBMIT zexp WITH s_augdt IN dates
       EXPORTING LIST TO MEMORY
       AND RETURN.
      CALL FUNCTION 'LIST_FROM_MEMORY'
           TABLES
                listobject = list
           EXCEPTIONS
                not_found  = 1.
      CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
    LIST_INDEX = -1 "LIST_INDEX SY-LSIND.
      TABLES
      listasci = list_asc
      listobject = list.
      PERFORM download_file.
    ENDFORM.
          FORM download_file                                            *
    FORM download_file.
      DATA fname TYPE rlgrap-filename VALUE 'c:\audit_report.xls'.
      DATA ftype TYPE rlgrap-filetype VALUE 'DAT'.
      DATA numeric_data(10) TYPE c VALUE '0123456789'.
    *Table structure should match with list output.
      DATA : BEGIN OF i_data1 OCCURS 0,
           belnr(12) TYPE c,
           gjahr(6) TYPE c,
           bukrs(8) TYPE c,
           chect(13) TYPE c,
           lifnr(12) TYPE c,
           name1(37) TYPE c,
           bldat(14) TYPE c,
           xblnr(18) TYPE c,
           augdt(14) TYPE c,
           wrbtr(17) TYPE c,
           status(4) TYPE c,
           augbl(18) TYPE c,
           sortl(17) TYPE c,
       END OF i_data1.
    Header record of the excel sheet.
      PERFORM fill_header.
      LOOP AT list_asc.
    Reads lines starting from the first record in the report. All informatory statements in the report are not read.
        IF list_asc+1(10) CO numeric_data.
          i_data1 = list_asc .
          APPEND i_data1.
        ENDIF.
      ENDLOOP.
    Call the download function.
    CALL FUNCTION 'DOWNLOAD'
           EXPORTING
                filename = fname
                filetype = ftype
           TABLES
                data_tab = i_data1
                FIELDNAMES = i_invoiceheader.
    ENDFORM.
          FORM fill_header                                              *
    FORM fill_header.
      i_invoiceheader-name = 'Doc Number'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Fsc Year'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Cmp Code'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Check No'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Vendor No'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Entered by'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Doc Date'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Ref Doc No'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Clearing Date'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Amount'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Status'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Clearing Doc No'.
      APPEND i_invoiceheader.
      i_invoiceheader-name = 'Sort field'.
      APPEND i_invoiceheader.
    ENDFORM.                    " fill_header</b>
       Initialization   *************************
    INITIALIZATION.
    To initialize the date parameter on the selection screen.
    The date by default ranges from previous Monday to Sunday.
      todate = sy-datum.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
                date = todate
           IMPORTING
                day  = day.
      d = day.
      if d < 4.
        todate = sy-datum - d - 4 .
      else.
        todate = sy-datum - d + 3 .
      endif.
      fromdate = todate - 6.
      MOVE: 'BT'       TO s_augdt-option,
            fromdate   TO s_augdt-low,
            todate     TO s_augdt-high.
      APPEND s_augdt.
    Start of Selection  **************************
    START-OF-SELECTION.
    Checking the validity of the inputted dates ****************
      IF s_augdt-low > sy-datum OR s_augdt-high > sy-datum.
        MESSAGE i999 WITH 'You cannot input future date'.
        EXIT.
      ENDIF.
      IF NOT s_bukrs IS INITIAL.
    MESSAGE i999 WITH 'Program will run with input parameters in screen!!'.
      ENDIF.
    Initialize the header data ***********************
      e_time = sy-uzeit.
      MOVE e_time+0(2) TO hh.
      MOVE e_time+2(2) TO min.
      MOVE e_time+4(2) TO sec.
      CONCATENATE hh min sec INTO header-ext_time SEPARATED BY ':'.
      e_date = sy-datum.
      MOVE e_date+0(4) TO yy.
      MOVE e_date+4(2) TO mm.
      MOVE e_date+6(2) TO dd.
      CONCATENATE mm dd yy INTO header-ext_date SEPARATED BY '/'.
      header-delimit = '~'.
      APPEND header.
    List allowed document types **********************
      PERFORM fill_doc_types.
    **To select the documents within the range of week or as inputted **
      IF s_augdt IS INITIAL.
        MOVE: 'I' TO s_augdt-sign,
              'BT'       TO s_augdt-option,
              fromdate   TO s_augdt-low,
              todate     TO s_augdt-high.
        APPEND s_augdt.
      ENDIF.
    Selecting the records from the database ****************
      IF s_bukrs IS INITIAL AND s_blart IS INITIAL.
      Select all documents of company code 1000, *********
      4200 and 8000, and allowed document types  *********
        SELECT belnr gjahr augdt augbl bukrs
            blart bldat xblnr lifnr wrbtr shkzg
            FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
            FOR ALL ENTRIES IN i_doctype
            WHERE blart EQ i_doctype-blart
            AND augdt IN s_augdt
            AND ( bukrs = '1000' OR bukrs ='4200'  OR
                ( bukrs = '8000' AND blart NE 'ZP' ) ).
       loop at i_data.
    Exclude reversed documents
          select single stblg into ws_stblg
                 from   bkpf
                 where  bukrs = i_data-bukrs
                   and  gjahr = i_data-gjahr
                   and  belnr = i_data-belnr.
          if not ws_stblg is initial.
             delete i_data.
          endif.
       endloop.
      ELSEIF s_blart IS INITIAL.
      Select all documents of allowed document types ******
           and inputted company code           ************
        SELECT belnr gjahr augdt augbl bukrs
           blart bldat xblnr lifnr wrbtr shkzg
           FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
           FOR ALL ENTRIES IN i_doctype
           WHERE blart EQ i_doctype-blart
             AND augdt IN s_augdt
             AND bukrs IN s_bukrs .
        LOOP AT i_data.
    Exclude documents of type ZP
    for company code 8000.
          IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
            DELETE i_data.
            continue.
          ENDIF.
      Exclude reversed documents
          select single stblg into ws_stblg
                 from   bkpf
                 where  bukrs = i_data-bukrs
                   and  gjahr = i_data-gjahr
                   and  belnr = i_data-belnr.
          if not ws_stblg is initial.
             delete i_data.
             continue.
          endif.
        ENDLOOP.
        READ TABLE i_data INDEX 1.
        IF sy-subrc NE 0.
          MESSAGE i999 WITH 'No records have been selected'.
          EXIT.
        ENDIF.
      ELSE.
      Select the documents matching the company codes  *****
    and document types inputted in the selection screen ****
        SELECT belnr gjahr augdt augbl bukrs bldat xblnr
           blart lifnr  wrbtr shkzg
           FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
           WHERE bukrs IN s_bukrs AND blart IN s_blart
             AND augdt IN s_augdt.
        SORT i_data BY blart.
        LOOP AT i_data.
      Filtering the records selected
      based on the document type
          READ TABLE i_doctype WITH KEY blart = i_data-blart.
          IF sy-subrc NE 0.
            DELETE i_data.
            continue.
          ENDIF.
      Exclude documents of type ZP
      for company code 8000.
          IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
            DELETE i_data.
            continue.
          ENDIF.
      Exclude reversed documents.
          select single stblg into ws_stblg
                 from   bkpf
                 where  bukrs = i_data-bukrs
                   and  gjahr = i_data-gjahr
                   and  belnr = i_data-belnr.
          if not ws_stblg is initial.
             delete i_data.
             continue.
          endif.
        ENDLOOP.
        READ TABLE i_data INDEX 1.
        IF sy-subrc NE 0.
          MESSAGE i999 WITH 'No records have been selected'.
          EXIT.
        ENDIF.
      ENDIF.
      IF sy-subrc NE 0.
        MESSAGE i999 WITH 'No records have been selected'.
        EXIT.
      ENDIF.
    credit/debit identification ***********************
      LOOP AT i_data.
        IF i_data-shkzg EQ 'H'.
          i_data-wrbtr = i_data-wrbtr * 1.
        ELSEIF i_data-shkzg EQ 'S'.
          i_data-wrbtr = i_data-wrbtr * -1.
        ENDIF.
        MODIFY i_data.
      ENDLOOP.
    for summarizing ******************************
      LOOP AT i_data.
        MOVE-CORRESPONDING  i_data TO i_data1.
        COLLECT i_data1.
      ENDLOOP.
    Vendor informations and Check Informations *****************
      SELECT lifnr name1 sortl
             FROM lfa1
             APPENDING CORRESPONDING FIELDS OF TABLE i_lfa1
             FOR ALL ENTRIES IN i_data1
             WHERE lifnr = i_data1-lifnr.
      SELECT chect vblnr gjahr zbukr FROM payr APPENDING CORRESPONDING
                                FIELDS OF TABLE i_payr FOR ALL ENTRIES
                                IN  i_data1   WHERE vblnr = i_data1-augbl
                                AND gjahr = i_data1-augdt(4)
                                AND zbukr = i_data1-bukrs.
      SORT i_data1 BY augbl gjahr bukrs lifnr.
      SORT i_payr  BY vblnr gjahr zbukr.
      SORT i_lfa1  BY lifnr.
      LOOP AT i_data1.
        READ TABLE i_payr WITH KEY vblnr = i_data1-augbl
                                   gjahr = i_data1-gjahr
                                   zbukr = i_data1-bukrs.
        IF sy-subrc EQ 0.
          i_data1-chect = i_payr-chect.
        ENDIF.
        READ TABLE i_lfa1 WITH KEY lifnr = i_data1-lifnr.
        IF sy-subrc EQ 0.
          i_data1-name1 = i_lfa1-name1.
          i_data1-sortl = i_lfa1-sortl.
        ENDIF.
        i_data1-status = 'X'.
        MODIFY i_data1.
      ENDLOOP.
    **The records are sorted by clearing date, check number and doc type**
      SORT i_data1 BY augdt chect blart.
    **********The header record is outputted on the screen****************
      PERFORM write_header.
    ********Data is moved to internal table in the file format *************
      PERFORM move_data.
    Line items are outputted on the screen *********************
      PERFORM write_output.
    *&                   Form  write_header                             &*
    *&        This outputs the header information to screen             &*
    FORM write_header.
      SKIP.
       SET PF-STATUS 'LIST'.
    Outputting the header information *********************
      WRITE : / 'Extraction Date : ' , header-ext_date.
      WRITE : / 'Extraction Time : ' , header-ext_time.
      FORMAT COLOR 1." INTENSIFIED.
      SKIP.
      ULINE AT 0(190) NO-GAP.
    Outputting line level information **********************
      WRITE:/  sy-vline NO-GAP,
            (10) 'DOC NUMBER',
              sy-vline NO-GAP,
             (4) 'F-YR',
               sy-vline NO-GAP,
             (6) 'C-CODE',
              sy-vline NO-GAP,
             (10) 'CHECK NUM',
              sy-vline NO-GAP,
             (10) 'VENDOR NUM',
              sy-vline NO-GAP,
             (35) 'VENDOR NAME',
               sy-vline NO-GAP,
             (12) 'INVOICE DATE',
              sy-vline NO-GAP,
             (16) 'INVOICE NUMBER',
              sy-vline NO-GAP,
             (12) 'PAID DATE',
               sy-vline NO-GAP,
             (15) 'INVOICE AMOUNT',
              sy-vline NO-GAP,
             (2) 'SC',
              sy-vline NO-GAP,
             (16) 'REFERENCE FI DOC',
               sy-vline NO-GAP,
             (15) 'SORT FIELD',
               sy-vline NO-GAP.
      ULINE AT 0(190) NO-GAP.
    ENDFORM.                    " write_header
    *&                      FORM  MOVE_DATA                             &*
    *&    Formats data in internal table as is required in the file     &*
    FORM move_data.
      LOOP AT i_data1.
    Document number and fiscal year should be separted by '|' *****
        CONCATENATE i_data1-belnr i_data1-gjahr INTO fidoc_year
                    SEPARATED BY '|'.
        MOVE i_data1-bukrs TO comp_code.
        MOVE i_data1-chect TO check_numbr.
    Vendor number and vendor name should be separted by '|' *****
        CONCATENATE i_data1-lifnr i_data1-name1 INTO vendor
          SEPARATED BY '|'.
        SHIFT vendor LEFT DELETING LEADING '0'.
        SHIFT vendor RIGHT DELETING TRAILING space.
    Date fields converted to MM/DD/YYYY format ****************
        MOVE i_data1-bldat+0(4) TO yy.
        MOVE i_data1-bldat+4(2) TO mm.
        MOVE i_data1-bldat+6(2) TO dd.
        CONCATENATE mm dd yy INTO inv_date SEPARATED BY '/'.
        MOVE i_data1-xblnr TO inv_nbr.
        SHIFT inv_nbr RIGHT DELETING TRAILING space.
        MOVE i_data1-augdt+0(4) TO yy.
        MOVE i_data1-augdt+4(2) TO mm.
        MOVE i_data1-augdt+6(2) TO dd.
        CONCATENATE mm dd yy INTO paid_dat SEPARATED BY '/'.
        MOVE i_data1-wrbtr TO inv_amt.
        CONDENSE inv_amt.
       SHIFT inv_amt RIGHT DELETING TRAILING space.
        MOVE i_data1-status TO status.
        MOVE i_data1-augbl TO ref_doc.
        CONCATENATE fidoc_year
                    comp_code
                    check_numbr
                    vendor
                    inv_date
                    inv_nbr
                    paid_dat
                    inv_amt
                    status
                    ref_doc
           INTO i_final_file-record SEPARATED BY '~'.
        APPEND i_final_file.
      ENDLOOP.
    ENDFORM.                    " MOVE_DATA
    *&                      Form  write_output                          &*
    *&                  Outputs all data to screen                      &*
    FORM write_output.
      LOOP AT i_data1.
        FORMAT COLOR 2 INTENSIFIED.
    Outputting line level information *******************
        WRITE :  /  sy-vline NO-GAP,
                 (10) i_data1-belnr,
                   sy-vline NO-GAP,
                (4) i_data1-gjahr,
                   sy-vline NO-GAP,
                 (6) i_data1-bukrs,
                   sy-vline NO-GAP,
                (10) i_data1-chect,
                  sy-vline NO-GAP,
                  (10) i_data1-lifnr,
                 sy-vline NO-GAP,
                 (35) i_data1-name1,
                   sy-vline NO-GAP,
                 (12) i_data1-bldat MM/DD/YYYY,
                   sy-vline NO-GAP,
                 (16)  i_data1-xblnr,
                   sy-vline NO-GAP,
                 (12) i_data1-augdt MM/DD/YYYY,
                   sy-vline NO-GAP,
                 (15) i_data1-wrbtr,
                   sy-vline NO-GAP,
                 (2) i_data1-status,
                   sy-vline NO-GAP,
                 (16) i_data1-augbl,
                   sy-vline NO-GAP,
                 (15) i_data1-sortl,
                 sy-vline NO-GAP.
      ENDLOOP.
      ULINE AT 0(190) NO-GAP.
    ENDFORM.                    " write_output
    In the program, I am downloading only the list.. The description of report outputted in the beginning of the report is not downloaded to excel.
    What has to be taken into consideration is that, the structure of the table i_data1 which contains the data to be downloaded to the table.
    I hope that this will help you.
    Regards,
    Susmitha

  • How to convert Oracle Report into Excel

    Hi,
    Please guide for the following:
    I am using, Report Developer 11g and I want to save Oracle report into Excel format, is it possible ?
    Regards,
    Thanks.

    There is a Reports manual you know!
    http://download.oracle.com/docs/cd/E14571_01/bi.1111/b32121/pbr_cla005.htm#i636884

  • Download the output into Excel...(List- export- spreadsheet)

    Dear friends,
    I want to download the output into Excel...
    I am using all SAP standards and using the ALV Block list
    Ex: List->export->local file.. is anable from here i can download to excell .....but the same there is anothere option : List->export->spreadsheet...( this one inactive.)
    I want to activate the List->export->spreadsheet option.
    how to do this???
    Thanks,
    Sridhar.

    Hi
       Use the Function Module:
    EXCEL_OLE_STANDARD_DAT
    For your purpose.
    But by default you can get the option to download into several formats including your desired one.
    Regards,
    Sreeram

Maybe you are looking for

  • It’s compatible OWB 9.0.4.10 with W2003 and Oracle 10.2.0.1?

    I have to migrate a DWH on Server 1 (OWB 9.0.4.10, Oracle Workflow 2.6.2, Windows 2000, Oracle 9.2.0.6) to Server 2 1 (OWB 9.0.4.10, Oracle Workflow 2.6.3, Windows 2003, Oracle 10.2.0.1) It’s posible to use OWB 9.0.4.10 with W2003 and Oracle 10.2.0.1

  • Where are my file extensions?

    Hi All, I have two iPhoto libraries (one in the default package and one in a new package), and one of them shows my file extensions and the other does not. In my default library, all of my pictures are in the library because iPhoto sucked them off my

  • Music in slideshow restarts

    I have a 28 min slideshow and plenty of songs to go the distance. The first song restarts after about 20 pictures. I deleted the song and reinserted and then replaced with another song. The same song repeats at the exact same spot each time. Any idea

  • Tracking Changes - Deleted Images

    When deleting a floating image while tracking changes, gray bubbles with a slash mark through them appear where the image was. Is there a way to get rid of them while still tracking changes? They're an annoyance, especially when I try to insert and a

  • Rule XVAL not processing basic pay data.

    Hello experts, While checking the log of payroll run, I find that basic pay data (IT0008 wage-types) are not processed (IT0008 wage-types are not there in the output table IT of schema function - PIT   XVAL P10            Valuate pay elements). I am