Download ALV into excel file

Hi experts,
               I used subtotals in ALV.first three columns I claculated based on the addition of individual column.In fourth column i calculated the value based on three calculated values ...It is  not problem.
          when i download this into excel file the original value is only coming .the calculated value i.e) calculated based on three values didnt get displayed in excel file..Help me please...
Thank u,
Manjula Devi.D

Hi.
I find that
List > Export > Spreadsheet
gives no subtotals, but
List > Export > Local File and then Spreadsheet
does give subtotals.
I find that
Views > Microsoft Excel
followed by
Save As
does give subtotals.
John

Similar Messages

  • Downloading ALV to excel file

    Hi all,
       i am trying to download ALV to excel file.
       but as the alv contains many fields,
       the row in the excel is automatically wrapped to the
       next row ..
       what i want is the row in excel should come as it is
       in the ALV (whole thing in one line) and should not wrap to next row
      Regards,
      Tarang

    Hi Shah,
    <b>
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'</b>
        EXPORTING
          I_CALLBACK_PROGRAM      = V_REPID
          I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
          IS_LAYOUT               = WA_LAYOUT
          I_SAVE                  = 'A'
          IT_FIELDCAT             = I_FLDCAT_HEAD
          IT_SORT                 = IT_SORT
          IT_EVENTS               = I_EVENTS
        TABLES
          T_OUTTAB                = IT_FINAL
        EXCEPTIONS
          PROGRAM_ERROR           = 1
          OTHERS                  = 2.
      IF SY-SUBRC = 0.
    <b>     CALL FUNCTION 'GUI_DOWNLOAD'</b>
         EXPORTING
          BIN_FILESIZE                    =
            FILENAME                        = 'C:\Documents and Settings\vikranthk\Desktop\vikranth.xls'
           FILETYPE                        = 'ASC'
          APPEND                          = ' '
          WRITE_FIELD_SEPARATOR           = ' '
          HEADER                          = '00'
          TRUNC_TRAILING_BLANKS           = ' '
          WRITE_LF                        = 'X'
          COL_SELECT                      = ' '
          COL_SELECT_MASK                 = ' '
          DAT_MODE                        = ' '
          CONFIRM_OVERWRITE               = ' '
          NO_AUTH_CHECK                   = ' '
          CODEPAGE                        = ' '
          IGNORE_CERR                     = ABAP_TRUE
          REPLACEMENT                     = '#'
          WRITE_BOM                       = ' '
          TRUNC_TRAILING_BLANKS_EOL       = 'X'
          WK1_N_FORMAT                    = ' '
          WK1_N_SIZE                      = ' '
          WK1_T_FORMAT                    = ' '
          WK1_T_SIZE                      = ' '
        IMPORTING
          FILELENGTH                      =
          TABLES
            DATA_TAB                        = it_final.
          FIELDNAMES                      =
        EXCEPTIONS
          FILE_WRITE_ERROR                = 1
          NO_BATCH                        = 2
          GUI_REFUSE_FILETRANSFER         = 3
          INVALID_TYPE                    = 4
          NO_AUTHORITY                    = 5
          UNKNOWN_ERROR                   = 6
          HEADER_NOT_ALLOWED              = 7
          SEPARATOR_NOT_ALLOWED           = 8
          FILESIZE_NOT_ALLOWED            = 9
    Thanks
    Vikranth Khimavath
    Message was edited by: Khimavath Vikranth

  • Reg: Download report into Excel file

    Hi All,
    While downloading the ALV report into excel file(System -> List -> Save -> Local file) or (List -> Export -> Local file), i cannot download full report in to excel. Even though the report contains just 200 rows(I can able to download about 90 lines).
    Some reports can able to download all the data, even the report is very big. Currently I am blind to solve, anyone can help me to solve this issue.
    Thanks in advance.

    The most elegant way of downloading ALV display data to EXCEL is displaying the excel in the SAP GUI screen itself.  Select "Excel in Place" and then save it from there. Before that you need to let the VB script of SAP know as trusted macro. This is done by opening a blank excel file then go to Tools > options > Security > Macro Security > Trusted Publishers (tab) > (check) Trust access to Visual Basic Project.  This activation is one time activation. Once you do this you can see ALV display exactly like in normal ALV with all the colors fields etc.

  • Problem in Download data into Excel File

    Hi Friends,
    I have one doubt on WDJ.
             I have got the data from the Back and display the data into Table UI Element. Depending upon po_status equals to OA Pending that time conf_Ship_date Column is Empty. That time we can Select All Checkbox Click on Download Button Excel file is not download. Why it not download? Conf_Ship_date Column is Empty. Conf_Ship_date Column is data available that time data download into Excel File.
    My Req: if Conf_Ship_date Column is empty that time click on Download that data will download in to Excel. In Excel Conf_Ship_date Column will display in NULL or 00.00.0000 Like this also.
    Code:ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date()); 
    This means I am getting date from PoDetails_OutTab(StockEle)this node and add this date to PoDetails_ExcelData(ExcelEle) this node.Finally the date will available in PoDetails_ExcelData this node. By Using this node I will download data.
    How to do this work?
    Regards
    Vijay

    Hi Arun,
    For Example in Table 4 rows and 14 columns data is available. Select all check boxes click on download button total 4 rows and 14 columns data is downloaded.
    Table 4 rows and 14 columns data is available. But in some cells data not available in that time I m getting null values from ECC System. That time I am not able to download.
    In Particularly this problem I am getting only date colums.
    So now I have develop this code
    public void onActiondownloadToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiondownloadToExcel(ServerEvent)
         IPrivatePO_Details_ResultView.IPoDetails_ExcelDataNode ExcelNode = wdContext.nodePoDetails_ExcelData();
         IPrivatePO_Details_ResultView.IPoDetails_ExcelDataElement ExcelEle; 
         IPrivatePO_Details_ResultView.IPoDetails_OutTabNode StockNode = wdContext.nodePoDetails_OutTab();
         IPrivatePO_Details_ResultView.IPoDetails_OutTabElement StockEle ;
         for(int i = 0 ;i<StockNode.size();i++)
         StockEle = StockNode.getPoDetails_OutTabElementAt(i);
         if(StockEle.getCheckBox()== true)
         ExcelEle = ExcelNode.createPoDetails_ExcelDataElement();// Create Element
         if(StockEle.getConf_Shp_Date()==null)
         java.sql.Date deliverydate1=new java.sql.Date(0,0,0);
         ExcelEle.setConf_Shp_Date(deliverydate1);
         else
         ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date()); 
    By using this code i have to download total Records but in this Conf_Shp_Date colums i am getting 31-12.1899 this output in Excel. But i need in Excel to print Null or 00.00.0000 like
         ExcelEle.setQuantity(StockEle.getQuantity());
         ExcelEle.setDeliv_Date(StockEle.getDeliv_Date());
         if(StockEle.getExpt_Shp_Date()==null)
         java.sql.Date deliverydate2=new java.sql.Date(0,0,0);
         ExcelEle.setExpt_Shp_Date(deliverydate2);
         else
         ExcelEle.setExpt_Shp_Date(StockEle.getExpt_Shp_Date());
         ExcelEle.setVendor_Material(StockEle.getVendor_Material());
         ExcelNode.addElement(ExcelEle);
         if(ExcelNode.size()>0)
         wdThis.wdGetCO_POPendingController().downloadData(wdContext.nodePoDetails_ExcelData());// This is for Downalod data Method
         wdThis.wdGetCO_POPendingController().DownLoadToExcel();// This is for Open Popup Window
         wdContext.nodePoDetails_ExcelData().invalidate();
         else
         wdComponentAPI.getMessageManager().reportException("Please select any one po item from the table",true);
        //@@end
    Regards
    Vijay
    Edited by: KalluriVijay on May 18, 2010 10:05 AM

  • Short dump when trying to download alv into excel

    Hi SAPAll.
    here i have got one alv report ,when executing this alv report it displays in correct way but the only problem is when i click on the icon(local file) which exists at standard tool bar at the top to dowbload into local excel file it is raising the runtime error as
      The current statement requires a character-type data object.
    at 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.
    ror analysis
      At the statment
           "STRLEN( obj )..."
      , only character-type data objects are supported at the argument
      position "obj".
      In this particular case, the operand "obj" has the non-charcter-type type
      "P".
    igger Location of Runtime Error
      Program                                 SAPLKKBL
      Include                                 LKKBLF99
      Row                                     3.948
      Module type                             (FORM)
      Module Name                             GEN_FIELD_OUT2
    Line  SourceCde
    3923 * Bei NUMC führende '0' und ' ' nicht berücksichtigen
    3924   elseif gs_fc-tech_form = 6.
    3925     write  to gs_out-hlpchar no-zero left-justified.
    3926     if gs_fc-just = 'R'.
    3927       condense gs_out-hlpchar.
    3928     endif.
    3929     gs_out-hlplen = strlen( gs_out-hlpchar ).
    3930   elseif gs_fc-tech_form = 11.                              "INS TECH11
    3931 *   Min. Ausgabelänge für ein Datum ist immer 8
    3932     if gs_fc-datatype = 'DATS'.                             "INS TECH11
    3933       gs_out-hlplen = 8.                                    "INS TECH11
    3934 *    Min. Ausgabelänge für eine Uhrzeit ist immer 6
    3935     elseif gs_fc-datatype = 'TIMS'.                         "INS TECH11
    3936       gs_out-hlplen = 6.                                    "INS TECH11
    3937     endif.                                                  "INS TECH11
    3938   elseif gs_fc-tech_form = 1 or gs_fc-tech_form = 90.
    3939 *   Überführung int. in ext. Format via Konvertierungsexit
    3940     if not gs_fc-convexit is initial or                     "INS TECH11
    3941        not gs_fc-inttype ca 'CN'.
    3942 *   elseif not gs_fc-convexit is initial.            "DEL TECH11
    will be waiting for quick response please respond at your discretion.
    regards.
    Varma
    Edited by: Thomas Zloch on Mar 11, 2010 11:48 AM

    hi suhas .
    the folliwing below is the code for alv and i had used 2 different structures for populating the data into alv
    FORM fieldcat_init  USING    p_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'ORDER'.
      ls_fieldcat-ref_tabname = 'st_proc_out'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_s   = 'ORDER NUMBER'.
      ls_fieldcat-seltext_m   = 'ORDER NUMBER'.
      ls_fieldcat-seltext_l   = 'ORDER NUMBER'.
      APPEND ls_fieldcat TO p_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   = 'P_ORDER'.
      ls_fieldcat-ref_tabname = 'st_proc_out'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_s   = 'P.O.NUMBER'.
      ls_fieldcat-seltext_m   = 'P.O.NUMBER'.
      ls_fieldcat-seltext_l   = 'P.O.NUMBER'.
      APPEND ls_fieldcat TO p_fieldcat.
    CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   ='LINE'.
      ls_fieldcat-ref_tabname = 'st_proc_out2'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_s   = 'Line Number'.
      ls_fieldcat-seltext_m   = 'Line Number'.
      ls_fieldcat-seltext_l   = 'Line Number'.
      APPEND ls_fieldcat TO p_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   ='MATNO'.
      ls_fieldcat-ref_tabname = 'st_proc_out2'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_s   = 'Mat.Number'.
      ls_fieldcat-seltext_m   = 'Mat.Number'.
      ls_fieldcat-seltext_l   = 'Mat.Number'.
      APPEND ls_fieldcat TO p_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-fieldname   ='MATERIAL'.
      ls_fieldcat-ref_tabname = 'st_proc_out2'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_s   = 'Mat Descrption'.
      ls_fieldcat-seltext_m   = 'Mat Descrption'.
      ls_fieldcat-seltext_l   = 'Mat Descrption'.
      APPEND ls_fieldcat TO p_fieldcat .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'YSDRO024C1'
          i_grid_title       = 'EXPORT ORDER REPORT'
          is_layout          = alv_layout
          it_fieldcat        = alv_fieldcat
          i_save             = 'A'
        TABLES
          t_outtab           = i_output
        EXCEPTIONS
          program_error      = 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.
      PERFORM  proc_print.
    FORM proc_print .
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos     = '1'.
      ls_fieldcat-fieldname   = 'ORDER'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_m   = 'ORDER NUMBER'.
      ls_fieldcat-ddictxt     = 'M'.
      APPEND ls_fieldcat TO alv_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-col_pos     = '2'.
      ls_fieldcat-fieldname   = 'P_ORDER'.
      ls_fieldcat-key         = 'X'.
      ls_fieldcat-seltext_m   = 'PO NUMBER'.
      ls_fieldcat-ddictxt     = 'M'.
      APPEND ls_fieldcat TO alv_fieldcat.
    regards,
    Varma

  • Error while downloading data into excel file.

    Hi,
        I have a requirement to download data available in xstring to excel file.
    I have a RFC which has export parameter 'file_data' of type xstring. When i call RFC
    from web dynpro abap application it gives data out pout in xstring format.
    I am opening excel file using that xstring data as below
    cl_wd_runtime_services=>attach_file_to_response(
    i_filename = 'file.xls'
    i_content = ls_data_source-data_source   ***[xstring data from RFC]
    i_mime_type = 'x-excel/application'
    i_in_new_window = abap_true ).
    But excel file not coming in correct format. its  giving an error while download
    excel file
    Error is
          " the file you are trying to open , 'file[1].xls', is in a different format than
    specified by the file extension. Verify that the file is not corrupted and is from
    a trusted source before opening the file. Do you want to open the file now? "
    If i click on 'YES' button file opening but not in proper excel format. Data is coming
    in tab delimiter format in excel file.
    Please suggest any solution for this problem.
    Thanks,
    Venkat.

    Hi Thomas,
    Following is the logic implemented in RFC which is giving XSTRING as export parameter
    STEP1      create a dynamic internal table
               Create field catalog for the table   using LVC_FIELDCATALOG_MERGE
                   CALL METHOD cl_alv_table_create=>create_dynamic_table
                        EXPORTING
                           it_fieldcatalog = it_fieldcat
                         IMPORTING
                           ep_table        = dyn_table.
                  CREATE  EXCEL SHEET BY SENDING FIELD CATALOG AND DATA TAB
    STEP2 # Convert text table to xstring.
            CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
              IMPORTING
                buffer   = l_content
              TABLES
                text_tab = lt_data_tab
              EXCEPTIONS
                failed   = 1
                OTHERS   = 2.
    STEP3  *# Psss Data to Netweaver
              PERFORM pass_data_to_nw USING is_import
                                      CHANGING es_attachment_metadata.

  • Download Alv into excel sheet according to variant fields

    Hi All,
    I have more than 100 fields in the ALV report, now i want to download the report according to the fields are choosen in the variant. I am getting all the fields in excel sheet but i need some fileds that is selected in the variant.
    Thanks in advance.
    Rudhir

    use your own excel button and program this steps:

    * Get the frontend fieldcatalog
    CALL METHOD go_grid->get_frontend_fieldcatalog
    IMPORTING
    et_fieldcatalog = lt_fieldcat.
    DELETE lt_fieldcat WHERE no_out EQ 'X'.

    *create dynamic table with the frontend fieldcatalog
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = lt_fieldcat
    IMPORTING
    ep_table = lt_data
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc EQ 0.
    ASSIGN lt_data->* TO <lt_table>.
    ENDIF.
    3° Fill the dynamic table
    4° export to excel using
    CALL FUNCTION 'XXL_SIMPLE_API'
    TABLES
    col_text = xmplt_v1
    data = <lt_table>
    online_text = xmplt_o1
    print_text = xmplt_p1
    EXCEPTIONS
    dim_mismatch_data = 1
    file_open_error       =2
    file_write_error      = 3
    inv_winsys            =4
    inv_xxl                   =5
    OTHERS                = 6.
    Check the complete example here

  • Function module to download data into excel file

    Hi Friends,
    Please tell me the function module name which popsup a popup box to specify a filename and the location and when clicking on the OK button, the file should be downloaded to the specified location.
    I need it ASAP.
    Thanks,
    Jaffer Ali.S

    Hi Shamshudeen,
    You have to use two funtion modules to acheive this.
    1. To get the file path from user.
    2. To download the excel sheet in prescribed path.
    For 1 use following code
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fpath .
        CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           program_name        = syst-cprog
           dynpro_number       = syst-dynnr
      FIELD_NAME          = ' '
         IMPORTING
           file_name           = p_fpath  .
    The file path will be stored in p_fpath.
    Now use GUI_DOWNLOAD function module and pass the file name p_fpath to it along with filetype as .xls
    Hope this helps you.
    Thanks,
    Arun

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • How to Download colours of ALV outout into Excel file ?

    Hi All,
    I have a requirement, Download ALV output into Excel file
    but the ALV output contains colors,
    I need to download as it is ALV output into Excel,
    Please guide me, how to do ?
    If it is not possible, Pls provide any other solution for this ?
    Appreciate your valuable answers,
    Thanks.
    Regards,
    Prasad.

    Hi,
    Instead of ALV,  ucan directly write the output to EXCEL along with the required attributes.  Find the below sample code. This might solve ur problem.
    Venkat.
    *& Report  Y_ALV_OLE
    REPORT  YALV_OLE.
    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
    h_c type ole2_object. " color
    DATA: FILENAME LIKE RLGRAP-FILENAME.
    tables: spfli.
    data h type i.
    table of flights
    data: it_t100 like T100 occurs 10 with header line.
    *& Event START-OF-SELECTION
    start-of-selection.
    read flights
    select *
    from t100
    up to 100 rows
    into table it_t100
    where SPRSL = sy-langu .
    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_cell using 1 1 1 200 'Language Key'.
    perform fill_cell using 1 2 1 200 'Application Area'.
    perform fill_cell using 1 3 1 200 'Message number'.
    perform fill_cell using 1 4 1 200 'Message text'.
    perform fill_cell using 1 5 1 200 'Dep. Time'.
    loop at it_t100.
    copy flights to active EXCEL sheet
    h = sy-tabix + 1.
    perform fill_cell using h 1 0 000145000 it_t100-SPRSL.
    perform fill_cell using h 2 0 246156138 it_t100-ARBGB.
    perform fill_cell using h 3 0 111230222 it_t100-MSGNR.
    perform fill_cell using h 4 0 130230230 it_t100-text.
    perform fill_cell using h 5 0 115115105 it_spfli-deptime.
    endloop.
    EXCEL FILENAME
    CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
    SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
    CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
    free object h_excel.
    perform err_hdl.
    FORM FILL_CELL *
    sets cell at coordinates i,j to value val boldtype bold *
    form fill_cell using i j bold col 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.
    set property of h_f 'Bold' = bold .
    perform err_hdl.
    set property of h_f 'Color' = col.
    perform err_hdl.
    endform. "FILL_CELL
    *& Form ERR_HDL
    outputs OLE error if any *
    --> p1 text
    <-- p2 text
    form err_hdl.
    if sy-subrc <> 0.
    write: / 'OLE-Automation Error:'(010), sy-subrc.
    stop.
    endif.
    endform. " ERR_HDL

  • 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

  • Downloading into excel file , the is alignment is out

    The  reports when downloading into excel file is not what we usually getting. The alignment is out.

    Hi Basavaraj,
    When you are creating dynamic internal table(itab1) and fields of internal table, at the same time in the same way  create one more internal table(itab2) resrict this up to 10 columns.
    now
    DATA : num type i,
           FNAME(255) TYPE C
               VALUE '/data/sapdata/filename'.
    CONSTANTS : C_COMMA TYPE C VALUE ','.
    DATA : BEGIN OF I_DISPLAY OCCURS 0,
            REC(400),
           END OF I_DISPLAY.
    loop at itab1
    num = num + 1.
      if num le 100.
       move-corresponding fields to itab2
      else.
        exit.
      endif.
    endloop.
      Give column headings
            itab2-col1 =  'name1'
            itab2-col2 =  'name2'
            itab2-col3 =  'name3'
            itab2-col4 =  'name4'
            itab2-col5 =  'name5'
            itab2-col6 =  'name6'
            itab2-col7 =  'name7'
            itab2-col8 =  'name8'
            itab2-col9 =  'name9'
            itab2-col10 =  'name10'
          INSERT itab2 INDEX 1.
          CLEAR itab2.
    loop itab2.
       CONCATENATE
            itab2-col1
            itab2-col2
            itab2-col3
            itab2-col4
            itab2-col5
            itab2-col6
            itab2-col7
            itab2-col8
            itab2-col9
            itab2-col10
               into I_DISPLAY-REC SEPARATED BY C_COMMA.
         APPEND I_DISPLAY.
         CLEAR I_DISPLAY.
      ENDLOOP.
    OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
          LOOP AT I_DISPLAY.
            TRANSFER I_DISPLAY TO  FNAME.
          ENDLOOP.
        CLOSE DATASET FNAME.
    endloop.

  • Alv report into excel file.

    Hello experts,
    I have alv report , and i want to export this alv to excel file, how can i do this ?
    Thanks for your help.
    Avi.

    Hi Avi,
    U can download to any format by using ctrlshiftF9 or using the button to 'Local File'. Then  apopup appears as:
    In which format should the list
    be saved ?
    And some radio buttons. U select the 'SPreadsheet' option for excel.
    And click enter.Then it will prompt for the Directory and filename for saving.
    Keerthi

  • Download ALV to EXcel- Urgent pls help me

    Please help me in this...
    I have an ALV report around 120 column. The report is displayed perfectly on screen. But when I use the Export option to download as an excel file, some data is missing in SAP No field
    For example
    My report output is like this
    sap No    Name    Jobdes.   Dept
    00021     AAA      clerk1      FI
    00022     BBB      clerk1      FI
    00023     CCC      clerk1      FI
    00024     DDD      clerk1      FI
    00025     EEE      clerk1      FI
    00026     FFF      clerk1       FI
    Excel output is
    sap No    Name    Jobdes.   Dept
    00021     AAA      clerk1      FI
    Blank     BBB      clerk1      FI
    Blank     CCC      clerk1      FI
    Blank     DDD      clerk1      FI
    00025     EEE      clerk1      FI
    Blank    FFF      clerk1       FI
    Pls help me

    Hi Kumar,
              Pls try the below Function Modules to download the data to excel.
    ALSM_EXCEL_TO_INTERNAL_TABLE
    KCD_EXCEL_OLE_TO_INT_CONVERT – Uploads data directly from Excel sheet
    RH_START_EXCEL_WITH_DATA – Starts Excel with contents of an internal table
    or the below links also might help you.
    For uploading Excel to Internal Table??????
    Data from Excel sheet to my internal table
    Check the following link:
    http://www.sap-img.com/abap/upload-direct-excel.htm
    or even the below code might be helpful.
    Multiple excel sheets generation in a workbook
    CREATE OBJECT EXCEL 'EXCEL.SHEET'.
    GET PROPERTY OF EXCEL 'Application' = APPLICATION.
    SET PROPERTY OF APPLICATION 'Visible' = 1.
    CALL METHOD OF APPLICATION 'Workbooks' = BOOKS.
    CALL METHOD OF BOOKS 'Add' = BOOK.
    CALL METHOD OF BOOK 'WORKSHEETS' = SHEET.
    CALL METHOD OF SHEET 'ADD'.
    Fill all the sheets with relavant data
    PERFORM SHEET1 TABLES ITAB1.
    PERFORM SHEET2 TABLES ITAB2.
    PERFORM SHEET3 TABLES ITAB3.
    PERFORM SHEET4 TABLES ITAB4.
    Quit the excel after use
    CALL METHOD OF EXCEL 'QUIT'.
    FREE OBJECT: COLUMN,SHEET,BOOK,BOOKS,APPLICATION,EXCEL. "NO FLUSH.
    CLEAR V_SHEET.
    FORM FILL_CELL USING ROW COL VAL.
    CALL METHOD OF SHEET 'cells' = CELL NO FLUSH
    EXPORTING #1 = ROW #2 = COL.
    SET PROPERTY OF CELL 'value' = VAL.
    FREE OBJECT CELL NO FLUSH.
    ENDFORM. " FILL_CELL
    FORM SHEET1 TABLES ITAB1 STRUCTURE ITAB1.
    V_SHEET = Sheet Name.
    V_NO = V_NO + 1.
    CALL METHOD OF BOOK 'worksheets' = SHEET NO FLUSH EXPORTING #1 = V_NO.
    SET PROPERTY OF SHEET 'Name' = V_SHEET NO FLUSH.
    PERFORM FILL_SHEET1 TABLES ITAB1 USING V_NO V_SHEET.
    CALL METHOD OF SHEET 'Columns' = COLUMN.
    FREE OBJECT SHEET.
    CALL METHOD OF COLUMN 'Autofit'.
    FREE OBJECT COLUMN.
    ENDFORM.
    Repeat above procedure for all sheets you want to add
    FORM FILL_SHEET1
    TABLES ITAB1 STRUCTURE ITAB1
    USING V_NO V_SHEET.
    ROW = 1.
    PERFORM FILL_CELL USING ROW 1 'Column1 Name'.
    PERFORM FILL_CELL USING ROW 2 'Column2 Name'.
    PERFORM FILL_CELL USING ROW 3 'Column3 Name'.
    ROW = ROW + 1.
    LOOP AT ITAB1.
    PERFORM FILL_CELL USING ROW 1 ITAB1-Column1.
    PERFORM FILL_CELL USING ROW 2 ITAB1-Column2.
    PERFORM FILL_CELL USING ROW 3 ITAB1-Column3.
    ROW = ROW + 1.
    ENDLOOP.
    ENDFORM.
    Repeat above procedure for all sheets you want to add
    Try this also
    TYPE-POOLS: truxs.
    DATA: it_raw TYPE truxs_t_text_data.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    field_name = 'P_FILE'
    IMPORTING
    file_name = p_file.
    Upload Excel file
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR =
    i_line_header = 'X'
    i_tab_raw_data = it_raw
    i_filename = p_file
    TABLES
    i_tab_converted_data = i_XCEL[]
    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.
    Pls reward if useful.
    THanks,
    Sirisha

  • Convert report output into excel file

    hiii,
    Can we convert output of report into excel file format?
    Plz tell me the.
    Thanks in advance

    Hello,
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b13895/orbr_paptoexcel.htm
    29 Building a Report for Spreadsheet Output
    Regards

Maybe you are looking for

  • Why can I not import PSD files into Adobe?

    I downloaded a PSD opener to validate if the files could open and they were able to open successfully. Could it be the PSD file, I'm trying to open was save on a MAC computer, which connect link with Windows.... Please help , small business owner and

  • Itunes download freezes

    I got a new hp laptop last week, running Windows 7(64 bit), and have been trying to download itunes, but can't. Each time I try, the download process just freezes and after a while a message pops up saying that the operation has timed out. I have con

  • Relationship between tables in a module(urgent)

    Hi , Am new to this domain(SAP)... I want to move datas to SAP through codes... For example,i want to add datas to ItemGroups module of Inventory module....But it failed...On the other hand,i was able to add datas to Item table of the same module...

  • Sync options - bad support

    I have a Pearl 8130.   As a stand alone device it works good.  My complaint is trying to sync it with anything.  RIM's support is garbage if you're using anything but Outlook. I own a Mac and fought long and hard to work out some of the many kinks wi

  • Can not post all contacts from address book group

    I created a contact list with 132 entries for a social club that I belong to in Address Book.  When I create a message and add the group in the BCC field it will only post 99 contacts. I tried dragging and dropping the group and typing the group name