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.
- 1 I am unable to trim my recording down to leass than 14 sec. Can anyone help
- 2 My apple TV WHEN CONNECTED TO THE TV DISPLAYS A PICTURE OF THE BOX WITH A CABLE (USB) ATTACHED TO ITUNES SYMBOL.tHE WHITE LIGHT ON THE FRONT OF THE BOX IS FLASHING RAPIDLY. IS THIS WHAT IS DESCRIBED AS BEING BOXED? IS THE WAY TO FIX THIS TO RELOAD
- 3 How do I get firefox to open with only one tab I accidentally saved when I had more than 1 tab open now it opens too slowly and I want to change it back
- 4 Change labels language
- 5 ORA-01002/ Fetch out of sequence on lazy loading
- 6 Quality Based Invoice
- 7 Has anyone set up a Solaris 7 LDAP client to use with iPlanet DS 5.0? I have only found docs for compiling OpenLDAP and have had NO LUCK with it. I can't get an LDAP client to run.
- 8 Browsers prevent machine from going to sleep?
- 9 Repetitive Manufacturing Profiles
- 10 Database Assistant is stuck
- SharePoint 2010 sites along with SharePoint 2013 sites
- Diff: Version on workflow builder and Maintain Active Plan version on SWU3
- Why Verizon blocks acess to US channels outside of USA ?
- Error in File Adapter
- Puprose of inbound and outbound idocs
- How can a pdf data be read/written to a file
- Group Policy issues
- Retriving value from Pie chart to hidden field using onmouseover event
- Want help in deciding the software tools for my project...
- Audigy 2 ZS IRQ confl