Iterate Excel-Sheets with NJawin
Hi,
can somebody help me on activating a sheet in a workbook.
there is a get method with which I can get the property sheets from workbook,
_Workbook wb = app.getWorkbooks().Open(filename1);
wb.get(String str, Object index)
but the second argument is an object, and I dont know how to pass the index.
I tried with get("Sheets", new Object[]{new Integer(1)}) but it doesnt work.
get("Sheets(1)") as I would do it with VisualBasic throws also a
com.develop.jawin.COMException: 80020006 : Unknown name
My aim is to get the Worksheet object(iterate through all worksheets) and change its tab-title.
Now I can only get tha active worksheet like
wb.getActiveWorksheet() :((
Thanks in Advance
rumpi
hi,
for those who have the same problem I solve it
using the getNext() method of Worksheet
Worksheet wsh1 = new Worksheet(wb1.getActiveSheet());
wsh2 = new _Worksheet(wsh1.getNext());
Its not the perfekt solution (selecting with index), but it works.
And that because activating a workbook , activates automatic
the first sheet . So I can iterate to workbook.getSheets().getCount()
bye
Similar Messages
-
Excel sheet with multiple tabs to be sent as email
Hi Experts,
I have a requirement to generate an Excel sheet with multiple tabs to be sent as email to a distribution list.
Please help if you have any ideas on the same.
Thanks,
Preema[http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout|http://wiki.sdn.sap.com/wiki/display/ABAP/ToGetFieldDetailsSavedinVariantLayout]
with this we can get the modified field catalog based on layout variant
without calling alv output function modules
Thanks! SDN. -
Hi all,
I have an excel sheet with 2 spread sheets. 1 hidden and other visible.
1) How to read the excel so that the hidden fields dont come into the internal table in which the data is read?
2) when the data is read from the visible tab of the excel sheet, data from hidden tab is also getting added in the internal table.
How to avoid it?
Useful answers will be rewarded with points.
please help!!!Hi,
If you have 2 tabs in your excel sheet. Open one tab which you want to process save it. Now it should be process active tab only.
thanks,
Sriram. -
Hi ,
i have attached an excel sheet with wbs after that when i change contents or write something and when i saved it the sheet is not changing . i have unprotectd the sheed ,
can anybody clear me what is the problem
Thanks in advance
Regards
Rama Shanker SharmaHi,
Would you please share your experience to solve this problem?
Recently, we got the same problem.
Thanks ahead,
Ecco -
How can i create excel sheet with multiple tabs using utl file?
how can i create excel sheet with multiple tabs using utl file?
any one help me?Jaggy,
I gave you the most suitable answer on your own thread yesterday
Re: How to Generating Excel workbook with multiple worksheets -
Application server file to excel sheet with .csv format
I am having comma seperated file in the application server, now i want that my program should pick the file from application server and store it in the excel sheet with .CSV extension
Use the OPEN DATASET and READ DATASET statements to read from the file on application server and the function module GUI_DOWNLOAD to save it on the local system.
Manoj -
How to download the pivot view to the excel sheet with all features
Hi,
Using discoverer, my co-worker is able to download the pivot view to excel sheet with all enabled features, like pivot table in excel.
Is this can be done in obiee? if this feature is present in obiee, plz will you explain me how to do in obiee? its urgent.
Thanks,Hi abc,
I don't think BI office plug-in supports you the pivot table features of MS Excel.
Even if you import a pivot table from BI, it is rather treated just as a table in Excel
Regards,
Raghu -
I want to download a report into Excel sheet with color Heading..Is it Poss
Hi All
I want to download error records into Excel sheet with color Heading..Is it Possible to download into excel with Color Heading?
here i am <b>using the 3 sheets in one</b>
t_error-bkpf -> Sheet1
t_error-bseg-> sheet 2
t-error-bsec -> sheet3.
Rgds
Raghav<b>The following thread has the code which will put data into multiple sheets</b>
Download to multiple sheets in Excel
FOR COLOR LOGIC JUST REFER THIS PROGRAM
*& Report ZNEGI17 *
REPORT ZNEGI17 NO STANDARD PAGE HEADING.
* this report demonstrates how to send some ABAP data to an
* EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
* handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT. " font
TABLES: SPFLI.
DATA H TYPE I.
* table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
* read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
* display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
* display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
* start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
* PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
* CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:kis_excel.xls'
* PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 1.
* get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
* add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
PERFORM ERR_HDL.
* tell user what is going on
* CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
* EXPORTING
** PERCENTAGE = 0
* TEXT = TEXT-009
* EXCEPTIONS
* OTHERS = 1.
* output column headings to active Excel sheet
PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
* copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
* changes by Kishore - start
* CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
PERFORM ERR_HDL.
* add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
PERFORM ERR_HDL.
* tell user what is going on
SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
* CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
* EXPORTING
** PERCENTAGE = 0
* TEXT = TEXT-009
* EXCEPTIONS
* OTHERS = 1.
* output column headings to active Excel sheet
PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
* copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
* changes by Kishore - end
* disconnect from Excel
* CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
* FORM FILL_CELL *
* sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL1 USING I J BOLD VAL.
data : color(5) type x value 'H80000008'.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'ColorIndex' = 3 .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
* outputs OLE error if any *
* --> p1 text
* <-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
*& Form FILL_CELL1
* text
* -->P_H text
* -->P_1 text
* -->P_0 text
* -->P_IT_SPFLI_CARRID text
form FILL_CELL using I J BOLD VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
endform. " FILL_CELL1
kishan negi -
How to download data from abap-ouput to excel sheet with logo
how to download data from abap-ouput to excel sheet with standard logo
Edited by: Harish Kasyap on Nov 18, 2008 8:19 AM
Edited by: Harish Kasyap on Nov 18, 2008 8:20 AMFor saving the report you can goto System -> List -> Save -> Local File -> Location where you want to save in your presentation server.
You can also give a option in your selection screen to save the file to Presentation server using FM GUI_DOWNLOAD.
Hope it helps.
Thanks,
Jayant. -
Excel sheets with defined print areas to pdf
Hello
I am trying to convert an Excel file with multiple sheets and defined print areas to pdf using Automator. The problem is that the action "Convert Format of Excel Files" prints everything on all sheets (even information outside the defined print areas).
Does anyone have a solution to this?
Thanks!Post what you would like to do in Excel here
http://www.microsoft.com/mac/support -
Download internal table data into excel sheet with column heading and data
Hi,
I am having one internal table with column headings and other table with data.
i want to download the data with these tables into an excel sheet.
It should ask the user for file name to save it on their own name. They should give the file name in runtime and it should be downloaded into an excel sheet.
Can anyone tell what is the right function module for downloading these two internal table data with column heading and data.
what we have to do for storing the file name in runtime.
Can anyone help me on this.
Thanks,
Rose.Hi Camila,
Try this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = PATH2
FILETYPE = 'XLS'
TABLES
DATA_TAB = IT_DATA
FIELDNAMES = IT_HEADINGS
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 -
Using excel sheets with externa references
I was hopping someone could point me somewhere to begin here.
What if I am implementing CM solution in a financial department, which strongly uses excel spreadsheets, which means they're going to need external references from a file, to another .xls for example. Is there any thing about that matter in UCM?
tyPost what you would like to do in Excel here
http://www.microsoft.com/mac/support -
Issue with downloaing from ALV to Excel sheet
Hi All,
When we download the ALV Report to excel sheet, the first line/first column (A11) of excel sheet will have today's date.
Since my customer uses the excel sheet for further processing into a non-SAP system, we need to provide the excel sheet with the cell A11 (First line's firls column) as blank.
How can we deliver this requirement?
Your help will be sincerely appreciated....
Regards
PavanOne option is there
Give him 1 push button on toolbar other wise you can write below function module in
start of selection code also.
1 ) modify u r internal table according to requirement.
2) after that call WS_DOWNLOAD function module.
Check below code for u r reff.
*Modify itab according to u r requirement.
Loop at IST_DWN.
IST_DWN-KUNNR2_DESC = SPACE.
IST_DWN-KUNNR3_DESC = W_ZPPCSR-KUNNR3_DESC .
APPEND IST_DWN.
CLEAR DATE.
ENDLOOP.
*F4 Help for file menu
CALL FUNCTION 'F4_FILENAME'
IMPORTING
FILE_NAME = PATH.
RLGRAP-FILETYPE = 'DAT'.
Download fm
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = PATH
FILETYPE = RLGRAP-FILETYPE
MODE = XMODE
IMPORTING
FILELENGTH = L_FILELENGTH
TABLES
DATA_TAB = IST_DWN
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
OTHERS = 3.
Salil ... -
Encountering problems with exporting complex excel sheets to SWF
Please help me with this problem:
I have a complex Excel sheet, with functions like VERT.LOOKUP, INDEX etc. This should work in Xcelsius, but I have problems when having a preview in SWF. In the Xcelsius Present 2008 drawing window, all buttons work perfectly, but when I preview it, all outcomes are gone (buttons do work).
When removing VERT.LOOKUP and table shortnames (see example) it sometimes does work. So my guess is that SWF does not support VERT.LOOKUP and/or table shortnames. Does anyone know anything about this problem and maybe can help me? I use the 30-day trial version of Xcelsius Present.
Table example:
_______PROD1____PROD2____PROD3
YEAR1___10________20________30
YEAR2___20________15________50
YEAR3___30________10________100
In Excel, when you give names to this table (Insert/Name/Make --> columns & rows), you can get info out of this table with the simple function =YEAR1 PROD2. --> 20.
Thank you very much!Yeah, I know. But VERT.LOOKUP is supported. The strange thing about this is dat Xcelsius is displaying is well when not in the preview mode.
-
Populate and header for an excel sheet in SALV
Hi,
I want to download an excel sheet with header in SALV.
Please let me know how to do that.
Thanks & Regards
SanthoshHi,
I’m not sure if I understand your question correctly, so please correct me if I have any misunderstandings.
For the defined names, I assume you mean the named range. If so, you can create the binding to the named range through
Bindings.addFromNamedItemAsync method.
For the styles, I think the article below may give you some help.
How to: Format tables in apps for Excel
By the way, there are no methods to iterate the styles and named range through the current Office JavaScript API.
If this is a feature you want to include in future versions of Office JavaScript API, please submit a feedback to
Office Development Platform User Voice.
Regards,
Jeffrey
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Does anyone know how to make a magazine using pages or microsoft word. Thanks
-
Hi Guys I am a BPEL guy and just started working on BPM. Being a newbie in BPM field i have few queries which should be able to make me understand the diff between BPEL and BPEM. 1) We created Business Process in BPEL with WS Orchestration, Deployed
-
No DSL, No Repair Techs, No Customer Service
I'm fed up. I feel like I'm being scammed and all I can do is sit here and take it. My DSL has been going out every single day, multiple times, for weeks. Resetting the modem sometimes helps, more often not. When the internet does come back on, 75% o
-
Vendor Hierarchy - Creating Master Record for a Vendor Hierarchy node
Hi gurus, I have configured the Vendor hierarchy as per procedure. What is the T code/path to create the master record for a vendor hierarchy node? Also please let me know the procedure to map the existing vendors to the hierarchy. Thanks and regards
-
VM cannot get IP and shows host MAC in event logs
I have a strange issue where the VM on a user's laptop worked fine in the office with a Wireless NIC but when he got home we began having some problems (no network in the VM, only get 169.x.x.x IP in the VM, host network connection drops when we try