Error in using ABAP OLE wrong cell value
Dear All..
I'm facing a problem while using ABAP OLE..
the problem is the ABAP OLE writes the wrong value in Excel file
the value is 121.000 but it written in Excel file : 121
the weird thing is .. other value of 9.000.000 written correctly in Excel File .. and also lots of other values..
i've trace the value until it goes to the method of :
CALL METHOD OF h_excel 'Cells' = h_zl
EXPORTING
#1 = i_row
#2 = i_col.
SET PROPERTY OF h_zl 'Value' = i_value.
GET PROPERTY OF h_zl 'Font' = h_f.
IF i_bold = 'X'.
SET PROPERTY OF h_f 'Bold' = 1.
ENDIF.
and the values of variable i_value is still correct which is : 121.000 but after writing in excel it becomes 121
i believe it will become faulty at the specific amount with format of XXX.000 because if I changed the value to 121.001 it displays correctly in Excel file..
i_value is a pass value from variable ld_val with data type of is --> ld_val(20) type n.
is this are originally bugs from the OLE ? how to solved it ?
please advice ..
yes it is clear, but how excel manage the passed data is unclear.
However, to solve you can try this:
DATA : ld_val(20).
WRITE value1 TO ld_val CURRENCY CURR.
REPLACE ALL OCCURRENCES OF '.' IN ld_val WITH space.
CALL METHOD OF h_excel 'Cells' = h_zl
EXPORTING
#1 = i_row
#2 = i_col.
SET PROPERTY OF h_zl 'Value' = ld_val.
GET PROPERTY OF h_zl 'Font' = h_f.
IF i_bold = 'X'.
SET PROPERTY OF h_f 'Bold' = 1.
ENDIF.
Regards,
Angelo.
Similar Messages
-
I followied the how to guids "How To convert an IDoc-XML structure to a flat file and vice versa in XI 3.0" and "How to Use ABAP-Mapping in XI 3.0".
After I built created the ABAP-OO class Z_ABAP_MAPPING_IDOC_TO_FLAT and implemented every thing, during the testing, I got the error "Exception CX_SY_NO_HANDLER triggered, An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handl".
Please help.
Thanks!Please debug as follows...
put a break point inside your class/method....
goto tcode SXI_MAPPING_TEST....give in the configuation details of your scenario...and when you execute, give the IDOC-XML, copy it from SXMB_MONI where you are getting the error....
when you execute, it shoudl stop at the break point that you had set in your class....continue debugging using 'F6' function key, and check where you are hitting this error...
The chances are that the FM that converts IDOC-XML to flat file format might not have been executed correctly...
Thanks. -
Need to reference a cell using a variable or cell value.
Hi.
I am trying to build a master sheet and then have sub sheets that detail the information from the master. My master sheet looks like this:
1 | 101 | Bob | Smith |
2 | 104 | Sally | Jones |
3 | 108 | Tim | Abbott |
Then on separate sheets I want a summary for each line like this:
1 | Name | Bob |
2 | ID | 101 |
Now, I know I could just build this by creating references to the master sheet, but in reality my sheets are far more complex and I really need to be able to reference them by line number. So I would like to have a hidden cell (say AA1) on each summary which designates the line and then reference Master:B{AA1}. I did this years ago on excel but have no idea how I did it or howo to do it in Numbers.
Any help is greatly appreciated.
ThomHi 86,
Rearrange your table then add another table to find the result:
A2 in Table 1-1 will find the earliest date in Table 1 without having to sort Table 1.
A2 contains this formula
=MIN(Table 1::A)
B2 in Table 1-1 uses VLOOKUP to find which ID matches that MIN date.
The reason for rearranging your table (Table 1) is that VLOOKUP compares a search value to the values in the leftmost column of a specified collection.
(in this case, it looks in the leftmost column of the range Table1::A:B, then returns a match from column 2 of that range).
I forgot to include "Exact Match" in the VLOOKUP formula. Is that what you want, or "Close Match"?
Edit: I don't suppose that matters because MIN will always give an exact match. Duh!
Regards,
Ian. -
Creating a chart using ABAP OLE
Hi all,
I have a requirement to
1) Output data from an internal table into excel, and
2) Create a chart from the data in excel
The ABAP program is driving the creation of the chart in excel.
So far I have been able to export the data using OLE calls, created a chart object,.
My question:
1. How to put Data Lables
2. How to put Data Table under the Chart
3. How to rename the series names
Below is the recorded Macro. I don't know how to convert it to ABAP.
Sub Macro1()
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
Application.CutCopyMode = False
ActiveChart.SetSourceData Source:=Range("B1:E4")
ActiveChart.SeriesCollection(1).Name = "=Sheet2!$A$2"
ActiveChart.SeriesCollection(2).Name = "=Sheet2!$A$3"
ActeChart.SeriesCollection(3).Name = "=Sheet2!$A$4"
ActiveChart.SetElement (msoElementDataLabelOutSideEnd)
ActiveChart.SetElement (msoElementDataTableWithLegendKeys)
End Sub
I have attached the current output and expected output.
I have searched about this in google but i could not find any solution for this.
Your help is greatly appreciated.
Thanks,
Lakshmi.To my knowledge, charts are only available for work item queries in TFS web access. If you want to generate test result charts, you can do that using the TFS reporting data in the data warehouse (if your administrator configured it when setting up TFS).
"You will find a fortune, though it will not be the one you seek." -
Blind Seer, O Brother Where Art Thou
Please Mark posts as answers or helpful so that others may find the fortune they seek. -
Hi.. m working on a program..where i have to transfer data from sap to word doc using abap OLE..
i have an internal table itab where all the related fields are stored and this table's contents are pasted to word document using the function 'clpb_export'.. now this itab contains some 20 odd fields with some having static values(constant values) and others being populated by values from selections.
When i run the program , there is an error.
the error is in the function module 'clpb_export'. the line of error is:
ASSIGN COMPONENT 1 OF STRUCTURE <fs> TO <f>.
The error says:
' You attempted to assign a field to a typed field symbol, but the field does not have the required type. '
Now wen i remove those fields with static values , the program runs fine.
so pls helpUse gui_download function module u will get .doc(word format).
-
Excel Error When Using Microsoft Data Link
I have a user who is running the following:
Windows 7 w/64 bit OS
MS Office 2010
SAS 9.3 Software
They created a database in Excel and have integrated the information with SAS 9.3 database.
For some reason, now when they try to 'Refresh' data in the Excel spreadsheet, Excel
freezes and then crashes.
I believe it's because the 'Microsoft Data Link' is failing, during set-up. Below are
the error messages they get, when trying to set-up the 'Microsoft Data Link' with the
SAS 9.3 software:
ERROR MESSAGES:
1. Microsoft Data Link Error: Test connection failed because of an error in setting the
window handle property. Multipl-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done. Continue with test connection? Yes or
No.
2. Microsoft Data Link: Test connection succeeded but some settings were not accepted by
the provider.
I don't know where to begin troubleshooting this issue, as I don't use the SAS
9.3 software, nor have I ever attempted to use the 'Microsoft Data Link' option in
Excel.
TROUBLESHOOTING I'VE TRIED:
Repair of MS Office 2010
Uninstall/Reinstall Excel 2010
Any assistance would be appreciated.Hi,
In regarding of the issue, please provide us more information to assist you better.
Did this issue occur with other database program? Such as Access, SQL sever or other?
If the Excel still crashes, I recommend we collect the Event log and App crash dump file to do further troubleshooting. You can try to analyze dump by
yourself if you would like to:
How to analyze app crash dump file:
http://blogs.technet.com/b/askperf/archive/2007/05/29/basic-debugging-of-an-application-crash.aspx
Also you can send them to us via Email ([email protected])
If the issue occur with the SAS 9.3 software, I recommend you connect it's provider or support to get more help.
Did you
use 'Microsoft Data Link' like this?
If it was, we may need to debug the connecting string, you can post the question to Visual Studio forum.
Hope it's helpful.
Regards,
George Zhao
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Invoking Openoffice calc through ABAP OLE Object
I want to show the output of my ABAP process through openoffice calc worksheet.
I tried to invoke calc using ABAP OLE object.
But even a blank calc sheet is not getting opened with the following statements.
Type-pools: OLE2.
TYPES:
service_manager type OLE2_OBJECT,
DESKTOP type OLE2_OBJECT,
DOCUMENT type OLE2_OBJECT.
CREATE OBJECT service_manager 'com.sun.star.ServiceManager'.
CALL METHOD OF SERVICE_MANAGER 'createInstance' = DESKTOP
EXPORTING #1 = 'com.sun.star.frame.Desktop'.
CALL METHOD OF DESKTOP 'loadComponentFromURL' = DOCUMENT
EXPORTING #1 = 'private:factory/scalc'
#2 = '_blank'
#3 = 0
#4 = '' .
What is wrong with this code?. Is there any other setting required at the system/OS/ABAP/BASIS
level to invoke openoffice applications?.
I have registered the classid for openservice manager in the transaction SOLE. Still it is not working.
Iam able to invoke openoffice applications with Visual Basic/Power builder lanaguages.
Please respond.
Thanks in advance
LijuI don't think it's possible.
4th parameter of loadComponentFromURL method is an array ( http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XComponentLoader.html )
Arrays are not supported as parameters in ABAP OLE Automation. (see note [633105|https://service.sap.com/sap/support/notes/633105] - OLE automation: ABAP type for OLE array parameters ) -
ABAP & OLE Automation Controller
Hi everybody,
When I use ABAP & OLE Automation Controller to build a Excel file, I don't find a documentation about the values of the properties parameters.
For example:
(DATA gs_cell TYPE ole2_object.)
SET PROPERTY OF gs_cell 'HorizontalAlignment' = -4108 .
I found in Visual Basic Editor all properties of the OLE objects. But the number -4108 remains a mystery for me.
Where can we find this value ?
I tried to read the official Microsoft and ABAP documentation without success.
Can you help me ?
I thank you in advance.
PatrocleHi,
I use http://msdn.microsoft.com/en-us/library/ms262200.aspx site
In the documentation for Range.HorizontalAlignment You can find it uses XlHAlign:
http://msdn.microsoft.com/en-us/library/bb241313(v=office.12).aspx
Name Value Description
xlHAlignCenter -4108 Center.
xlHAlignCenterAcrossSelection 7 Center across selection.
xlHAlignDistributed -4117 Distribute.
xlHAlignFill 5 Fill.
xlHAlignGeneral 1 Align according to data type.
xlHAlignJustify -4130 Justify.
xlHAlignLeft -4131 Left.
xlHAlignRight -4152 Right.
Regards,
Przemysław -
ABAP OLE Word - Delete last page
Dear all,
I have a SAP program which prints some documents in Microsoft Word by using ABAP OLE Objects.
I use a template to take the main context, and after that I send some variables in order to populate the word document.
The problem is when I create the new word document, I paste the template text in a new document, but at the end I have always an empty page. I don't know how to delete this final page, I don't find the corresponding OLE method to do it.
I have found a method to cut a line, but the problem is that line is also empty, and I cannot cut it.
Could anyone help me?
Many thanks in advance and best regards.Hi,
post some code lines. Format as code, use preview.
Regards,
Clemens -
Using ABAP routines for data selection
Hello,
I want to use ABAP routine to determine value range of data selection in Data Package but when I use routine for one field, selection criterias for other fields are ignored, e.g.:
in Data Package I have two selection fields:
CPUDT Accounting Document Entry Date
AEDAT Date of the Last Document Change by Transaction
For CPUDT I wrote ABAP routine
and for AEDAT I have just typed in period of time.
I started data extraction and open Monitor for this Data Package.
At Header tag I checked selections info and there is selection only for CPUDT.
Could somebody explain me is it normal system behaviour?
Thanks
AndrzejThanks for reply but that would be too easy...
I have tried your advice but nothing changed.
I think this is data extraction configuration problem.
Andrzej -
Consider a General format cell having a value of 39.95. When I fetch the CellFormat of the cell it returns wrong cell format-
CellFormat thisCellFormat = ((CellFormat)cellFmts.ChildElements[(int)thisCell.StyleIndex.Value]);
int fmtId = Convert.ToInt32(thisCellFormat.FormatId.Value);
The value of fmtId returned is 1, and in some cases 38, where it should be 2 or 39.
This issue is only for General format cells, I am getting correct id for Number format cells.
Below is the
Standard ECMA-376 Office Open XML File Formats specified set of implied cell formats for reference-
ID Format Code
0 General
1 0
2 0.00
3 #,##0
4 #,##0.00
9 0%
10 0.00%
11 0.00E+00
12 # ?/?
13 # ??/??
14 mm-dd-yy
15 d-mmm-yy
16 d-mmm
17 mmm-yy
18 h:mm AM/PM
19 h:mm:ss AM/PM
20 h:mm
21 h:mm:ss
22 m/d/yy h:mm
37 #,##0 ;(#,##0)
38 #,##0 ;Red
39 #,##0.00;(#,##0.00)
40 #,##0.00;Red
45 mm:ss
46 [h]:mm:ss
47 mmss.0
48 ##0.0E+0
49 @The purpose of this forum is to support the Open Specifications documentation. You can read about the Microsoft Open Specifications program here,
http://www.microsoft.com/openspecifications/en/us/default.aspx
The library of Open Specification documents is located here,
http://msdn.microsoft.com/en-us/library/dd208104.aspx
It doesn’t appear that you are implementing one of the protocols cited. Your question may be more applicable to MSDN's Microsoft Office for Developers/Open XML Format SDK forum at
https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=oxmlsdk
Bryan S. Burgin Senior Escalation Engineer Microsoft Protocol Open Specifications Team -
Custom itemRenderer component based on cell value: error 1009
I'm working on an item renderer for a dataGrid that has different states depending on the cell and row values.
The cell value is a toggle (true or null), and sets whether content should be shown in the cell or not
The row properties determine what is shown when the cell value is true.
The dataGrid dataProvider is populated based on user id input.
I created the itemRenderer as a custom actionscript component, closely following this example:
360Flex Sample: Implementing IDropInListItemRenderer to create a reusable itemRenderer
However, my component results in Error #1009 (Cannot access a property or method of a null object reference) when a user id is submitted.
package components
import mx.containers.VBox;
import mx.controls.*; import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;
import mx.core.*;
public class toggleCellRenderer extends VBox
public function ToggleCellRenderer()
{super();}
private var _listData:BaseListData;
private var cellState:String;
private var cellIcon:Image;
private var imagePath:String;
private var imageHeight:int;
private var qty:String = data.qtyPerTime;
private var typ:String = data.type;
public function get listData():BaseListData
{return _listData;}
public function set listData(value:BaseListData):void
{_listData = value;}
override public function set data(value:Object):void {
super.data = value;
if (value != null)
//errors on next line: Error #1009: Cannot access a property or method of a null object reference.
{cellState = value[DataGridListData(_listData).dataField]}
override protected function createChildren():void {
removeAllChildren();
if(cellState=='true'){
cellIcon = new Image();
addChild(cellIcon);
//there is another state here that adds another child...
//next overrides commitProperties()...
There are no errors if I don't use an itemRenderer--the cells correctly toggle between "true" and empty when clicked.
I also tried a simple itemRenderer component that disregards the cell value and shows in image based off row data--this works fine without errors or crashing. But I need to tie it to the cell value!
I have very limited experience programming, in Flex or any other language. Any help would be appreciated.Your assumption that the xml file either loads with "true" or nothing is right.
After modifying the code to the following, I don't get the error, but it's still not reading the cell value correctly.
package components
import mx.containers.VBox;
import mx.controls.*;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.listClasses.BaseListData;
import mx.core.*;
public class toggleCellRenderer extends VBox
public function ToggleCellRenderer()
super();
private var _listData:BaseListData;
private var cellState:Boolean;
private var cellIcon:Image;
private var imagePath:String;
private var imageHeight:int;
private var qty:String;
private var typ:String;
public function get listData():BaseListData
return _listData;
override public function set data(value:Object):void {
cellState = false;
if (listData && listData is DataGridListData && DataGridListData(listData).dataField != null){
super.data = value;
if (value[DataGridListData(this.listData).dataField] == "true"){
cellState = true;
override protected function createChildren():void {
removeAllChildren();
if(cellState==true){
cellIcon = new Image();
addChild(cellIcon);
//there is another state here that adds another child...
//next overrides commitProperties()...
- didn't set the value of qty or typ in the variable declarations (error 1009 by this too--I removed this before but wanted to point out in case its useful)
- added back in the get listData() function so I could use the listData
- changed the null check
All cells are still returning cellState = false when some are set to true, even if I comment out [if (value[DataGridListData(this.listData).dataField] == "true")] and just have it look for non-null data. That shouldn't make a difference anyway, but it confirms that all cells are returning null value.
Swapping out the first if statement in set data with different variables results in the following:
[if (listData != null)] all cells return null (cellState=false for all)
both [if (value != null)] and [if (DataGridListData != null)] results in error 1009 on a line following the if, so I assume they return non-null values.
All rows have data, just not all fields in all rows, so shouldn't listData be non-null? Could it be that the xml file hasn't fully loaded before the itemRenderer kicks in?
I also realized I had removed the item renderer from many of the columns for testing, and since some columns are hidden by default only one column in the view was using the itemRenderer--hence the single alert per row I was worried about earlier.
Thanks for your help so far. -
Hide a specific cell using ABAP classes
Hi Experts,
Is there a way to hide a specific cell using ABAP classes for reports?
MarceloHello Thomas Daly
I never saw a way to grant permission to a List, the only way I ever saw a list get its permissions is thru
the group site it resides in, the Discussion Board is the problem in this case (it has preconfigure permissions but they seem more like properties that you select the value from RadioButtons). However, ms-addnew gets rid of the Add new link but it
gets rid of the one in the Discusson Board too because Discussion Board falls in the category of List.
In other words ms-addnew in the master got rid of all of the Add new items, link etc as hoped but now
I can't add to the Discussion Board.
I am alright with a hack (I am open to any suggestions) that would work if it works but, the List's I am referring to are all "Links" in the Quick Launch so I dont know how you would be able to apply the jquery, how would you apply the
jquery to a Links in a Quick Launch?
Thank you
Shabeaut -
OLE - Creating header and footer in Word document using abap
Hi All,
I'm using OLE to create a WORD document from abap.
I need to insert a logo in the header and a footer text.
Does any one know how to insert a header/footer with abap ole ?
I tried to insert the logo as picture with:
call method of o_inlineshapes 'AddPicture' = o_logo
exporting
#1 = 'C:\logo3.jpg'.
but I can't put it in the place I want..
thanks,
Michalcall method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
call method of lobj_activewindow 'ActivePane' = w_activepane.
call method of lobj_activepane 'View' = w_activeview.
SET PROPERTY OF w_activeview 'SeekView' = '9'. " header view.
" This will set the view to the header view. Whatever you write here
will go to the header.
Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
CALL METHOD OF w_selection 'TypeText'exporting
#1 = 'Rahul Anand'.
"Now set the view again to the main doc view.
SET PROPERTY OF w_activeview 'SeekView' = '0'.
" Now write your main doc code .
" For footer the view is '10'.
call method of LOBJ_MS_WORD 'ActiveWindow' = w_activewindow.
call method of lobj_activewindow 'ActivePane' = w_activepane.
call method of lobj_activepane 'View' = w_activeview.
SET PROPERTY OF w_activeview 'SeekView' = '9'. " header view.
" This will set the view to the header view. Whatever you write here
will go to the header.
Get PROPERTY OF lobj_ms_word 'Selection' = w_selection.
CALL METHOD OF w_selection 'TypeText'exporting
#1 = 'Rahul Anand'.
"Now set the view again to the main doc view.
SET PROPERTY OF w_activeview 'SeekView' = '0'.
" Now write your main doc code .
" For footer the view is '10'. -
Getting an error when i am execution a BI query using ABAP.
Hi Expert,
I am getting an error when i am execution a BI query using ABAP. Its Giving me this Error "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying as bellow.
Property Data Integrity has been set differently to the system default.
Current setting: 0 for GHRGPDM12
System default: u2019 7 u2018
As I am very new to BI and have very limited knowledge, so I am not able to understand this problem. Can any one help me to resolving this issue. Previously it as working fine, I am getting this error last 2 days.
when i am debugging , I am getting error from
create instance of cl_rsr_request
CREATE OBJECT r_request
EXPORTING
i_genuniid = p_genuniid.
this FM. Its not able to create the object. Can any one please help me out.
Thanks in advance.
Regards
SatrajitHi,
I am able to solve this problem
Regards
Satrajit
Maybe you are looking for
-
I have a question about using multiple ipads in our school. Each of our teachers have a iPad and AppleTV in their classroom. The issue is, with our classrooms so close in proximity to one another, is there a way to pair teacher #1 iPad to its Apple
-
NetBoot/NetInstall settings in Server Admin buggy as ****?
Hi, I administer a Mac pool in College. We recently updated to all new iMacs (except for one, which still is a 2006 C2D iMac) and Leopard Server running on a PowerMac G4 (Dual 1GHz, 1.5 GB RAM). Except for a few initial quirks with Directory Services
-
A FI docutment was found in bseg, but can't be selected from others table (bsis,bs*). why?
-
My iPad jumps back to the desktop when using a page or app
My iPad (original) jumps back to the desktop when using Safari or an app. Any fixes? This is my second original iPad. The first one did the same thing.
-
Accepting a Service Entry Sheet
Dear Gurus, I am getting error while accepting a service entry sheet. Steps followed by ML81n while creating service entry sheet as follows : 1 - clicked on other po then enter the pn no. 2 - create a new service entry sheet. A servic