GUI_DOWNLOAD - columns misplaced in excel

1.As per my requirement the user want the report to displayed in excel without displaying on the screen.So the user enters the path where they want this report to be downloaded in the select option screen.
2.We are using the function module GUI_DOWNLOAD to display output in excel.
3.There is one problem related to output display. The columns for some materials are getting skewed or misplaced.
4.I have tried all combinations of export perameters in GUI_DOWNLOAD but still not able to find the cause for this skewing of data.
Here is the code that i have used to display.
CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = pa_dwfil
        filetype                = 'ASC'
        append                  = 'X'
        write_field_separator   = 'X'
        header                  = '00'
        codepage                = lv_codepage
      TABLES
        data_tab                = <dyn_table>
        fieldnames              = gt_inthead
      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.
My material description has '#' symbol within it. So I used to remove '#' symbol by using REPLACE ALL as follows,
REPLACE ALL OCCURRENCES OF '#' IN wa_itab-maktx WITH ' '.
It is working fine in D system. But Replace fails in Q system.
Any help is greatly appreciated

You are right. I got the hexadecimal value is 09 for desc whenever it has '#' symbol.
To resolve this,
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB IN wa_itab-maktx WITH ' '.
or
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>CR_LF IN wa_itab-maktx WITH ' '.
or
REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE IN wa_itab-maktx WITH ' '.
From the above which one i need to be used.
Because i read many posts in this forums. They said the above code for the same issue with '#' symbol.
Can you help me out to solve this.

Similar Messages

  • Append time stamp as a column in an excel file

    Hi
    i want to add timestamp to the last column  of my excel file
    my data is this 
    columnA   columnB  column C  columnD
    temp10     temp11    temp12     timestamp       these are header name
    74.212     73.122     73.222      11AM:23:59.012
    73.444     73.223     74.322      11AM:24:02.083
    73.445     73.478     75.555       11AM.24:03.833
      and continue
    I can use write spreadsheet to have the three numeric tempdata but the last column formatted as time stamp and string 
    how do I add time stamp to my data and call the spreadsheet write VI to append to the excel file ?
    help
    Solved!
    Go to Solution.

    You have at least two possibilities:  One is to do the formatting yourself with string functions and write the data as a text file or an array of strings.
    Another is to convert the timestamp to a Double and save it as numeric data.  This is only useful if your are going to read the data back into LV and analyze it there, because Excel's numeric representation of date and time is different from that used by LV.
    Lynn 

  • 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.

  • To set a dropdown list for one column in the excel file before downloading

    Hi all,
    I am downloading an excel file which has the format of an internal table with a number of fields. I want to set a dropdown list for one column in the excel file. How can i do this?
    Thanks

    HI ,
    U can use function module " QINT_GET_EXCEL_DATA " ....
    and modify the excel sheet based on ur requirement ......
    Try this ...
    Hope it works
    Thanks
    Shambhu

  • Hiding row and column headings in excel

    How do I head the row and column headings in excel in docs to go?  I have a Q10 and there just isn't enough screen space to also have the letters across the top, and the numbers down the side.  How do I get rid of them so I just have the actual spreadsheet itself?
    Desktop excel does have this functionality.
    David

    Choose Freeze Header Rows in the Table Format pane.
    Jerry

  • How do I get the last COLUMN in an Excel Sheet using Report Generation toolkit in LV7.1?

    I am trying to get the last column in an Excel sheet using the Report Generation toolkit. The function "Excel Get Last Row" does not give last column info. Is there a function that will do this?
    Thanks

    Hello –
    I think the following example program might be helpful to get you started programming your application.
    Get Excel Data from Specified Field.
    Hope this helps!
    SVences
    Applications Engineer
    National Instruments

  • Need help in writing NVARCHAR2 column to an excel sheet

    Hi All,
    I have a NVARCHAR2 column in my table. I want to store the data present in the column into an excel file. When i write the data to an excel file the data is getting converted to some other form. It's not in human readable form.
    Language is not fixed for the column.
    I need help in storing the NVARCHAR2 data into an excel file without any implicit conversion done by the oracle.
    Please help.
    Thanks,
    Girish G
    Edited by: Girish G on Jul 14, 2011 2:02 AM

    Export data to BLOB (csv)

  • Outline and Group columns like in Excel?

    I am trying to do an outline and group of columns like in Excel. I basically, want to hide away (roll up) certain columns in a spreadsheet. I know I can hide them, but I would prefer to group/outline them like I can in Excel so anyone can ungroup them. If I just hide them, they look like they are gone. Can Numbers '09 do this for columns?
    Thanks,
    jeff

    Numbers does not have that capability. It would be difficult to replicate it for columns because there are no filters for columns, just rows. It might be possible to do something for rows by using the filtering capabilities, an extra (hidden) column on which to filter, and checkboxes that you can check/uncheck to show/hide groups of rows.

  • How to import all column heading of excel to oracle 6i forms(no rows).

    hello,
    I am new to oracle forms.
    There are so many links for importing and exporting data from forms to excel and excel to forms.
    But i want to import all column heading of excel to form (no rows). I am using forms 6i.
    please help me for the same.
    Thank You.
    Edited by: sam8682 on Apr 9, 2013 5:48 AM
    Edited by: sam8682 on Apr 9, 2013 5:50 AM

    Reading from any file is always done in a loop through the records. So, just loop only once. That will give you the first record only.
    If you have some code already you can modify it to something like:
    for i in 1..1 loop
    end loop;

  • Read a Column from an Excel file

    Guys,
    Is there a way I can read a specific column from an excel file, use that data to query and select data from a table and then insert the output into another column of that same excel file.
    Please advise! Thanks

    > Is there a way I can read a specific column from an excel file, use that data to query and select data from a
    table and then insert the output into another column of that same excel file.
    Not easily. An Excel file is typically in a proprietary binary file format. Perhaps saved using the new MS Office XML format.. which would be possible to process via Oracle's XDB.
    But assuming it is in a binary format, you need "something else" to read and parse that file for you - like ODBC or DDE or COM/DCOM, etc.
    Oracle supports Heterogeneous Database Services. On a Windows Server, you can create a database link in Oracle that uses an ODBC driver to connect to an ODBC data source. There are ODBC drivers for Excel. However, this requires the data in the worksheet to be properly marked as a data table. Or did last time I looked at it about 2 years ago.
    You can also call external "interfaces" from PL/SQL using EXTPROC - such interfaces can be DLLs. Which means you do have access to the Win32 API and application APIs from PL/SQL. This can be used to access the content of an Excel file - DDE for example can quite easily do this (you use it to peek the contents of an Excel grid location), but requires Excel to be running and that spreadsheet to be loaded. DDE can also be used to poke contents (write something back to a cell in a spreadsheet).
    But using Oracle code to use an Excel file as a kind of database file... that IMO does not make a lot of sense. At all.

  • Validating the first two columns of a excel file when importing?

    Hi everyone,
    I have an excel file in the presentation server which has to be uploaded into prog.First the user adds a additonal column in the excel file.
    For example the excel file is intially in this way,
    col1 col2 col3 col4 col5
    Now the user adds one more column 'colx' in the excel sheet and he will upload it into the prog.Before uploading programatically we have to validate that the first two columns of the excel file should be col1 colx(the newly added one).How can I do it?
    Any suggestions please?
    Thank you.

    Hi gopi,
    Thanks for the reply.
    I have one more problem.Now in the excel file I may have only 5 columns in the future it may have more than that.So the internal table which will hold the uploaded values from excel file should be dynamic.I can't declare the internal table with 5 or 6 columns like that.If the user adds some columns in the excel file and upload it,the internal table should hold these columns also.
    i hope u understood my requirement.Can u give me any ideas.If u have any sample code for this kind of requirement.
    Thank you.

  • Fixed column length in excel sheet thru abap program

    HI Experts ,
    I am sending 2 excel attachments from abap program to external email Id's  .
    Excel attachments are successfully sending but the columns in the excel attachmet are compressed .
    I want to fix some width for excel columns .
    Please provide your help and suggest .
    Thanks,
    Nusrat

    Hi All  ,
    Thanks for the reply ,..
    I am using below function module to send a mail with excel attachment , I would like to use the same code instead of OLE  .. Could you please let me know how to modify the column lenght using this module  .
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
                sender_address             = 'Traking System'
                sender_address_type        = 'INT'
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = gd_sent_all
           TABLES
                packing_list               = it_packing_list
                contents_bin               = it_attachment
                contents_txt               = it_message
                receivers                  = it_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Thanks ,
    Nusrat

  • Removing Column from exported excel in ALV

    Hi,
    I have displayed one ALV to user which displays first column for checkbox and second column for image.
    When I export this ALV output to Excel using standard Export button, these two columns also get exported to Excel.
    Is there a way by which I can remove these columns from exported excel.
    Thanks,
    Feroz

    Hi,
    Please try this -
    When you use the settings link to hide the columns, use it and hide the columns that you don't want to export, then try to Export. Check wether these hidden columns are also shown in the Excel.
    Or
    One more thing, In the EXPORT button functionality, try to get the column references of the table and hide those ccolumns programatically and try to export it.
    While showing to user give these columns while export hide these columns by the above way.
    One more thing, when you are using the standard EXPORT button, Your code doesnot trigger. Please check it.
    I don't know wether this will be of any help. Give it a try.
    Regards,
    Lekha.

  • Row to column conversion during excel download

    Dear Experts,
    I have an internal table with one column.
    It has some entries say ten.
    I want this ten rows of entries to be displayed in the excel sheet as a single row. It means each row entry of the internal table should fit in to each cell.
    Is there any possibility with GUI_DOWNLOAD FM to do this?
    If not, then how could i do that?
    Please let me know its urgent.
    Regards,
    Shashi

    Hi,
    i m not aware of whether it can be done through FM 'GUI_DOWNLOAD' but i have one sugeestion.
    You can first transpose your internal table and then download it.
    Sample code for obtaining the transpose is as follows:
    *& Report Z_TRANPOSEALV *
    *& Author : Swarna.S.
    *& AS: This simple ALV report display is in a transposed way
    *& Publised at ****************
    REPORT Z_TRANSPOSEALV .
    Type pools declaration for ALV
    TYPE-POOLS: slis.
    *Declarations for ALV, dynamic table and col no for transpose
    DATA: l_col TYPE sy-tabix,
    l_structure TYPE REF TO data,
    l_dyntable TYPE REF TO data,
    wa_lvc_cat TYPE lvc_s_fcat,
    lt_lvc_cat TYPE lvc_t_fcat,
    lt_fieldcatalogue TYPE slis_t_fieldcat_alv,
    wa_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv,
    lt_layout TYPE slis_layout_alv.
    *Field symbols declarations
    FIELD-SYMBOLS :
    <header> TYPE ANY,
    <dynheader> TYPE ANY,
    <dyndata> TYPE ANY,
    <ls_table> TYPE ANY,
    <dynamictable> TYPE STANDARD TABLE,
    <it_table> TYPE STANDARD TABLE.
    *Input the name of the table
    PARAMETERS p_table TYPE dd02l-tabname OBLIGATORY.
    *Initialization event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    Create internal table of dynamic type
    CREATE DATA l_dyntable TYPE STANDARD TABLE OF (p_table)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN l_dyntable->* TO <it_table>.
    *select statement to select data from the table as input into
    *our dynamic internal table.
    *Here i have restricted only till 5 rows.
    *You can set a variable and give no of rows to be fetched
    *The variable can be set in your select statement
    SELECT * INTO CORRESPONDING FIELDS OF TABLE <it_table>
    FROM (p_table) up to 5 rows.
    *Fieldcatalogue definitions
    wa_lvc_cat-fieldname = 'COLUMNTEXT'.
    wa_lvc_cat-ref_table = 'LVC_S_DETA'.
    APPEND wa_lvc_cat TO lt_lvc_cat.
    wa_fieldcat-fieldname = 'COLUMNTEXT'.
    wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
    wa_fieldcat-key = 'X'..
    APPEND wa_fieldcat TO lt_fieldcat.
    DESCRIBE TABLE <it_table>.
    DO sy-tfill TIMES.
    For each line, a column 'VALUEx' is created in the fieldcatalog
    Build Fieldcatalog
    WRITE sy-index TO wa_lvc_cat-fieldname LEFT-JUSTIFIED.
    CONCATENATE 'VALUE' wa_lvc_cat-fieldname
    INTO wa_lvc_cat-fieldname.
    wa_lvc_cat-ref_field = 'VALUE'.
    wa_lvc_cat-ref_table = 'LVC_S_DETA'.
    APPEND wa_lvc_cat TO lt_lvc_cat.
    Build Fieldcatalog
    CLEAR wa_fieldcat.
    wa_fieldcat-fieldname = wa_lvc_cat-fieldname.
    wa_fieldcat-ref_fieldname = 'VALUE'.
    wa_fieldcat-ref_tabname = 'LVC_S_DETA'.
    APPEND wa_fieldcat TO lt_fieldcat.
    ENDDO.
    Create dynamic internal table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = lt_lvc_cat
    IMPORTING
    ep_table = l_dyntable. ASSIGN l_dyntable->* TO <dynamictable>.
    Create structure as structure of the internal table
    CREATE DATA l_structure LIKE LINE OF <dynamictable>.
    ASSIGN l_structure->* TO <header>.
    Create structure = structure of the internal table
    CREATE DATA l_structure LIKE LINE OF <it_table>.
    ASSIGN l_structure->* TO <ls_table>.
    Create field catalog from our table structure
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_structure_name = p_table
    CHANGING
    ct_fieldcat = lt_fieldcatalogue
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF. DESCRIBE TABLE lt_fieldcatalogue.
    Fill the internal to display <dynamictable>
    DO sy-tfill TIMES.
    IF sy-index = 1.
    READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX 1.
    ENDIF.
    For each field of it_table
    ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <dynheader>.
    IF sy-subrc NE 0. EXIT .ENDIF.
    READ TABLE lt_fieldcatalogue INTO wa_fieldcat INDEX sy-index.
    Fill 1st column
    <dynheader> = wa_fieldcat-seltext_m.
    IF <dynheader> IS INITIAL.
    <dynheader> = wa_fieldcat-fieldname.
    ENDIF.
    *Filling the other columns
    LOOP AT <it_table> INTO <ls_table>.
    l_col = sy-tabix + 1.
    ASSIGN COMPONENT sy-index OF STRUCTURE <ls_table> TO <dyndata>.
    IF sy-subrc NE 0. EXIT .ENDIF.
    ASSIGN COMPONENT l_col OF STRUCTURE <header> TO
    <dynheader>.
    IF sy-subrc NE 0. EXIT .ENDIF.
    WRITE <dyndata> TO <dynheader> LEFT-JUSTIFIED.
    ENDLOOP.
    APPEND <header> TO <dynamictable>.
    ENDDO.
    *Layout for ALV output
    lt_layout-zebra = 'X'.
    lt_layout-no_colhead = 'X'..
    lt_layout-colwidth_optimize ='X'.
    lt_layout-window_titlebar = 'ALV GRID TRANSPOSED'.
    *ALV Grid output for display
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    is_layout = lt_layout
    it_fieldcat = lt_fieldcat
    TABLES
    t_outtab = <dynamictable>.
    Regards,
    Karuna.

  • Increase the column lengths of excel sheet through abap

    I developed a abap program and it was displayed the output.
      So i need to display this out put in excel sheet.
      for that I read the out put and placed in the excel,
    the only problem is the column lengths are small
    after download  i am dragging the each column,
    But i need to increase the each column by the program
       How can I ?
    I am using the following code
          lastline = new_line_c + 13.
          DO .
            READ LINE sy-index LINE VALUE INTO it_read-excel.
            APPEND it_read.
            IF sy-index > lastline.
              EXIT.
            ENDIF.
          ENDDO.
          lastline = new_line_c - 38.
          colm = ( length - 37 ) / 18.
          colm = colm + 4.
          FOR THE EXCEL CONVERTION
          INCLUDE ole2incl.
          DATA: w_cell1 TYPE ole2_object,
          w_cell2 TYPE ole2_object.
    *--- Ole data Declarations
          DATA: h_excel TYPE ole2_object, " Excel object
          h_mapl TYPE ole2_object, " list of workbooks
          h_map TYPE ole2_object, " workbook
          h_zl TYPE ole2_object, " cell
          h_f TYPE ole2_object, " font
          gs_interior TYPE ole2_object, " Pattern
          worksheet TYPE ole2_object,
          h_cell TYPE ole2_object,
          h_merge TYPE ole2_object,
          h_cell1 TYPE ole2_object,
          range TYPE ole2_object,
          h_sheet2 TYPE ole2_object,
          h_sheet3 TYPE ole2_object,
          gs_font TYPE ole2_object,
          flg_stop(1) TYPE c.
    *DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
    *t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
    *t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
          TYPES: data1(1500) TYPE c,
          ty TYPE TABLE OF data1.
          DATA: it TYPE ty WITH HEADER LINE,
          it_2 TYPE ty WITH HEADER LINE,
          it_3 TYPE ty WITH HEADER LINE,
          rec TYPE sy-tfill,
          deli(1) TYPE c,
          l_amt(18) TYPE c.
          DATA: BEGIN OF hex,
          tab TYPE x,
          END OF hex.
          FIELD-SYMBOLS: <fs> .
          CONSTANTS cns_09(2) TYPE n VALUE 09.
          ASSIGN deli TO <fs> TYPE 'X'.
          hex-tab = cns_09.
          <fs> = hex-tab.
          DATA gv_sheet_name(20) TYPE c .
    M A C R O Declaration
          DEFINE ole_check_error.
            if &1 ne 0.
              message e001(zz) with &1.
              exit.
            endif.
          END-OF-DEFINITION.
          DATA: xy TYPE i,
                xz TYPE i,
                yz TYPE i,
                ab TYPE i,
                pterm TYPE i.
          IF h_excel-header = space OR h_excel-handle = -1.
    start Excel
            CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
          ENDIF.
    PERFORM err_hdl.
    *--- get list of workbooks, initially empty
          CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    PERFORM err_hdl.
          SET PROPERTY OF h_excel 'Visible' = 1.
    add a new workbook
          CALL METHOD OF h_mapl 'Add' = h_map.
    PERFORM err_hdl.
    *GV_SHEET_NAME = '1st SHEET'.
          gv_sheet_name = 'Price Comparison List'.
          GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
          SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
          index1 = 3.
          LOOP AT it_read.
           heading
            IF sy-tabix < 4.
              it_item = it_read.
              IF  it_item CS '-----'.
                CLEAR it_item.
                APPEND it_item.
              ELSE.
                IF sy-tabix = 1.
                  it_item+0(1) = deli.
                ENDIF.
                APPEND it_item.
              ENDIF.
            ENDIF.
           headear data and item
            IF sy-tabix > 4 AND sy-tabix < descline1.
              it_item = it_read.
              IF it_item CS '----'.
              ELSE.
                REPLACE ALL OCCURRENCES OF sy-vline IN it_item WITH deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
            xy = 2.
            xz = 38.
           discount etc
            IF sy-tabix >= descline1 AND sy-tabix < descline.
              it_item = it_read.
              it_item+12(1) = deli.
              it_item+22(1) = deli.
              it_item+43(1) = deli.
              WHILE xy < colm.
                xz = xz + 18.
                it_item+xz(1) = deli.
                xy = xy + 1.
              ENDWHILE.
              APPEND it_item.
            ENDIF.
          payment terms
            xy = 2.
            xz = 37.
            pterm = descline + 6.
            IF sy-tabix > descline AND sy-tabix < pterm.
              it_item = it_read.
              IF it_item CS '-----'.
                CLEAR it_item.
                APPEND it_item.
              ELSE.
                it_item+12(1) = deli.
                it_item+15(1) = deli.
                it_item+36(1) = deli.
                WHILE xy < colm.
                  xz = xz + 17.
                  it_item+xz(1) = deli.
                  xy = xy + 1.
                ENDWHILE.
                APPEND it_item.
              ENDIF.
            ENDIF.
         prepared by
            lastline = pterm + 3.
            IF sy-tabix >= pterm AND sy-tabix <= lastline.
              it_item = it_read.
              IF it_item CS '-----'.
              ELSE.
                it_item+0(1) = deli.
                it_item+54(1) = ' '.
                it_item+16(1) = deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
           remaarks
            yz = lastline + 10.
            IF sy-tabix > lastline AND sy-tabix <= yz.
              it_item = it_read.
              it_item+0(1) = deli.
              it_item+54(1) = ' '.
              APPEND it_item.
            ENDIF.
      approved by
            ab = yz + 5.
            IF sy-tabix > yz AND sy-tabix < ab.
              it_item = it_read.
              IF it_item CS '-----'.
              ELSE.
                it_item+0(1) = deli.
                it_item+54(1) = ' '.
                it_item+14(1) = deli.
                APPEND it_item.
              ENDIF.
            ENDIF.
          ENDLOOP.
    *--Formatting the area of additional data 1 and doing the BOLD
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 1
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the second row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 2
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the fourth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 4
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the fifth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 5
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
    *Bold for the sixth row
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 6
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = colm.
          CALL METHOD OF h_excel 'Range' = h_cell
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
    *CALL METHOD OF gs_cells 'Select' .
          GET PROPERTY OF h_cell 'Font' = gs_font .
          SET PROPERTY OF gs_font 'Bold' = 1 .
          DATA l_rc TYPE i.
          CALL METHOD cl_gui_frontend_services=>clipboard_export
            IMPORTING
              data                 = it_item[]
            CHANGING
              rc                   = l_rc
            EXCEPTIONS
              cntl_error           = 1
              error_no_gui         = 2
              not_supported_by_gui = 3
              OTHERS               = 4.
          CALL METHOD OF h_excel 'Cells' = w_cell1
            EXPORTING
            #1 = 1
            #2 = 1.
          CALL METHOD OF h_excel 'Cells' = w_cell2
            EXPORTING
            #1 = 1
            #2 = 1.
    PERFORM err_hdl.
          CALL METHOD OF h_excel 'Range' = range
            EXPORTING
            #1 = w_cell1
            #2 = w_cell2.
          CALL METHOD OF range 'Select'.
    PERFORM err_hdl.
          CALL METHOD OF worksheet 'Paste'.
    PERFORM err_hdl.
    CALL METHOD OF h_excel 'QUIT'.
          FREE OBJECT h_zl.
          FREE OBJECT h_mapl.
          FREE OBJECT h_map.
          FREE OBJECT h_excel.

    Hello Ravi,
    Thank you very much for your suggestions.. but still have some more doubts:
    What i want to do is :
    -->call report in background job with a selection criteria.
    -->the output of the report should be trasnsfered to excel sheet
    -->then the excel sheet should be sent to XI..
    My doubts are:
    -> is it possible with every report or we need some extra code to achieve this
    -> If yes, then how exactly it should be done. can you please explain in more detail.
    Thank you very much for your help.
    Best Regards,
    Jasmeet

Maybe you are looking for