gkaindia.com

Home > > Download to Excel.

Download to Excel.

Advertisement
Hi,
I have to download data into excel .
Now this data is not predefined .. as in its picked up from custom table . If no of records selected from custom table is 6 then 6 columns in final_itab. If 10 records selcted then 10 columns .
Now I have managed to create two internal tables
1. itab1
this contains header texts
row  column   text
1     1       Name
1     2       Quantity
1     3       Price
2, itab2   contains - values
row column   value
1    1       'ABC'
1    2       '33'
1    3       '34.56'
2    1       'CDF'
2    2       '66'
2    3       '234'
How do I make it into one internal table for download to excel.
If I think of the option of printing it as a report so that the user will save file as spread sheet .. this is also not possible as the text size for each is 70 and it will exceed the maximum permissible which is 1023.
Culd Anyoen suggest something in this regard please .
Advertisement
Hi neelim,
first declare your internal table that will contains the headre of the colomn
DATA: BEGIN OF gt_header OCCURS 1,
       ZONE(60) TYPE C,
      END OF gt_header.
then the table that will contains the values.
DATA: BEGIN OF gt_val OCCURS 0,                  
        matnr(18),
        werks(4),
      end of gt_val.
after updating your table with value and header text
call function:
CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
              FILENAME            = P_file
              FILETYPE            = 'DAT'
         TABLES
              DATA_TAB            = gt_val
              FIELDNAMES          = gt_header
         EXCEPTIONS
              FILE_OPEN_ERROR     = 1
              FILE_WRITE_ERROR    = 2
              INVALID_FILESIZE    = 3
              INVALID_TABLE_WIDTH = 4
              INVALID_TYPE        = 5
              NO_BATCH            = 6
              UNKNOWN_ERROR       = 7
              OTHERS              = 8.
it should works.
joseph
Read the other 5 answers
Hi folks, In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner. We achieved this with Simple Transformations. Now the question is while dow
Hi All, i have written a report with ALV_GRID FM, by default we get the option to download the output to excel. But when we click on the download to excel, it displays the output in the frist page, but it also opens so many pages like format, header,
Hi All, In a particular scenario, I require to trigger an action once a file have been successfully downloaded to EXCEL from Webdynpro UI. But in case of download functionilty, once the MS window pop-up for download comes up, the control is lost from
Hello , When downloading a report to excel from OBIEE Dashboard , certain rows are getting hidden . For instance , I have total 15 rows in my pivot view and when I download that report into excel format , the rows from 8-13 are not showing up . After
Hi Gurus, I am downloading the data from an internal table to excel file using FM gui_download. The date field in my internal table is in the format MM-DD-YYYY (stored as Char 10 field). But when it downloads to excel, the date format changes to MM/D
Hi all, i want to download the excel file from application server into internal table and after processing i have to upload to excel file in the application server in the background mode.. i mean i'll schedule the program in background. im using FM A
Hello experts, I know there are many threads on this topic in the forum. I tried using method cl_bsp_utility=>download but nothing happens. Here is the scenario - 1. I have BSP 2. From Do_handle_event in controller class I am calling model method whi
in download to excel from bsp how to increase excel column width to wrap text in each column. My client does not want to manually click each cell aftet downloading to excel to see full text in each columnHi, You can achieve this by formatting your ou
hi all, I am using  FM SAP_CONVERT_TO_XLS_FORMAT to downloading populated internal table data into excel sheet by using filename type rlgrap-filename. Now I need the column heading(field name) for downloaded data in excel sheet. pls tell me how can i
hi, by ALV_GRID is it possible to filter the no of columns download into Excel? EX: if my ALV(report) contains 30 fileds and i am diplaying only 10 fileds on output by using variant.. is it possible to down load that displayed 10 feilds into excel sh
Hi, Please provide me the solution on using download button in Hierarchial List ALV to download to excel.I need to download the Header and Item details in a single line (in one line)in the Excel sheet. Please suggest the solution and sample code ASAP
Hi, I have a problem with regards to the ALV download to excel.  I have an ALV grid with 40 columns and i need to download the output to an excel file.  But after downloading the ALV output, i noticed that some columns are already on the next line. i
Hi Team, I  created  a report using ALV Function modules, I want to download in  Excel sheet the  output list. i am trying to download but i am not getting proper values. I am populating around 50 fileds. is there any settings for these download. <<
Hi, i want to download ALV grid output to excel sheet including the top of page. i am using the icon in application tool bar. but only data's are download to excel sheet. i cannot download the top of page. with out write coding in program can we down
Hi Experts, In my ALV grid report,  when i click on the standard ALV toolbar to download the output to excel file, the data gets downloaded fine execpt for one field called serial number. It is of size 18 chars. The last number on this field is getti
We were on SAP 4.6B. We have several abap reports for which we have a web interface using ITS. On the broweser output we have provided a URL which reads 'Download to CSV file' . This has been achieved by modifying the function www_get_report. The mod
HI, Could anyone out there help me resolve one issue which I am facing. We have developed a ALV report and the same is working fine in GUI screen and also the various ALV features such as Download to Local File, Print Preview and others are working v
Hi, How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no con
I developed a alv report and I have one percentage field(say PER) in the grid.When I sum on that field PER then it comes in my formula basis.Suppose If I have 5 line items and all PER field have a value 2 then when I sum in PER column then it come 7
Hai Friends, I am using the following methods to download the report to an Excel Sheet from ALV. CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG CALL FUNCTION 'GUI_DOWNLOAD' The report is downloaded to Excel but the Column names are not displa