Sitemap

Amicuk Programming Answers

Download Internal table to Excel with different Tabs -  ole2_object

-0001-11-30   Views:0

Advertisement

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

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 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 .
Thanks.
Regards,
Meenakshi.

The replay answer
Advertisement
Hello,
Just concatenate ' infont of the fields, which you want to treat as a text.
Like,
itab-code = '00002'.
concatenate '''' itab-code  into itab-code.
modify itab.
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.
Regards,
Naimesh

Go to See the other 3 answers

Download Internal table to Excel with different Tabs -  ole2_object

Category:DefaultRelease time:-0001-11-30Views:130

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]

FM to download internal table to excel

Category:DefaultRelease time:2015-10-11Views:130

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]

Downloading internal table to excel

Category:DefaultRelease time:-0001-11-30Views:130

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]

Download Internal Table to Excel

Category:DefaultRelease time:-0001-11-30Views:130

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]

How to download internal table to excel sheet

Category:DefaultRelease time:2015-10-11Views:130

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]

Download internal table to excel with header

Category:DefaultRelease time:2015-10-11Views:130

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]

Function Module to Download Internal table in EXCEL

Category:DefaultRelease time:2015-10-11Views:130

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]

Download internal table to Excel sheet

Category:DefaultRelease time:2015-10-11Views:130

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]

Pbm with downloading internal table to excel

Category:DefaultRelease time:-0001-11-30Views:130

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]

Missing records while downloading internal table to excel because of ' " '

Category:DefaultRelease time:-0001-11-30Views:130

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]

Downloading internal table in excel file on application server

Category:DefaultRelease time:-0001-11-30Views:130

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]

Hot
I go to http://www.youtube.com/html5 and enable html5. I do not get any video tags or content of the sort. If I do a search: http://www.youtube.com/results?search_query=gods+gonna+cut+you+down&aq=0&webm=1 None of those videos will appear with the [More]
i want to add or change the navigation rules or use dynamic navigation in JSF, as it is don in the struts(changing config file when tomcat is running) . i have don it in struts but cannot find way in JSF. do JSF framework provide any facilty for doin [More]
I have a macbook air and bout the USB superdrive... im wondering if i can play a PC made game on the macbook or i need to buy the mac version or if i download the boot camp will it workBootCamp is only an app that enable your Macintosh to restart and [More]
I have a mac book with the Mac OS 10.6.3 on it. I take the laptop between home and work every day. At work in the past I have connected to a windows share, which works fine. However, now whenever I go home I get persistent messages saying: Connection [More]
I've already found described way of creating deskbands here -- http://msdn.microsoft.com/en-us/library/windows/desktop/cc144099%28v=vs.85%29.aspx and respective sources on SDK like https://github.com/theonlylawislove/WindowsSDK7-Samples/tree/e8fe83b0 [More]
After finishing my website I wanted to set up my tablet layout. I copyed the objects from homepage and changed the size so it fits in the tablet size. But now it looks like that www.probilth.com  (on tablet) It's only on the half of the tablet and on [More]
OK, I just recently updated my Creative Zen Vision:M 30gb to the newest .60. firmware. Everything works fine except the Volume Restriction and FM radio. First off, the volume restriction did not work for me without a password, which I think is pretty [More]
I am using torque3.1 with a MySQL database, I have a date field in my database and was wondering is there any way I can search on dates only in my database. Right now if I set the Criteria object to search for a date and pass it a java.sql.Date objec [More]
I have 700 pics on my ipod; they´re on streaming pics too. The problem is that in my computer (windows 7), in the folder of iclou photos, I can only watch 300 pctures of my 700. I've reinstalled the icloud program on the pc, and I still have this pro [More]
Hi for the last few months I keep getting an update offer for digital camera raw. I haven't got a compatible camera, I have even clicked on the update thinking that would be the end of it, but I am offered the update time and again. Now it not a majo [More]