Download Internal table to Excel with different Tabs - ole2_object
Hi All, I am using ole2_object to download the data from internal table to Excel file. As per different values in sorting key, data will be downloading in different tab in same Excel file. In my internal table one field is of character type and some
I am using ole2_object to download the data from internal table to Excel file. As per different values in sorting key, data will be downloading in different tab in same Excel file.
In my internal table one field is of character type and some times contains number as value.
e.g. itab-code = 000002.
While downloading to Excel, Excel consider this value as numeric and remove the leading zero.
Any suggestions for how to set format property as Text for this cell, will highly appreciated.
Sample code -
data: gs_excel type ole2_object,
gs_wbooklist type ole2_object,
gs_application type ole2_object,
gs_wbook type ole2_object,
gs_activesheet type ole2_object,
gs_sheets type ole2_object,
gs_newsheet type ole2_object,
gs_cell type ole2_object.
create object gs_excel 'EXCEL.APPLICATION'.
get property of gs_excel 'workbooks' = gs_wbooklist.
get property of gs_wbooklist 'Application' = gs_application.
set property of gs_application 'SheetsInNewWorkbook' = 1.
call method of gs_wbooklist 'Add' = gs_wbook.
get property of gs_application 'ActiveSheet' = gs_activesheet.
set property of gs_activesheet 'Name' = datasheet_name.
call method of gs_excel 'Cells' = gs_cell exporting #1 = v_row
#2 = v_col.
set property of gs_cell 'value' = <f>.
GET PROPERTY OF gs_cell 'Font' = gs_Font.
SET PROPERTY OF gs_Font 'Bold' = 1 .
Just concatenate ' infont of the fields, which you want to treat as a text.
itab-code = '00002'.
concatenate '''' itab-code into itab-code.
You can also set the text properties of the cell by,
SET PROPERTY OF gs_cell 'NumberFormat' = '@' .
but, it will remove the leading zeros and set the format as text.
Hi All, I am using ole2_object to download the data from internal table to Excel file. As per different values in sorting key, data will be downloading in different tab in same Excel file. In my internal table one field is of character type and some[More]
Hi all, I want to download my internal table into excel sheet. For this i am using FM <b>GUI_DOWNLOAD</b>. But in my internal table each record is of around <b>400</b> char. length. I think because of this the downloaded <b[More]
Hi, i have to download some data from an internal table to an excel file. all the fields in the internal table are strings, some of them look like a number (for example 32,45 or 123,01). Before downloading the internal table to excel i make a "conver[More]
Hi All, I m new to Webdynpro for ABAP and i m trying to download the data as it is in the Internal Table to excel file using FM 'CRM_IC_XML_STRING2XSTRING' ( to convert string to xstring) and CLASS 'cl_wd_runtime_services=>attach_file_to_response' ([More]
I have a requirement to download nearly 8 to 10 internal tables to excel sheets(for each internal table one excel sheet) without displaying the diolog box showing open and save buttons. scenario : I will enter the path name like this - C:\myfolde[More]
Hi All, I have a requirement to download internal table contents to excel with field headings. I tried searching in forums before posting but didn't got much help. I have used GUI_DOWNLOAD, WS_DOWNLOAD and EXCEL_OLE_STANDARD_DAT. But unable to downlo[More]
Hi All, I need a Function Module to download the Internal table to Excel File. I Have used SAP_CONVERT_TO_XLS_FORMAT, but this function modules are using GUI_Download indirectly. I dont want to use GUI_DOWNLOAD as i am going to call this Function Mod[More]
Hi, I am trying a sampole program to download an internal table to excel and am uisng the Fm GUI_DOWNLOAD for the same. But how do I ensure that each column of internal will be aligned as columns in the excel sheet to. I a trying to do that with a se[More]
Hi Experts , I have to download an internal table to an excel sheet. I have tried the code given below. But this is not giving me desired output in excel. method ATTACH_FILES . *data: conv_out type ref to cl_abap_conv_out_ce, content type xst[More]
Friends... I am trying to download the contents of an internal table to an excel file. Now i tried to download the contents in debugging mode. I noticed there is this character " in one of the fields of my internal table, and i came to know, that pre[More]
Hi, I am trying to download ITAB into excel file on my application server . I am using FM 'SAP_CONVERT_TO_XLS_FORMAT' for that . When I run the report I can see file getting generated on APP server but no ITAB data is saved in that excel. [More]
- 1 I've tried downloading iOS5 several times and after an hour each time I get a message that says my network connection has timed out. But I can't find any information about "timing out" or how to correct the situation. Any help?
- 2 Apple Mail, Photo Browser, Attachments and Yosemite
- 3 How can I remove the page number from the first page of the document that is the cover page?
- 4 File verification errors applying GI PSU 18.104.22.168.1 for acfs on linux
- 5 Analysis ABC for material's ordered value
- 6 Lync 2010 client connecting to 2013 persistent chat server
- 7 How to do planning
- 8 Bluetooth Apple Magic Mouse jumps and moves erraticlly on screen
- 9 Bug in APEX 4.2.4 User Interface defaults
- 10 Grouping level based measures
- Can you facetime on two iGadgets (pad 2 & touch 4 - both iOS6) with the same apple ID?
- Still trying to understand iPhoto's trash
- Disable quicktime plug-in opening TIF files in browsers?
- Error 100, Error 13, Can't sign out
- WAD : 2 Queries in 2 tables : How to get only one input parameter ? :-(
- Is it possible to make a 2D array (or whatever-dimension) array like..
- InDesign conversion to swf--embedding movies, hyperlinks help!
- Error Message: An internal error occured while calling 'openDocumentMDP' AP
- Why are POST/REPLY not an option near to the articles ?