*How to download a list into Excel/Notepad which should be Read only type*

Hi All ,I have a requirement to Download the Report list to a Hardcoded path ie., this path should not change if a user tries to change and the File which gets downloaded should be automatically created as Read-Only.This is an Urgent requirement,kindly help me out.
Regards,
Rahul.

Yes its possible Qui,
you need to perform following steps:
1. check the codelink property of that particular iview.
2. download the .par file from systemadmin-> support.
3. import in NWDS, and make change in the .jsp or .java file of that iviews component.
4. you need to know which BAPIs to be called for accessing the report, then export the .par file and make a new iview out of that .par file.
5. now you will get that button in your iView.
6. calling the proper backend function/BAPI is your task now.
rgds,
Kedar
if helpful answer pls reward points.

Similar Messages

  • How to convert alv list into excel file?

    Hi Experts,
            i have created one report for Due Date Analysis.
    Now My output is displaying in ALV list. But I need to convert the data which in alv list into Excel File. then only i have to send the Excel File to the Customer Thro Email.
         So i need the Function Module to Convert the Data into Excel File.
    Thanks,
    Neptune.M

    Hi,
      U can use function module gui_download.
      CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
        BIN_FILESIZE       =
          filename           = 'C:\Transportaionlane.XLS'
          filetype                       = 'DAT'
        WRITE_FIELD_SEPARATOR           = ' '
        HEADER                          = '00'
        TABLES
          ata_tab                       = t_trans_lane_dis[]
           OTHERS                          = 22
    if u want with header then pass the header.
    regards
    Ahasan

  • How to download output data into Excel with all Column Headings

    Hi Experts,
    Please tell me How to download output data of ALV Grid into Excel file with all Column Headings and I want to do this using coding,
    please send me if any solution is available.
    Thanks & Regards,
    Yogesh

    VERSION CONTROL (Most recent on top):                                *
      DATE(mm.dd.yyyy)    AUTHOR                                         *
      06.25.2007         Pattan Naveen                                   *
    Hi yogesh,,
    Go through this in this u find ur solution.
    report ZTEst_programe no standard page heading
                               line-size 100
                               line-count 50(5)
                               message-id zz.
    *--alv type declaration
    type-pools: slis.
    *--Tables:
    tables: anla,
            anlz,
            anlh,
            anlb,
            anlc.
    data: v_pos type i.
    data: v_ndjar type i.
    data: v_ndper type i,
          v_ndperndabp type i,
          v_ndjarndabp1 type i,
          v_ndjarndabp type i,
          value type i,
    date(10) type c value '2006.12.04'.
    data: c_0000(4) type c value '0000'.
    data: begin of it_final occurs 0,
             anlkl(8),
             bukrs(4),
             anln1 like anla-anln1,
             anln2 like anla-anln2,
             txt50 like anla-txt50,
             txa50 like anla-txa50,
             anlhtxt like anlh-anlhtxt,
             sernr like anla-sernr,
             invnr like anla-invnr,
             menge like anla-menge,
             meins like anla-meins,
             inken like anla-inken,
               ivdat like anla-ivdat,
             aktiv like anla-aktiv,
             gsber like anlz-gsber,
             kostl like anlz-kostl,
             kostlv like anlz-kostlv,
             werks like anlz-werks,
             stort like anlz-stort,
              raumn like anlz-raumn,
              txjcd like anlz-txjcd,
             ord41 like anla-ord41,
             ord44 like anla-ord44,
             gdlgrp like anla-gdlgrp,
             anlue like anla-anlue,
             lifnr like anla-lifnr,
             typbz like anla-typbz,
             aibn1 like anla-aibn1,
          aibn2 like anla-aibn2,
            aibdt like anla-aibdt,
             posnr like anla-posnr,
            vmgli like anla-vmgli,
            invzu like anla-invzu,
            ernam like anla-ernam,
            erdat like anla-erdat,
             afabe like anlb-afabe,
            afasl like anlb-afasl,
             ndjar like anlb-ndjar,
             ndper like anlb-ndper,
            afabg like anlb-afabg,
            ndabj like anlc-ndabj,
            ndabp like anlc-ndabp,
            andsj like anlc-andsj,
             andsp like anlc-andsp,
            safbg like anlb-safbg,
             umjar like anlb-umjar,
           inbda like anlb-inbda,
           kansw like anlc-kansw,
           knafa like anlc-knafa,
            kaafa like anlc-kaafa,
                     deakt like anla-deakt,
    kanza like anlc-kanza,
    kaufw like anlc-kaufw,
    kinvz like anlc-kinvz,
    ksafa like anlc-ksafa,
    kmafa like anlc-kmafa,
      end of it_final.
    data: begin of it_final_as91 occurs 0,
             anlkl(8),
             bukrs(4),
             anln1 like anla-anln1,
             anln2 like anla-anln2,
             txt50 like anla-txt50,
             txa50 like anla-txa50,
             anlhtxt like anlh-anlhtxt,
             sernr like anla-sernr,
             invnr like anla-invnr,
             menge like anla-menge,
             meins like anla-meins,
             inken like anla-inken,
             ivdat like anla-ivdat,
             aktiv like anla-aktiv,
             gsber like anlz-gsber,
             kostl like anlz-kostl,
             kostlv like anlz-kostlv,
             werks like anlz-werks,
             stort like anlz-stort,
             raumn like anlz-raumn,
             txjcd like anlz-txjcd,
             ord41 like anla-ord41,
             ord44 like anla-ord44,
             gdlgrp like anla-gdlgrp,
             anlue like anla-anlue,
             lifnr(10),
             typbz(15),
             aibn1 like anla-aibn1,
             aibn2 like anla-aibn2,
            aibdt like anla-aibdt,
             posnr like anla-posnr,
            vmgli like anla-vmgli,
            invzu like anla-invzu,
            ernam like anla-ernam,
            erdat like anla-erdat,
    end of it_final_as91.
    data: it_download_as91 like it_final_as91 occurs 0
                                              with header line."#EC NEEDED
    data: begin of it_final_as92 occurs 0,
             anlkl(8),
             bukrs(4),
             anln1 like anla-anln1,
             anln2 like anla-anln2,
             deakt like anla-deakt,
             ernam like anla-ernam,
             erdat like anla-erdat,
             afabe like anlb-afabe,
             afasl like anlb-afasl,
             ndjar like anlb-ndjar,
             ndper like anlb-ndper,
              afabg like date,
             ndabj(3) type c,
             ndabp(3) type c,
            kansw like anlc-kansw,
           knafa like anlc-knafa,
            kaafa like anlc-kaafa,
    kanza like anlc-kanza,
    kaufw like anlc-kaufw,
    kinvz like anlc-kinvz,
    ksafa like anlc-ksafa,
    kmafa like anlc-kmafa,
      end of it_final_as92.
    data: it_download_as92 like it_final_as92 occurs 0
                                              with header line."#EC NEEDED
    data: begin of it_values occurs 0,
             anlkl(8),
             bukrs(4),
             anln1 like anla-anln1,
             anln2 like anla-anln2,
             deakt like anla-deakt,
             afabe like anlb-afabe,
            afasl like anlb-afasl,
             ndjar like anlb-ndjar,
             ndper like anlb-ndper,
             afabg like date,
             ndabj(3) type c,
             ndabp(3) type c,
             afabe_02 like anlb-afabe,
             afasl_02 like anlb-afasl,
             ndjar_02 like anlb-ndjar,
             ndper_02 like anlb-ndper,
              afabg_02 like date,
             ndabj_02 like anlc-ndabj,
             ndabp_02 like anlc-ndabp,
            kansw01 like anlc-kansw,
           knafa01 like anlc-knafa,
            kaafa01 like anlc-kaafa,
              kansw02 like anlc-kansw,
           knafa02 like anlc-knafa,
            kaafa02 like anlc-kaafa,
              kansw03 like anlc-kansw,
           knafa03 like anlc-knafa,
            kaafa03 like anlc-kaafa,
              kansw04 like anlc-kansw,
           knafa04 like anlc-knafa,
            kaafa04 like anlc-kaafa,
              kansw05 like anlc-kansw,
           knafa05 like anlc-knafa,
            kaafa05 like anlc-kaafa,
           kansw06 like anlc-kansw,
           knafa06 like anlc-knafa,
           kaafa06 like anlc-kaafa,
           kansw07 like anlc-kansw,
           knafa07 like anlc-knafa,
           kaafa07 like anlc-kaafa,
           kansw08 like anlc-kansw,
           knafa08 like anlc-knafa,
           kaafa08 like anlc-kaafa,
           kansw09 like anlc-kansw,
           knafa09 like anlc-knafa,
           kaafa09 like anlc-kaafa,
    kanza01 like anlc-kanza,
    kaufw01 like anlc-kaufw,
    kinvz01 like anlc-kinvz,
    ksafa01 like anlc-ksafa,
    kmafa01 like anlc-kmafa,
      end of it_values.
    data: it_values_xls like it_values occurs 0
                                       with header line."#EC NEEDED
    data: begin of it_itab1 occurs 0,
           bukrs like anla-bukrs,
           anlkl like anla-anlkl,
           anln1 like anla-anln1,
             anln2 like anla-anln2,
           txt50 like anla-txt50,
           txa50 like anla-txa50,
           invnr like anla-invnr,
           ktogr like anla-ktogr,
           sernr like anla-sernr,
           menge like anla-menge,
           meins like anla-meins,
           ivdat like anla-ivdat,
           inken like anla-inken,
           aktiv like anla-aktiv,
           deakt like anla-deakt,
           zugdt like anla-zugdt,
           zujhr like anla-zujhr,
           zuper like anla-zuper,
           gdlgrp like anla-gdlgrp,
           anlue like anla-anlue,
           xafabch like anla-xafabch,
           aibn1 like anla-aibn1,
           aibn2 like anla-aibn2,
           aibdt like anla-aibdt,
           posnr like anla-posnr,
           ord41 like anla-ord41,
            ord44 like anla-ord44,
            vmgli like anla-vmgli,
             invzu like anla-invzu,
             typbz like anla-typbz,
             lifnr like anla-lifnr,
             ernam like anla-ernam,
             erdat like anla-erdat,
          end of it_itab1.
    data: begin of it_itab2 occurs 0,
            bukrs like anlz-bukrs,
            anln1 like anlz-anln1,
             anln2 like anla-anln2,
            bdatu like anlz-bdatu,
            werks like anlz-werks,
            gsber like anlz-gsber,
            kostl like anlz-kostl,
            kostlv like anlz-kostlv,
            stort like anlz-stort,
            raumn like anlz-raumn,
            txjcd like anlz-txjcd,
            ipsnr like anlz-ipsnr,
          end of it_itab2.
    data: begin of it_itab3 occurs 0,
            bukrs like anlh-bukrs,
            anln1 like anlh-anln1,
            anlhtxt like anlh-anlhtxt,
           end of it_itab3.
    data: begin of it_itab4 occurs 0,
            bukrs like anlb-bukrs,
            anln1 like anlb-anln1,
             anln2 like anla-anln2,
            afabe like anlb-afabe,
            bdatu like anlb-bdatu,
            afasl like anlb-afasl,
            ndjar like anlb-ndjar,
            ndper like anlb-ndper,
            afabg like anlb-afabg,
            ndurj like anlb-ndurj,
            ndurp like anlb-ndurp,
            umjar like anlb-umjar,
            safbg like anlb-safbg,
            zinbg like anlb-zinbg,
            inbda like anlb-inbda,
            end of it_itab4.
    data: begin of it_itab5 occurs 0,
           bukrs like anlc-bukrs,
           anln1 like anlc-anln1,
             anln2 like anla-anln2,
           gjahr like anlc-gjahr,
           afabe like anlc-afabe,
           zujhr like anlc-zujhr,
           zucod like anlc-zucod,
           ndabj like anlc-ndabj,
           ndabp like anlc-ndabp,
           kansw like anlc-kansw,
           knafa like anlc-knafa,
           kaafa like anlc-kaafa,
           ksafa like anlc-ksafa,
           andsj like anlc-andsj,
           andsp like anlc-andsp,
    kanza like anlc-kanza,
    kaufw like anlc-kaufw,
    kinvz like anlc-kinvz,
    kmafa like anlc-kmafa,
          end of it_itab5.
    ALV DECLARATIONS
    *--declarations for Xls sheet header field names
    data: begin of it_head occurs 0,
    column(70).
    data: end of it_head.
    data: begin of it_head1 occurs 0,
    column(70).
    data: end of it_head1.
    *--type declarations for field catalog for basic report
    data: it_fldcat_head  type slis_t_fieldcat_alv,
          wa_fldcat_head type slis_fieldcat_alv."#EC NEEDED
    data : w_field type slis_fieldcat_alv."#EC NEEDED
    data: it_fldcat_head1  type slis_t_fieldcat_alv,
          wa_fldcat_head1 type slis_fieldcat_alv."#EC NEEDED
    *--type declarations for layout design
    data: wa_layout type slis_layout_alv.
    *--type declarations for list header on grid
    *data: top_of_page type slis_t_listheader.
    *--declaration of variables
    data : w_repid like sy-repid.
    **selection-screen
    select-options: s_bukrs for anla-bukrs,
                    s_anln1 for anla-anln1.
    select-options: s_deakt for anla-deakt,
                    s_gjahr for anlc-gjahr obligatory,
                    s_anlkl for anla-anlkl,
                    s_date for anla-aktiv.
    *selection-screen
    selection-screen begin of block blk1 with frame title  text-022.
    selection-screen begin of line.
    parameters : r1 radiobutton group g1 default 'X'.
    selection-screen comment 20(50) text-020.
    selection-screen end of line.
    selection-screen begin of line.
    parameters : r2 radiobutton group g1.
    selection-screen comment 20(50) text-021.
    selection-screen end of line.
    selection-screen end of block blk1.
    selection-screen begin of block blk2 with frame title  text-023.
    select-options: s_ernam for anla-ernam,
                       s_erdat for anla-erdat .
    selection-screen end of block blk2.
    *--INITIALIZATION
    initialization.
      w_repid = sy-repid.
    at selection-screen.
      if r1 = 'X'.
        perform selection_screen_validation.
      endif.
      if r2 = 'X'.
        perform selection_screen_validation.
      endif.
    *--START-OF-SELCTION
    start-of-selection.
      if r1 = 'X'.
        perform populate-data.
        perform fill_finaldata.
       perform comment_build using top_of_page.
        perform xls_output.
        perform download.
      endif.
      if r2 = 'X'.
        perform populate-data.
        perform fill_finaldata.
        perform fill_as92data.
        perform putdata_horizontal.
        perform xls_output_as92.
        perform download_as92.
      endif.
    *--END-OF-SELCTION
    end-of-selection.
      if r1 = 'X'.
        perform build_layout.
        perform build_fieldcatalog.
       perform top_of_page.
        perform list-display.
      endif.
      if r2 = 'X'.
        perform build_layout.
        perform build_fieldcatalog1.
        perform list-display1.
      endif.
    *&      Form  SELECTION_SCREEN_VALIDATION
          text
    -->  p1        text
    <--  p2        text
    form selection_screen_validation.
    *--validating originating company code
      data: l_bukrs like anla-bukrs."#EC NEEDED
      if not s_bukrs[] is initial.
        select single bukrs from anla
               into l_bukrs
               where bukrs in s_bukrs.
        if sy-subrc <> 0.
          message e000 with text-001 .
        endif.
      endif.
    *--validating originating main asset no.
      data: l_anln1 like anla-anln1."#EC NEEDED
      if not s_anln1[] is initial.
        select single anln1 from anla
               into l_anln1
               where anln1 in s_anln1.
        if sy-subrc <> 0.
          message e000 with text-002 .
        endif.
      endif.
    *--validating originating Deactivation date
      data: l_deakt like anla-deakt."#EC NEEDED
      if not s_deakt[] is initial.
        select single deakt from anla
               into l_deakt
               where deakt in s_deakt.
        if sy-subrc <> 0.
          message e000 with text-004 .
        endif.
      endif.
    *--validating originating asset class.
      data: l_anlkl like anla-anlkl."#EC NEEDED
      if not s_anlkl[] is initial.
        select single anlkl from anla
               into l_anlkl
               where anlkl in s_anlkl.
        if sy-subrc <> 0.
          message e000 with text-006 .
        endif.
      endif.
    *--validating originating Date
      data: l_date like anla-aktiv."#EC NEEDED
      if not s_date[] is initial.
        select single aktiv from anla
               into l_date
               where aktiv in s_date.
        if sy-subrc <> 0.
          message e000 with text-007 .
        endif.
      endif.
    *--validating originating Fiscal year which first acquisition was posted
      data: l_gjahr like anlc-gjahr."#EC NEEDED
      if not s_gjahr[] is initial.
        select single gjahr from anlc
               into l_gjahr
               where gjahr in s_gjahr.
        if sy-subrc <> 0.
          message e000 with text-008.
        endif.
      endif.
      data: l_ernam like anla-ernam."#EC NEEDED
      if not s_ernam[] is initial.
        select single ernam from anla
               into l_ernam
               where ernam in s_ernam.
        if sy-subrc <> 0.
          message e000 with text-009.
        endif.
      endif.
      data: l_erdat like anla-erdat."#EC NEEDED
      if not s_erdat[] is initial.
        select single erdat from anla
               into l_erdat
               where erdat in s_erdat.
        if sy-subrc <> 0.
          message e000 with text-010.
        endif.
      endif.
    endform.                    " SELECTION_SCREEN_VALIDATION
    *&      Form  POPULATE-DATA
          text
    -->  p1        text
    <--  p2        text
    form populate-data.
      select bukrs
             anlkl
             anln1
             anln2
             txt50
             txa50
             invnr
             ktogr
             sernr
             menge
             meins
             ivdat
             inken
             aktiv
             deakt
             zugdt
             zujhr
             zuper
             gdlgrp
             anlue
             xafabch
             aibn1
             aibn2
             aibdt
             posnr
             ord41
             ord44
             vmgli
             invzu
             typbz
             lifnr
             ernam
             erdat
            from anla
                into table it_itab1
                where anlkl in s_anlkl and
                      anln1 in s_anln1 and
                      deakt in s_deakt and
                      bukrs in s_bukrs and
                      aktiv in s_date.
      if sy-subrc ne 0.
        message e000 with 'Data does not exist'(094).
      endif.
      if not it_itab1[] is initial.
        select bukrs
               anln1
               anln2
               bdatu
               werks
               gsber
               kostl
               kostlv
               stort
               raumn
               txjcd
               ipsnr
               from anlz
               into table it_itab2
               for all entries in it_itab1
               where bukrs = it_itab1-bukrs and
                     anln1 = it_itab1-anln1 and
                    anln2 = it_itab1-anln2.
                      anln2 = '0000'.
        if sy-subrc ne 0.
          message e000 with 'Data does not exist'(094).
        endif.
      endif.
      if not it_itab2[] is initial.
        select bukrs
               anln1
               anlhtxt
               from anlh
               into table it_itab3
        for all entries in it_itab2
        where bukrs = it_itab2-bukrs and
              anln1 = it_itab2-anln1.
        if sy-subrc ne 0.
          message e000 with 'Data does not exist'(094).
        endif.
      endif.
      if not it_itab1[] is initial.
        select bukrs
        anln1
        anln2
        afabe
        bdatu
        afasl
        ndjar
        ndper
        afabg
        ndurj
        ndurp
        umjar
        safbg
        zinbg
        inbda
        from anlb
        into table it_itab4
        for all entries in it_itab1
        where bukrs = it_itab1-bukrs and
              anln1 = it_itab1-anln1 and
             anln2 = it_itab1-anln2.
               anln2 = '0000'.
        if sy-subrc ne 0.
          message e000 with 'Data does not exist'(094).
        endif.
      endif.
      sort it_itab4  by bukrs anln1 anln2 afabe.
      if not it_itab4[] is initial.
        select bukrs
              anln1
              anln2
             gjahr
            afabe
            zujhr
            zucod
             ndabj
             ndabp
             kansw
             knafa
             kaafa
             ksafa
             andsj
             andsp
             kanza
    kaufw
    kinvz
    kmafa
             from anlc
             into table it_itab5
             for all entries in it_itab4
             where bukrs = it_itab4-bukrs and
                anln1 = it_itab4-anln1 and
               anln2 = it_itab4-anln2 and
                anln2 = '0000' and
                gjahr in s_gjahr.
        if sy-subrc ne 0.
          message e000 with 'Data does not exist'(094).
        endif.
      endif.
      sort it_itab5 by bukrs anln1 anln2 ndabj ndabp.
    endform.                    " POPULATE-DATA
    *&      Form  FILL_FINALDATA
          text
    -->  p1        text
    <--  p2        text
    form fill_finaldata.
      loop at it_itab5.
        loop at it_itab4 where bukrs = it_itab5-bukrs and
                            anln1 = it_itab5-anln1 and
                            anln2 = it_itab5-anln2 and
                            afabe = it_itab5-afabe.
          it_final-afabe = it_itab4-afabe.
          it_final-afasl = it_itab4-afasl.
          it_final-ndjar = it_itab4-ndjar.
          it_final-ndper = it_itab4-ndper.
          it_final-afabg = it_itab4-afabg.
          it_final-umjar = it_itab4-umjar.
          it_final-safbg = it_itab4-safbg.
          it_final-inbda = it_itab4-inbda.
          it_final-ndabj = it_itab5-ndabj.
          it_final-ndabp = it_itab5-ndabp.
          it_final-kansw = it_itab5-kansw.
          it_final-knafa = it_itab5-knafa.
          it_final-kaafa = it_itab5-kaafa.
          it_final-andsj = it_itab5-andsj.
          it_final-andsp = it_itab5-andsp.
          it_final-kanza = it_itab5-kanza.
          it_final-kaufw = it_itab5-kaufw.
          it_final-kinvz = it_itab5-kinvz.
          it_final-ksafa = it_itab5-ksafa.
          it_final-kmafa = it_itab5-kmafa.
          read table it_itab1 with key   bukrs = it_itab5-bukrs
                                      anln1 = it_itab5-anln1
                                      anln2 = it_itab5-anln2.
          if sy-subrc = 0.
            it_final-anlkl = it_itab1-anlkl.
            it_final-anln1 = it_itab1-anln1.
            it_final-anln2 = it_itab1-anln2.
            it_final-bukrs = it_itab1-bukrs.
            it_final-txt50 = it_itab1-txt50.
            it_final-txa50 = it_itab1-txa50.
            it_final-invnr = it_itab1-invnr.
            it_final-sernr = it_itab1-sernr.
            it_final-menge = it_itab1-menge.
            it_final-meins = it_itab1-meins.
            it_final-ivdat = it_itab1-ivdat.
            it_final-inken = it_itab1-inken.
            it_final-aktiv = it_itab1-aktiv.
            it_final-deakt = it_itab1-deakt.
            it_final-gdlgrp = it_itab1-gdlgrp.
            it_final-anlue = it_itab1-anlue.
            it_final-aibn1 = it_itab1-aibn1.
            it_final-aibn2 = it_itab1-aibn2.
            it_final-aibdt = it_itab1-aibdt.
            it_final-ord41 = it_itab1-ord41.
            it_final-ord44 = it_itab1-ord44.
            it_final-vmgli = it_itab1-vmgli.
            it_final-typbz = it_itab1-typbz.
            it_final-lifnr = it_itab1-lifnr.
            it_final-posnr = it_itab1-posnr.
            it_final-invzu = it_itab1-invzu.
          endif.
          read table it_itab2 with key   bukrs = it_itab5-bukrs
                                    anln1 = it_itab5-anln1
                                    anln2 = it_itab5-anln2.
          if sy-subrc = 0.
            it_final-werks = it_itab2-werks.
            it_final-gsber = it_itab2-gsber.
            it_final-kostl = it_itab2-kostl.
            it_final-kostlv = it_itab2-kostlv.
            it_final-stort = it_itab2-stort.
            it_final-raumn = it_itab2-raumn.
            it_final-txjcd = it_itab2-txjcd.
          endif.
          read table it_itab3 with key  bukrs = it_itab5-bukrs
                                     anln1 = it_itab5-anln1.
          if sy-subrc = 0.
            it_final-anlhtxt = it_itab3-anlhtxt.
          endif.
          append it_final.
          clear it_final.
        endloop.
      endloop.
      loop at it_final.
        move-corresponding it_final to it_final_as91.
        append it_final_as91.
        clear it_final_as91.
      endloop.
      delete adjacent duplicates from it_final_as91 comparing anlkl bukrs
      anln1 anln2.
      it_download_as91[] = it_final_as91[].
    endform.                    " FILL_FINALDATA
    *&      Form  BUILD_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    form build_layout.
      wa_layout-zebra = 'X'.
    endform.                    " BUILD_LAYOUT
    *&      Form  BUILD_FIELDCATALOG
          text
    -->  p1        text
    <--  p2        text
    form build_fieldcatalog.
      if it_fldcat_head is initial.
        v_pos = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ANLKL'.
        wa_fldcat_head-seltext_l = 'Asset Class'(093).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'BUKRS'.
        wa_fldcat_head-seltext_l = 'Company'(092).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ANLN1'.
        wa_fldcat_head-seltext_l = 'Asset No'(091).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ANLN2'.
        wa_fldcat_head-seltext_l = 'Asset Sub No'(090).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'TXT50'.
        wa_fldcat_head-seltext_l = 'Asset Des.'(089).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'TXA50'.
        wa_fldcat_head-seltext_l = 'Asset Des.'(088).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ANLHTXT'.
        wa_fldcat_head-seltext_l = 'Asset main no txt'(087).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'SERNR'.
        wa_fldcat_head-seltext_l = 's.no/Expl no.'(086).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'INVNR'.
        wa_fldcat_head-seltext_l = 'Inv No'(085).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'MENGE'.
        wa_fldcat_head-seltext_l = 'Qtty'(084).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'MEINS'.
        wa_fldcat_head-seltext_l = 'Units'(083).
        append wa_fldcat_head to it_fldcat_head.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'INKEN'.
        wa_fldcat_head-seltext_l = 'Inv indi.'(082).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'IVDAT'.
        wa_fldcat_head-seltext_l = 'Last inv date'(081).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'AKTIV'.
        wa_fldcat_head-seltext_l = 'Asset Capital date'(080).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'GSBER'.
        wa_fldcat_head-seltext_l = 'Busin. Area'(079).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'KOSTL'.
        wa_fldcat_head-seltext_l = 'cost centre'(078).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'KOSTLV'.
        wa_fldcat_head-seltext_l = 'CC respon.for asset'(077).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'WERKS'.
        wa_fldcat_head-seltext_l = 'Plant'(076).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'STORT'.
        wa_fldcat_head-seltext_l = 'Asset location'(075).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'RAUMN'.
        wa_fldcat_head-seltext_l = 'Room'(074).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'TXJCD'.
        wa_fldcat_head-seltext_l = 'Tax. Jur.'(073).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ORD41'.
        wa_fldcat_head-seltext_l = 'Evaluation Grp 1'(072).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ORD44'.
        wa_fldcat_head-seltext_l = 'Evaluation Grp 4'(071).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'GDLGRP'.
        wa_fldcat_head-seltext_l = 'Evalu. group 5'(070).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'ANLUE'.
        wa_fldcat_head-seltext_l = 'Asset Super No'(069).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'LIFNR'.
        wa_fldcat_head-seltext_l = 'Vendor Acct. No.'(068).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'TYPBZ'.
        wa_fldcat_head-seltext_l = 'Reference no'(067).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'AIBN1'.
        wa_fldcat_head-seltext_l = 'Original Asset Trans.'(066).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'AIBN2'.
        wa_fldcat_head-seltext_l = 'Original Asset Trans.'(065).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'AIBDT'.
        wa_fldcat_head-seltext_l = 'Trans. Asset'(064).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'POSNR'.
        wa_fldcat_head-seltext_l = 'WBS Elt. Invt. Proj.'(063).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'VMGLI'.
        wa_fldcat_head-seltext_l = 'Property clas.key'(062).
        append wa_fldcat_head to it_fldcat_head.
       V_POS = 0.
        v_pos = v_pos + 1.
        w_field-col_pos = v_pos.
        wa_fldcat_head-tabname = 'it_FINAL_AS91'.
        wa_fldcat_head-fieldname = 'INVZU'.
        wa_fldcat_head-seltext_l = 'suppl.inv spec.'(061).
        append wa_fldcat_head to it_fldcat_head.
      endif.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  COMMENT_BUILD
          text
         -->P_TOP_OF_PAGE  text
    *form comment_build using top_of_page type slis_t_listheader.
    data: ls_line type slis_listheader.
    ****Header
    clear : ls_line.
    ls_line-typ = 'H'.
    LS_LINE-KEY: not used for this type
    ls_line-info = 'ASSET MASTER DATA LIST'.
    append ls_line to top_of_page.
    ****Selection
    clear ls_line.
    ls_line-typ = 'S'.
    ls_line-key = 'Key 1'.
    ls_line-info = 'Asset Records'.
    append ls_line to top_of_page.
    ****Action
    clear ls_line.
    ls_line-typ = 'A'.
    LS_LINE-KEY: not used for this type
    ls_line-info = 'for AS91'.
    append ls_line to top_of_page.
    *endform. "comment_build
          FORM top_of_page                                              *
    *form top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
          exporting
               i_logo             = 'ENJOYSAP_LOGO'
               it_list_commentary = top_of_page.
    *endform. "top_of_page
    *&      Form  LIST-DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form list-display.
    wa_layout-colwidth_optimize = 'X'.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program     = w_repid
               i_callback_top_of_page = 'TOP_OF_PAGE'
                is_layout              = wa_layout
                it_fieldcat            = it_fldcat_head
               i_background_id        = 'ALV_BACKGROUND'
           tables
                t_outtab               = it_final_as91
           exceptions
                program_error          = 1
                others                 = 2.
      if sy-subrc <> 0.
    write:/'No Top of Page'(098).
      endif.
    endform.                    " LIST-DISPLAY
    *&      Form  DOWNLOAD
          text
    -->  p1        text
    <--  p2        text
    form download.
      perform setup_header.
      call function 'DOWNLOAD'
           exporting
                filetype                = 'DAT'
           tables
                data_tab                = it_download_as91
                fieldnames              = it_head
           exceptions
                invalid_filesize        = 1
                invalid_table_width     = 2
                invalid_type            = 3
                no_batch                = 4
                unknown_error           = 5
                gui_refuse_filetransfer = 6
                customer_error          = 7
                others                  = 8.
      if sy-subrc <> 0.
    write:/'Error in file Type'(097).
      endif.
    endform.                    " DOWNLOAD
    *&      Form  setup_header
          text

  • How To Download rsa1 Screen Into Excel

    Hi
    I need to document our system .
    is there any way to copy\transfer this kind of information  to excel ??
    Thx
    Alex

    You download the views from metadata repository.
    Go to RSA1 -- Meta data repository
    Look for the onject of your interest.
    From the graphical display select the option you want.
    Right click the graphical pic and you'll get the option u r looking for

  • How to get a list of displayed columns from a UIX read only table

    I am using JDev 9.0.5.2 ADF UIX. Is there a way to get all the columns and/or column labels displayed in a UIX read only table? I would like to be able to do this in my DataForwardAction.

    Please don't post the same question multiple times.

  • HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE

    Hi SAP Gurus,
        I would like to ask if you have any Function Module or codes on how to download SAP Output into Excel file. Thanks! Hope you could help me.

    You can transfer the contents of internal table to excel using this code..
    data: begin of itab occurs 0,
          vbeln like vbak-vbeln,
          posnr like vbap-posnr,
          end of itab.
    select vbeln
           posnr
           from vbap
           up to 20 rows
           into table itab.
    * EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    * handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_WORK  TYPE OLE2_OBJECT,
          H_SHEET TYPE OLE2_OBJECT,
          H_CELL  TYPE OLE2_OBJECT,
          V_COL   LIKE SY-TABIX.     " column number of the cell
    DATA:
      V_STEP(30),
      V_FILE LIKE RLGRAP-FILENAME.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = 'Creating Excel...'
           EXCEPTIONS
                OTHERS     = 1.
    * start Excel
      V_STEP = 'Starting Excel'.
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    *  CALL METHOD OF H_EXCEL 'OPEN' EXPORTING  #1 = 'C:DMC_REC.XLS'.
    *  PERFORM ERR_HDL.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = 'Adding Data to Excel...'
           EXCEPTIONS
                OTHERS     = 1.
    * Get the list of workbooks
      V_STEP = 'Preaparing Excel'.
      CALL METHOD OF H_EXCEL 'WORKBOOKS' = H_WORK.
      PERFORM ERR_HDL.
    ** Add new workbook (create a file)
      CALL METHOD OF H_WORK 'ADD'.
      PERFORM ERR_HDL.
    * Get the created worksheet
    ************************Sheet Number
      CALL METHOD OF H_EXCEL 'WORKSHEETS' = H_SHEET EXPORTING #1 = 3.
    ************************Sheet Number
      PERFORM ERR_HDL.
    * Activate (select) the first sheet
      CALL METHOD OF H_SHEET 'ACTIVATE'.
      PERFORM ERR_HDL.
    * tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
    *           PERCENTAGE = 0
               TEXT       = 'Adding Data to Excel...'
           EXCEPTIONS
                OTHERS     = 1.
    * output column headings to active Excel sheet
      V_STEP = 'Adding data to Excel'.
      LOOP AT ITAB.
        V_COL = SY-TABIX.
        PERFORM FILL_CELL USING 1 V_COL ITAB-vbeln.
        PERFORM FILL_CELL USING 2 V_COL ITAB-posnr.
      ENDLOOP.
      V_STEP = 'Releasing Excel'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
      H_EXCEL-HANDLE = -1.
    *&      Form  ERR_HDL
    *       text
    *  -->  p1        text
    FORM ERR_HDL.
      IF SY-SUBRC <> 0.
        WRITE: / 'Error in processing Excel File:', V_STEP.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL
    *&      Form  FILL_CELL
    *       text
    *      -->P_1      text
    *      -->P_1      text
    *      -->P_1      text
    FORM FILL_CELL USING  ROW COL VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_CELL
                     EXPORTING #1 = ROW #2 = COL.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_CELL 'Value' = VAL .
      PERFORM ERR_HDL.
    ENDFORM.                    " FILL_CELL

  • 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

  • User request to explore the possibility of downloading the distribution lists into excel for maintenance in t-code SO23.

    Hi Experts,
    There is a requirement from user that  "To explore the possibility of downloading the distribution lists
    into excel for maintenance in t-code SO23 ".
    Kindly provide your valuable informations/assistance in this regard.
    Madhavan K

    This Applesctipt will add comma's to the file count:
    (Copy into Applescript Editor, and Save as File Format: App, then just click the App to run)
    set x to choose folder with prompt "Choose Folder to Count Files" default location alias (the path to pictures folder as text)
    set filecount to do shell script "find " & POSIX path of x & " ! -type d ! \\( -name \".*\" -or -name \"Icon*\" \\) | wc -l"
    display dialog "File Count: " & comma_delimit(trim(filecount))
    on trim(someText)
              repeat until someText does not start with " "
                        set someText to text 2 thru -1 of someText
              end repeat
              repeat until someText does not end with " "
                        set someText to text 1 thru -2 of someText
              end repeat
              return someText
    end trim
    on comma_delimit(this_number)
              set this_number to this_number as string
              if this_number contains "E" then set this_number to number_to_text(this_number)
              set the num_length to the length of this_number
              set the this_number to (the reverse of every character of this_number) as string
              set the new_num to ""
              repeat with i from 1 to the num_length
                        if i is the num_length or (i mod 3) is not 0 then
                                  set the new_num to (character i of this_number & the new_num) as string
                        else
                                  set the new_num to ("," & character i of this_number & the new_num) as string
                        end if
              end repeat
              return the new_num
    end comma_delimit

  • 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

  • Some problem of download BSP data into excel using  cl_bsp_utility= download

    Hello Experts,
    I have read the blog of thomas.jung for download bsp data into excel, and it's working correct, and after some try and error, now I can download the excel with multi sheets.It's all cool except one thing.....when I add a button on the standard screen of the supplier qualification of the slc to download the excel file, after the popinp up screen, the standard screen can't do any operation at all......there are no any error message and the downloaded file is all correct .
    Does any one know what can I do?

    any ideas?
    By the way, after some research, maybe the issue was caused by the setup of the button, but I don't know how to fix it...0rz
    the standard code for buttton is
    lv_id = mv_id && '>display'.
    lo_edit_display_button = cl_thtmlb_button=>factory( id       = lv_id
                                                       text     = lv_button_text
                                                   tooltip  = lv_button_text
                                                   enabled  = 'TRUE'
                                                  onclick  = lv_button_action ).
    WHILE io_page_context->element_process( element = lo_edit_display_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.
    so I copy it and modify like this:
    lv_id = mv_id && '>download'.
        lo_download_excel_button = cl_thtmlb_button=>factory( id       = lv_id
                                                            text     = w_text
                                                        tooltip  = w_text
                                                        enabled  = 'TRUE'
        onclick  = /srmsm/if_ql_ext_ui_c=>ZC_ACTION_DOWNLOAD_EXCEL
    WHILE io_page_context->element_process( element = lo_download_excel_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.

  • How to Download displayed output to Excel Using Bsp Application

    Hi Experts,
    please give me some idea because I am New In BSP.
    How to Download displayed output to Excel Using Bsp Application.
    If any sample code please do send me.
    In my condition I am getting data in  2-3 table view formats on one page and i want download that in Excel.
    please help me.
    Regards & Thanks,
    Yogesh

    Hi,
    This is more a question for the BSP forum.
    Anyway, as such it's realy easy since you can use HTML in order to import to Excel. All you need to do is add
    runtime->server->response->set_header_field( name = 'Contnet-Type'
    value = 'application/vnd.ms-excel' ).
    runtime->server->response->delete_header_field( name = 'Cache-Control' ).
    runtime->server->response->delete_header_field( name = 'Expires' ).
    runtime->server->response->delete_header_field( name = 'Pragma' ).
    Also check threads like
    Download BSP data into Excel
    export bsp-table to excel
    Export BSP Table to Excel
    Eddy
    PS. Reward useful answers and earn points yourself

  • How to download BOM list from tcode CS03?

    Hi,
    As we all know, we can display the material's BOM via tcode CS03, but how to download the list to local PC?  
    Please kindly advise.
    Thanks abd best regards.

    Dear Mr.TT,
    You can not download the BOM using CS03,If you want to save the same into
    your PC as a local file,get it done using T codes,
    CS11 - Display BOM Level by Level.
    CS12 - Multilevel BOM.
    CS13 - Summarized BOM.
    After executing in any one of these T codes,you can find button named Local File
    (Control ShiftF9) or in the menu's Extra's ---List ---Export -
    choose any option
    as you need.
    <b>If you want from tables use tables MAST,STPO,STKO.</b>
    <b><u>Reward points and close this thread.</u></b>
    Regards
    Mangal

  • How to extract the data into Excel / PDF from SAP

    Hi,
    We have spool number of a report output.
    We want to extract the data into Excel / PDF from SAP directly...
    Plz guide...

    Hi ,
    Please check this [Thread|HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE;. Hope your problem will be solved.
    You can check [this also.|http://wiki.sdn.sap.com/wiki/display/sandbox/ToConvertSpoolDataintoPDFandExcelFormatandSenditinto+Mail]
    Thanks,
    Abhijit

  • Problem when we dowload spool list into excel.

    Hello Gurus,
    I have developed an custom report, The output contains 15 columns. When i run the report in foreground the output will be displayed in correct format also when i download the report list into excel(List->Save/Send->File) then the records will be downloaded in proper format(Each record under respective column heading).
    But when the report is scheduled in background the spool list(SP01) is displayed in the proper format. But when I download this into excel(SppolRequest->Forward->SaveToLocal) . The excel data will be in improper format and all record value are not under respective column heading.
    Can anyone advice me.
    Thanks and regards,
    Vinod

    Hi,
      Use the FM 'EXCEL_OLE_STANDARD_DAT'.
    In this FM populate the tables parameter 'fieldnames' to get each cloumn below the heading correctly.

  • DOWNLOAD ALV LIST TO EXCEL AUTOMATICALLY

    Hi all,
    Urgent Requirement:
    Whenever a standard report is being run which displays the ALV output we need to download the same into excel automatically. We know we can download manually using list dowmload options.
    My requrement is, are there any setting in SAP where we can automatically download the ALV list output of standard program into Excel.
    All the relevant answers will be awarded *******

    Hi Ravikumar,
    Good  Check the following documentation
    Once the report gets executed you can code the following in your report
    Please use the following FM
    CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
    EXPORTING
    I_FIELD_SEPERATOR =
    I_LINE_HEADER =
    i_filename =
    I_APPL_KEEP = ' '
    tables
    i_tab_sap_data =
    CHANGING
    I_TAB_CONVERTED_DATA =
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Another FM –
    MS_EXCEL_OLE_STANDARD_DAT
    A simple option:
    a) form download_file .
    call function 'WS_EXCEL'
    importing
    filename = excel_name
    tables
    data = itab.
    b) call function 'WS_DOWNLOAD'
    exporting
    filename = o_file
    filetype = 'DAT'
    tables
    data_tab = i_tab
    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
    no_authority = 10
    others = 11.
    if sy-subrc = 0.
    message 'File is downloaded successfully' type 'I'.
    endif.
    Good Luck and thanks
    AK

Maybe you are looking for