Regarding downloading the ALV tree to excel

I have prepared a report in which the ouput will be in ALV tree format. Now i want to download the tree to excel file.  If anyone can help me out i'll be very thankful.
Regards,
Rohitash

Hi
Use the FM - ALV_XXL_CALL. here is the sample -
REPORT  ZSKC_ALV_XXL.
TYPE-POOLS : KKBLO.
DATA : ITAB LIKE T100 OCCURS 0,
       T_FCAT_LVC TYPE LVC_S_FCAT OCCURS 0 WITH HEADER LINE,
       T_FCAT_KKB TYPE KKBLO_T_FIELDCAT.
START-OF-SELECTION.
Get data.
  SELECT * UP TO 20 ROWS
  FROM   T100
  INTO   TABLE ITAB
  WHERE  SPRSL = SY-LANGU.
  CHECK SY-SUBRC EQ 0.
Create the field catalog.
  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
   EXPORTING
      I_STRUCTURE_NAME             = 'T100'
    CHANGING
      CT_FIELDCAT                  = T_FCAT_LVC[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3.
  CHECK SY-SUBRC EQ 0.
make sure you pass the correct internal table name in the field catalog.
  t_fcat_lvC-tabname = 'ITAB'.
  MODIFY T_FCAT_LVC TRANSPORTING TABNAME WHERE TABNAME NE SPACE.
Transfer to KKBLO format.
  CALL FUNCTION 'LVC_TRANSFER_TO_KKBLO'
    EXPORTING
      IT_FIELDCAT_LVC                 = T_FCAT_LVC[]
    IMPORTING
      ET_FIELDCAT_KKBLO               = T_FCAT_KKB
   EXCEPTIONS
     IT_DATA_MISSING                 = 1
     IT_FIELDCAT_LVC_MISSING         = 2
     OTHERS                          = 3.
  CHECK SY-SUBRC EQ 0.
Call XXL.
  CALL FUNCTION 'ALV_XXL_CALL'
    EXPORTING
      I_TABNAME                    = 'ITAB'
      IT_FIELDCAT                  = T_FCAT_KKB
    TABLES
      IT_OUTTAB                    = ITAB[]
    EXCEPTIONS
      FATAL_ERROR                  = 1
      NO_DISPLAY_POSSIBLE          = 2
      OTHERS                       = 3.
  IF SY-SUBRC <> 0.
  ENDIF.

Similar Messages

  • Download the alv report in excel

    dear experts
    I am creating ALV report and working fine, i want the report sould be viewed in excel format when i click the icon on AlV display
    with regards.
    Ajay Kumar.

    Hi Ajay,
    SAP has provided the user interface for downloading the data into an excel file in the tool bar there is an option for downloading into excel.
    Another way is to write a code using the function module alsm_excel and then downloading into the excel,
    please tell me whether this reply was useful or for further clarification revert back
    Thanks in advance
    Srikanth

  • Problem while downloading the alv output to excel file.

    Hii,
    While downloading the alv output to an excel file i am facing a problem. Either the output comes as 1.23456E+11 or the values get cut .
    Cant put in txt file  as the users require to calculate directy and i have even tried to increase the output length .But both doesnt help.
    So what are the other ways to do so.
    Edited by: mansi_v27 on Mar 24, 2010 12:35 PM

    Hi,
    Welcome to SCN!!!.
    Please go through the forum rules. This has been discussed many times. You can search in the forum for this.
    Infact there is no problem. Just expand that excel cell. You can see the full value. This is standard excel property.
    Thanks,
    Vinod.

  • Downloading the ALV layout to Excel sheet

    Displaying ALV using OOPS concept.
    Dynamic internal table is passed in the
        CALL METHOD gcl_grid->set_table_for_first_display
    For downloading into Excel sheet used EXPORT->LOCAL FILE->Spread sheet
    <b>The TEXT.XLS file is not looking like as it is there in the layout.</b>
        gv_layout-cwidth_opt = 'X'.
        gv_layout-sel_mode   = 'A'.
        CALL METHOD gcl_grid->set_table_for_first_display
          EXPORTING
       I_BYPASSING_BUFFER            =
       I_BUFFER_ACTIVE               =
       I_CONSISTENCY_CHECK           =
       i_structure_name              =
       IS_VARIANT                    =
            i_save                        = 'A'
            i_default                     = 'X'
            is_layout                     = gv_layout
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
          CHANGING
            it_outtab                     = <tabx>
            it_fieldcatalog               = gt_fieldcatalog
       IT_SORT                       =
       IT_FILTER                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    What will be the problem? Pls. resolve this.

    Hi Sreedevi,
       1) Once you have alv report displayed in the screen.
       2) Click button 'View' ( next to print button) on application toolbar
       3) Select Excel in Place
       4) This will download the same format as of Report
    I hope your ALV have all the Standard functions in Toolbar. If not copy the status from and get the function as mentioned above.
    Program - SAPLSALV
    Status - STANDARD
    Reward points if this Helps.
    Manish

  • Regarding downloading from alv report o/p to excel sheet

    Hi gurus,
                       When i am trying to download the alv output to excel sheet it is downloading only titles, No data is getting displayed in it.No data is getting downloaded.
    Thnaks in advance.

    Hi,
    What are the steps you do to download ALV to excel? We need to replicate the case in order to find answer.
    Regards,
    Teddy Kurniawan

  • How to download the ALV Hierchial Tree Data to an Excel sheet.

    Hi All,
    Can any body please let me ,if there is any possibility to know How to download the ALV Hierchial Tree Data to an Excel sheet.
    If yes, please let me know how could this can b acheived.
    Regards,
    Rohini.

    Hi Rohini
    There is no such functionality provided by SAP to download ALV Tree Hierarichal Tree into excel sheet .
    If you had this kind of senario then i can propose one solution create two radio buttons one is to display in ALV Tree Format and the other is classical report which you can download it for futher process
    Regards
    Hitesh Batra

  • Download ALV TREE to excel

    good afternoon, someone could help me, I need to download a alv tree but the excel excel not be messy and keep the tree hierarchy that has the alv.
    This can be done?
    Bye

    Hi,
    For your first SDN thread, welcome on board  ! Sincerely
    Else, personally, I think you took more time to create your account and post this thread, than to use THE MEGA SUPER GREAT OPTION which is in SDN... it is on the right top corner of this page... and it's the "search" button )
    with terms "ALV HIERARCHY EXCEL", I'm sure you will be able to find by yourselve your own answer... without to have to wait. For instance, with [this wiki|http://wiki.sdn.sap.com/wiki/display/Snippets/HierarchyinExcel].
    regards
    mickael

  • How to download the ALV output with colors into the excel sheet

    Hi,
      I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
    can anyone tell how to get the colors in the excel sheet also. thanks...
    Regards,
    Rose.

    Hi Camila,
    Use the OLE concept.
    Check the below threads:
    Colors in Excel Sheet
    colors in alv
    Regards,
    Soumya.

  • Need to download the ALV blocked output in to excel sheet

    I have a requirement where there is a need to download the Alv block output to excel sheet. when i click on excel button which is on output only header block data is coming in excel sheet.but i need both header block and item block data into excel.

    Hi,
    create a pushbutton on the toolbar,
    whenever user clicks the pushbutton,
    call the fm gui_download for 2 times
    for the first time,
    append = ' ',
    and for second time.
    append = 'X'.
    check this thread.
    Re: How to download multiple ALV Container data on a screen to a single Excel?
    Regards.
    R K.

  • Error while download the data to an Excel sheet for ECC report from EP

    Hi experts,
    I had created a report program which will download the data to an Excel sheet using SAP OLE object
    For this report i had created a tcode too. The report which i developed is perfectly working fine in SAPGUI. But if i download the data to an Excel sheet for the same report throught SAP EP.I am getting the  error that "Error in excel downlaod"
    I analyed by putting dubigg point and it throws exception while calling Function module.
    The excpetion is " OLE object id not found".
    Can any body gives a light on this why i'm not able download the excel in ep?
    Thanks,
    JB

    Hello,
    (by the way I came here to ask my question and is my first time visit but...)
    The problem is obvious: How do you expect OLE handler can "touch" the local PC Excel through a web browser? I believe that is not possible. That means (at least for me) that I have to create the whole documents before I return them to the user. That is why I use XML Office documents generation or you can try to hack some Export to excel features of ERP reports.
    Regards Otto

  • How to refresh the ALV Tree

    Hi,
    I have an ALV Tree report developed using the OOPS. In my ALV Tree output, I have some buttons which will update the database after clicking. The data is correctly updating in the database. But, it is not getting updated in the ALV Tree display. That means, it is not REFRESHing the ALV Tree display. We have to again execute the program in order to see the updated output.
    Could anyone please suggest me how to Refresh the ALV Tree display..?
    We can't use the method 'REFRESH_TABLE_DISPLAY' as it is a PRIVATE method is the class CL_GUI_ALV_TREE.
    Please share your valuable thoughts.
    Thanks & Regards,
    Paddu.

    Hi paddu.
    please check out the link mentioned below,this will help u.
    How to Refresh data on ALV tree
    Regards
    Theres

  • Reg: Downloading the internal table into excel file.

    Hi,
    My requirement is i am collecting data in the internal table and i have to download the contents in an excel file and i have declared like this.
    PARAMETERS : x_test    TYPE string
                          DEFAULT 'C:\temp\file.txt'.
    I have given the default file path  like this and i am using the function module .
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
      BIN_FILESIZE                    =
          FILENAME                      = OUTPUT_PATH
          FILETYPE                      = 'DAT'
    IMPORTING
      FILELENGTH                      =
        TABLES
          DATA_TAB                        = INT_INPUT
      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
         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.
    My requirement is i dont want to change my extension as .txt from .exl to my parameter addition and in the function module the file type should be 'dat' only and in the runtime i want to change the file name which i have given in the .
    PARAMETERS : x_test    TYPE string
                          DEFAULT 'C:\temp\file.txt' this file.txt into datas.xls.
    it would be grateful if some one share some valuable views to wards this query
    Thanks and Regards,
    Keny

    Hi,
    Use this code.
    It will ask for the file name...there u can change.
      data : l_filename type string,
             l_filetype type char10,
             l_path type string,
             l_fullpath type string.
      l_filetype = 'DAT'.
    *Get the file name
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        EXPORTING
          FILE_FILTER          = '*.DAT'
          INITIAL_DIRECTORY    = 'C:\'
        CHANGING
          FILENAME             = l_filename
          PATH                 = l_path
          FULLPATH             = l_fullpath
        EXCEPTIONS
          CNTL_ERROR           = 1
          ERROR_NO_GUI         = 2
          NOT_SUPPORTED_BY_GUI = 3
          others               = 4.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      check l_fullpath is not initial.
    *Download file
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = l_fullpath
          FILETYPE                = l_filetype
        CHANGING
          DATA_TAB                = t_data_sum[]
        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
          NOT_SUPPORTED_BY_GUI    = 22
          ERROR_NO_GUI            = 23
          others                  = 24.
      IF sy-subrc NE 0.
        MESSAGE e398(00) WITH sy-subrc ' Error downloading file' '' ''.
      ENDIF.
    Regards
    Sandeep REddy

  • 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

  • How to alter the alv tree node text?

    hi
      i want to alter the alv tree node text, many people say it cann't be changed, but
    i look into the sample code 'BCALV_TREE_04', the average funtion(select a column and then select average function in the tool bar) can alter the tree node text dynamically.
      i try to look into the source code, the it's the sap standard code, all the funtions that user input, it goes to the statement "  CALL METHOD cl_gui_cfw=>dispatch.", and i don't understand what this statement do, can someone helps me?

    hi
    good
    The ALV tree report produces uses OBJECT METHOD functionality in-order to produce a
    tree structured ALV output. 
    The creation of an ALVtree report first requires the creation of a simple program to build the ALV
    details such as the fieldcatalog and to call a screen which will be used to display the ALVTree.
    The screen should be created with a 'custom control' where you wish the ALVtree report to appear.
    For the following example it will have the name 'SCREEN_CONTAINER'.
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
    reward point if helpful.
    thanks
    mrutyun^

  • Regarding download of the ALV report to excel

    Hi experts,
    I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
    There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
    Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
    But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
    regards,
    charles.

    Actually now I think there is another way to do this, storing file on application server can create problems as sometimes the users don't have directory write access or things like that.
    Instead you should export your data to a memory or database cluster and import it back using abother program.
    The proposed changes would be
    1: At the point you are calling your alv grid function, check if the sy-batch is 'X' for background job, if yes than export to database table INDX or you can create your own. suppose your data is in internal table ITAB than in case of background job, you will do
    data: keyf like indx-srtfd.
    *We just assign username, date time to this
    concatenate sy-uname sy-datum sy-uzeit into keyf.
    EXPORT itab TO DATABASE indx(ZZ) ID keyf.
    check for subrc if export is successfull.
    Now you have stored your itab in database for later processing. remember to have keyf. In case of background job you can have it write in the output so from spool output you can check what was the keyf to use.
    You have to write another program to import itab from database and download it or display it.....
    This program will have keyf as input parameter and you must define ITAB same as the orignal program.
    parameters: p_keyf like like indx-srtfd.
    import itab from database indx(ZZ) id keyf.
    *Now you have itab. do whatever you want with it. download it using GUI_DOWNLOAD function or display it in an ALV grid.......
    Hope you got the overall idea.

Maybe you are looking for

  • Error on External Serrvice Configuration Page NW 20047s SP10

    Hi All, I am working on CAF developement. I was trying to develop an CAF application using External Service. I used SAP ECC 5.0 server to import a RFC functional module. It was successfully imported in NWDS. Also it got successfully deployed on the S

  • Query: Missing tablename in generated SQL for vertical mapped classes

    Hi, I am playing with Kodo 3.1.4 / Postgres 7.4 and could not find any solution for this problem: I have one class calles "Clipfragment" which represents video clips and has a long - field named "lengthInMinutes". It extends a baseclass called "Categ

  • Import/Export with no rows option

    Dear friends, I have to perform import few schemas, viz RDS, SDS, ADS. RDS & SDS ( reporting db schema, staging db schema) should be imported with data and ADS without data. In a single import, is that possible? If so, how to import it? Thanks Venkat

  • HELP - JavaScript error on Rollover Image

    Hello Everyone, I am really enjoying working with Dreamweaver until errors like the following come up. Could someone please help me!! The error reads: "While executing onLoad in Rollover.htm the following JavaScript error occured: In file "Rollover";

  • CS4 and Raw- small file size

    I have RAW files that are anywhere from 7-15MB.  They are opening as 10x15 inches.  My JPEGS open in much larger files sizes - about 50+ inches.  I have downloaded the latest Adobe RAW plug-in updates for CS4.  Using a Canon 40D.  Searched and seache