Object references using FormCalc
Hello
Does anyone know of the FormCalc equivilant to the following javascript code?
var a = event.target.getField("form[0].page[1].field1");
Basically what I am doing is manipulating the data in field1 form several other fields. The other fields all use FormCalc, to do some calculations.
For example say field2 has the following javascript:
var a = event.target;
var lcv;
var total = 0;
for (lcv = 0; lcv < 10; lcv++)
total = total + a.getField("form[0].page[1].field1["+lcv+"]").value;
I would like to do the samething using FormCalc (I have some other fields that use FormCalc to do stuff, but I need to also do the same kind of sumation) without having to hard code all the fields.
Thanks
Ben
P.S. if you know the synax for a for loop in FormCalc that would be helpful also, but not critical since I can use a while loop.
Chris,
I did not think FormCalc supported what I needed but I was hoping I was wrong and therefore hoped to avoid having to query the field directly because the area I am working over basically equates to a 2 dimensional array (but its is not actually one) with a considerable number of fields, I was hoping not to have to hard code the field names for direct access, but if I must, I must, since in need FormCalc functions in part of my validation ( I use parse and format, as well as R&Ltrim) before the calculations.
I check page 23 for the FormCalc reference guide which comes with 7.0 and it talks about how to access elements in a tree, not the syntax of a for loop. If you have a simple example that would suffice.
Thanks
Ben
Similar Messages
-
Create Object References for Key field
Hi Experts,
Question 1- Do we have any standard task that create BOR object reference using key field?
Question 2 - If not, i have created a task with key field as import parameter and BOR type as return object reference. No i am just using macro "SWC_CREATE_OBJECT OBJREF_ARD 'AssetRequestDocument' ASSETREQUESTID." where ASSETREQUESTID is key field. OBJREF_ARD is object ref type.
Problem comes here - Its not getting instantiated, i debugged an saw it checks for logical system in the FM OWN_LOGICAL_SYSTEM_GET, i guess since SWO_CREATE is remote enabled FM it is checking for OWN_LOGICAL_SYSTEM_GET function. In our system for the client there is no logical system defined and i dont have any idea how to customize table T000 for logical system.
Note - There is nothing related to communication between two system.
Can anyone help me out?
Thanks in Advance,
Pritam KunalHello,
It's a method. You make a task which calls that method and passes in the BOR type and its key.
It instantiates an instance of the BOR and passes it back out.
So, no, it's not a generic BOR!
regards
Rick Bakker
Hanabi Technology -
"Object reference not set to an instance of an object" when using Sheel Shah's example
I am attempting to use a custom add dialog as in http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx and
I get the error "Object reference not set to an instance of an object." when clicking my button to AddEntity(). My code to call the control is:
User u = new User();
userdialoghelper.AddEntity(u);
Any ideas as to why I'm getting this error? I "think" that I've set up the class properly?
ScottI may be a couple of years late to the party here (using VS2013) but I also had some issues adapting to Yann's improvements over Sheel's code.
Sheel's screen code as provided has the word "Old in the InitializeDataWorkspace and the created methods. this does not work when copy/pasted. ALso removed the "UI" from "InitialiseUI()"
Following code can be used with Yann's Helper Class.
Namespace LightSwitchApplication
Public Class EditableCustomersGrid
Private customersDialogHelper As ModalWindow
Private Sub EditableCustomersGrid_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
customersDialogHelper = New ModalWindow(Me.Customers, "CustomerViewDialog")
End Sub
Private Sub EditableCustomersGrid_Created()
customersDialogHelper.Initialise()
End Sub
Private Sub gridAddAndEditNew_CanExecute(ByRef result As Boolean)
customersDialogHelper.CanAdd()
End Sub
Private Sub gridAddAndEditNew_Execute()
customersDialogHelper.AddEntity()
End Sub
Private Sub gridEditSelected_CanExecute(ByRef result As Boolean)
customersDialogHelper.CanView()
End Sub
Private Sub gridEditSelected_Execute()
customersDialogHelper.ViewEntity()
End Sub
Private Sub EditDialogOk_Execute()
customersDialogHelper.DialogOk()
End Sub
Private Sub EditDialogCancel_Execute()
customersDialogHelper.DialogCancel()
End Sub
End Class
End Namespace -
I have a csv file that I need to generate a schema for. I am trying to generate a schema using flat file schema wizard but I keep getting "Object reference not set to an instance of an object." error when I am clicking on the Next button after
specifying properties of the child elements on the wizard. At the end I get schema file generated but it contains an empty root record with no child elements.
I thought may be this is because I didn't have my project checked out from the Visual SourceSafe db first but I tried again with the project checked out and got the same error.
I also tried creating a brand new project and generating a schema for it but got the same error.
I am not sure what is causing Null Reference exception to be thrown and there is nothing in the Windows event log that would tell me more about the problem.
I am using Visual Studio 2008 for my BizTalk development.
I would appreciate if some has any insides on this issue.Hi,
To test your environment, create a new BizTalk project outside of source control.
Create a simple csv file on the file system.
Name,City,State
Bob,New York,NY
Use the Flat file schema Wizard to create the flat file schema from your simple csv instance.
Validate the schema.
Test the schema using your csv instance.
This will help you determine if everything is ok with you environment.
Thanks,
William -
Dump - Access using NULL object reference is not possible!!!
Hi,
I'm using the BCS class for sending HTM format email so i use the below code for that its working,
DATA: gr_document TYPE REF TO cl_document_bcs,
gr_document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = t_html
i_importance = '5'
i_subject = gc_subject ).
Next task is to send the image so i'm creating an another object to the same class, below code
*Image from MIME
DATA: o_mr_api TYPE REF TO if_mr_api.
DATA is_folder TYPE boole_d.
DATA l_img1 TYPE xstring.
DATA l_img2 TYPE xstring.
DATA l_loio TYPE skwf_io.
DATA: lo_document TYPE REF TO cl_document_bcs.
IF o_mr_api IS INITIAL.
o_mr_api = cl_mime_repository_api=>if_mr_api~get_api( ).
ENDIF.
CALL METHOD o_mr_api->get
EXPORTING
i_url = '/SAP/PUBLIC/ZDEMO/tick.png'
IMPORTING
e_is_folder = is_folder
e_content = l_img1
e_loio = l_loio
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5.
CALL METHOD o_mr_api->get
EXPORTING
i_url = '/SAP/PUBLIC/ZDEMO/Delete.png'
IMPORTING
e_is_folder = is_folder
e_content = l_img2
e_loio = l_loio
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5.
*Convert XSTRING to ITAB
DATA :lt_hex1 TYPE solix_tab,
lt_hex2 TYPE solix_tab,
ls_hex LIKE LINE OF lt_hex1,
lv_img1_size TYPE sood-objlen,
lv_img2_size TYPE sood-objlen.
CLEAR : lt_hex1, lt_hex2, ls_hex, lv_img1_size, lv_img2_size.
WHILE l_img1 IS NOT INITIAL.
ls_hex-line = l_img1.
APPEND ls_hex TO lt_hex1.
SHIFT l_img1 LEFT BY 255 PLACES IN BYTE MODE.
ENDWHILE.
WHILE l_img2 IS NOT INITIAL.
ls_hex-line = l_img2.
APPEND ls_hex TO lt_hex2.
SHIFT l_img2 LEFT BY 255 PLACES IN BYTE MODE.
ENDWHILE.
*Findthe Size of the image
DESCRIBE TABLE lt_hex1 LINES lv_img1_size.
DESCRIBE TABLE lt_hex2 LINES lv_img2_size.
lv_img1_size = lv_img1_size * 255.
lv_img2_size = lv_img2_size * 255.
*Attach Images
clear: lo_document.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'png' " Document Class for Attachment
i_attachment_subject = 'img1' " Attachment Title
i_attachment_size = lv_img1_size " Size of Document Content
i_att_content_hex = lt_hex1 " Content (Binary)
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'png' " Document Class for Attachment
i_attachment_subject = 'img2' " Attachment Title
i_attachment_size = lv_img2_size " Size of Document Content
i_att_content_hex = lt_hex2 " Content (Binary)
but it throws the dump " Access using NULL object reference is not possible" when i tries to access for method add_attachment...
Thanks,
SivaYes there is commit work after that, Below code
gr_document = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = t_html
i_importance = '5'
i_subject = gc_subject ).
*Image from MIME
DATA: o_mr_api TYPE REF TO if_mr_api.
DATA is_folder TYPE boole_d.
DATA l_img1 TYPE xstring.
DATA l_img2 TYPE xstring.
DATA l_loio TYPE skwf_io.
DATA: lo_document TYPE REF TO cl_document_bcs.
IF o_mr_api IS INITIAL.
o_mr_api = cl_mime_repository_api=>if_mr_api~get_api( ).
ENDIF.
CALL METHOD o_mr_api->get
EXPORTING
i_url = '/SAP/PUBLIC/ZDEMO/tick.png'
IMPORTING
e_is_folder = is_folder
e_content = l_img1
e_loio = l_loio
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5.
CALL METHOD o_mr_api->get
EXPORTING
i_url = '/SAP/PUBLIC/ZDEMO/Delete.png'
IMPORTING
e_is_folder = is_folder
e_content = l_img2
e_loio = l_loio
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5.
*Convert XSTRING to ITAB
DATA :lt_hex1 TYPE solix_tab,
lt_hex2 TYPE solix_tab,
ls_hex LIKE LINE OF lt_hex1,
lv_img1_size TYPE sood-objlen,
lv_img2_size TYPE sood-objlen.
CLEAR : lt_hex1, lt_hex2, ls_hex, lv_img1_size, lv_img2_size.
WHILE l_img1 IS NOT INITIAL.
ls_hex-line = l_img1.
APPEND ls_hex TO lt_hex1.
SHIFT l_img1 LEFT BY 255 PLACES IN BYTE MODE.
ENDWHILE.
WHILE l_img2 IS NOT INITIAL.
ls_hex-line = l_img2.
APPEND ls_hex TO lt_hex2.
SHIFT l_img2 LEFT BY 255 PLACES IN BYTE MODE.
ENDWHILE.
*Findthe Size of the image
DESCRIBE TABLE lt_hex1 LINES lv_img1_size.
DESCRIBE TABLE lt_hex2 LINES lv_img2_size.
lv_img1_size = lv_img1_size * 255.
lv_img2_size = lv_img2_size * 255.
*Attach Images
create object lo_document type cl_document_bcs.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'png' " Document Class for Attachment
i_attachment_subject = 'img1' " Attachment Title
i_attachment_size = lv_img1_size " Size of Document Content
i_att_content_hex = lt_hex1 " Content (Binary)
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'png' " Document Class for Attachment
i_attachment_subject = 'img2' " Attachment Title
i_attachment_size = lv_img2_size " Size of Document Content
i_att_content_hex = lt_hex2 " Content (Binary)
"Add document to send request
CALL METHOD gr_send_request->set_document( gr_document ).
TRY.
CALL METHOD gr_send_request->SET_SEND_IMMEDIATELY
EXPORTING
I_SEND_IMMEDIATELY = 'X'.
* CATCH CX_SEND_REQ_BCS INTO BCS_EXCEPTION .
**Catch exception here
ENDTRY.
DATA: LO_SENDER TYPE REF TO IF_SENDER_BCS VALUE IS INITIAL.
TRY.
LO_SENDER = CL_SAPUSER_BCS=>CREATE( SY-UNAME ). "sender is the logged in user
* Set sender to send request
gr_send_request->SET_SENDER(
EXPORTING
I_SENDER = LO_SENDER ).
* CATCH CX_ADDRESS_BCS.
****Catch exception here
ENDTRY.
"Send email
CALL METHOD gr_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = gv_sent_to_all ).
IF gv_sent_to_all = 'X'.
WRITE 'Email sent!'.
ENDIF.
"Commit to send email
COMMIT WORK.
"Exception handling
CATCH cx_bcs INTO gr_bcs_exception.
WRITE:
'Error!',
'Error type:',
gr_bcs_exception->error_type.
ENDTRY. -
Error : Access not possible using "null" objects reference
Hello.
i am working with a zbapi.
i called a external email program in this bapi,everything is working fine over here.
In webdynpro java they mapped my bapi and starting working from there.
every functionality is working fine but regarding this email stuff it is showing an error as access not possible using null objects reference.
where could be the possible error.
is it in webdynpro or in abap side.Raghu,
You are right. When it comes from the WD Java, may be you are not passing any value at all. You can trace it by these ways.
1. Check it using SE37, make sure everyhting is fine.
2. Print all the values that you are passing to the RFC in the execute RFC method().
3. using ST05 transaction in R/3, enable RFC and SQL trace, check what is passing in between web dynpro and R/3.
Moreover paste your error message here.
Thanks,
Raj. -
RFC to HTTP Interface - Access using NULL object reference is not possible
Hi All,
I am working on a Interface RFC to HTTP where in I am sending the data to a third party system.
Using PI 7.3 and Adapter type XI to send this data.
I am getitng an error Short dump occured when executing message in qRFC queue <Queuename>: Date/time 02.12.2011 08:44:57, user XXXXX, runtime error: Access using NULL object reference is not possible.
<SAP:Code area="INTERNAL">QRFC_SYSTEM_DUMP</SAP:Code>
I am entering the parameters such as target host,service number,path correctly with addrseing type as URL.
The message is failing in the call adapter step with the above error.
There are no messages stuck in SMQ2 as well.
Now on the other if I use the adapter type HTTP_AAE the messages is getting successfully delivered with the same parameters mentioned above.But as we know it is a plain adapter and will not have the SOAP envelope.
We would want to send the data using the XI adapter.
Any idea as why this issue is happening?
Helpful answers will be rewarded points.
Thanks & Regards,
RKHi,
please go through below threads,
Error for all the interfaces
Access via NULL object reference not possible., error key: RFC_ERROR_SYSTEM
hope it will help you
regards,
ganesh -
BPM SMQ2 in sysfail Access using a 'ZERO' object reference is not possible
Hi ,
I am working on a IDOC to SOAP synchronous scenario
So I am using a BPM....
I have written a operation mapping outside BPM
1) Request MM creates the SOAP rquest
2) Response is a ABAP mapping where i am checking the response from webserice and then generating an email using ABAP code.
now when i am running this scneario works fine and the mail gets generated...
however i get a green flag in moni and in SMQ2 in sysfail Access using a 'ZERO' object reference is not possible
PS : Also the response coming from the webserice has a custom header which does not match with the response ABAP mapping source MT
however if I work on the same thing using Proxy to SOAP sync there is no sysfail message and it works fine
Is this a bug in the system ...i am using PI 7.1Hi,
Try to implement SAP note 1164228 or apply package SAPKB71007 to resolve your issue. -
What is the use of passing object reference to itself ?
What is the use of passing object reference to itself ?
regards,
namancThere is an use for returning an object reference from itself, for instance:
class C {
public:
C append(C c) {
// do something interesting here, and then:
return this;
}You can "chain" calls, like this:
C c = new C();
C d = new C();
C e = new C();
c.append (d).append (e);Maybe the OP has "inverted" the common usage, or thought about a static method of a class C that requires a parameter of type C (effectively being a sort of "non-static method").
class C {
static void doAnotherThing (C c) {
c.doSomething(); //-- effectively C.doAnotherThing(c) is an "alternative syntax" for c.doSomething() -
Using == with String object references
Hi,
I understand that using the == operator to compare two String object references in Java will yield false for two different object references even when the contents are the same, and that you are supposed to use the method .equals() instead. However, in my program the == operator actually works for two different object references that point to the same object since it yields true! I don't understand why it works in my program when it shouldn't. Does someone know why?
Thanks!overrule. wrote:
warnerja wrote:
... unless some sneaky thread jumps in and changes the a or b reference right before the expression (a == b) were evaluated. This would also assume a or b had greater scope than simply local method variables that only one thread could access.
Just being a nitpickCould you provide an example of how that "greater scope" may look like in this case.
* Greater scope.
* @author Cynthia G.
* @see http://forums.sun.com/thread.jspa?messageID=10520796
public class ObjectAssignmentTest {
static Object a; // outer scope: class variable
static Object b; // outer scope: class variable
public static void main(String[] args) throws InterruptedException {
a = new Object();
b = a;
new Thread(new Runnable() {
public void run() { ObjectAssignmentTest.b = new Object(); }
}).start();
System.out.println(a == b ? "equal" : "not equal");
}For the record, this code is not even guaranteed to make the objects unequal with == before their equality is tested; both threads may go in parallel, the main thread first or the modifying thread first!
s -
Object Reference Not Set error using CrystalReportViewer
I have a web application in which I am attempting to use the CrystalReportViewer. Using Visual Studio 2008, I was able to get the viewer to run and display reports just fine. But since I moved to Visual Studio 2010, I've been unable to get it working again. I reinstalled Crystal Reports for Visual Studio 2010 and the x64 runtime. I created a test aspx page with just the following content:
using CrystalDecisions.Web;
public partial class Test : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
CrystalReportViewer Viewer = new CrystalReportViewer();
Viewer.ID = "viewer";
ph.Controls.Add( Viewer );
When I load the page, I get this exception:
NullReferenceException: Object reference not set to an instance of an object.
CrystalDecisions.Web.ViewerGlobal.get_IsNetscape6Up() +88
CrystalDecisions.Web.CrystalReportViewer.Render(HtmlTextWriter output) +83
This is a server-side exception, so I'm pretty sure that my browser has nothing to do with it, but I've tried this in both Chrome and IE8.
Do I have a screwy install? Or is there something I'm neglecting to do to configure the ReportViewer that's new in 2010?
Thanks for your help,
-SteveI figured it out.
I had already tried adding a new aspx page as David suggested before, and that did not work. So this time I made a whole new "ASP.NET Crystal Reports Web Site" project in my solution, which was nice enough to make a default aspx page with a built in crystal report viewer tied to a new report .rpt file in the project. And believe it or not, it worked flawlessly.
The use of CrystalReportViewer was different but relatively equivalent in both cases. So then I started analyzing the differences between this new project's web.config and mine. After some painstaking troubleshooting, I determined the problem: someone on my team had added some new content to the web.config, which included these lines:
<system.webServer>
<modules>
<remove name="Detector" />
<add name="Detector" type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
</modules>
</system.webServer>
I'm assuming that Crystal also uses a module called "Detector" in get_IsNetscape6Up(), and that this code was overriding that module.
It's still not working quite right, but at least I'm past this error and on to the next one.
I appreciate the help, Don and David!
Thanks,
-Steve -
SAP BW Universe OLAP @prompt LOV using object reference not working
I have tried to follow Didier MAZOUÉ's "[OLAP universes best practices|https://boc.sdn.sap.com/node/20081]" document to create calculated measure in a OLAP universe built on top of a BW cube directly. The objective is to get the revenue figure from the same period of the previous year. I wanted to be able to have a LOV to specify a period when the object is used in a webi report.
When I hard coded the LOV as a data set as displayed in the following example ( {'[CD2007009]','[CD2007010]'} ) The prompt worked as expected.
(PARALLELPERIOD(.[LEVEL01],1,[0FISCPER].@Prompt('Period?',A,{'[CD2007009]','[CD2007010]'},mono,free)),[Measures].[0G_AERLOS])</EXPRESSION>
When I build my expression using an object referece as ( 'TimeFiscal year period' ), I was given an error msg saying "invaid prompt definition". I verified my spellings and syntax and they were correct based on the examples provided by the best practice document.
(PARALLELPERIOD(.[LEVEL01],1,[0FISCPER].@Prompt('Period?',A,'TimeFiscal year period',mono,free)),[Measures].[0G_AERLOS])</EXPRESSION>
Is there anything obvious that I missed. Or there are some extra configuration I have to do on SAP BW or Universe side?Hi Mr. MAZOUÉ,
After a few days of struggling with this particular prompt issue, I finally figured out what was wrong with it. The object reference in the @prompt function is not able to process object references in a subclass correctly.
For example:
@Prompt('Period?','A','TimeFiscal year periodL01 Fiscal year period',mono,free)
The 'Fiscal year period' is a subclass under the main class 'Time'. If you use this prompt function in a MDX expression, it parse correctly. But it generates a prompting failure when referencing the object with the embeded prompt function in a webi report.
However, if I move the 'L01 Fiscal year period' object underneath the 'Time' class and change the prompt as @Prompt('Period?','A','TimeL01 Fiscal year period',mono,free). I was able to get a list of values when I designed a webi report using the object.
This seems to me is a limitation from the current OLAP Universe implementation.
Looking forward to your feedbacks!
thanks -
Object reference error while using DM add-in in excel
hi everyone!
I instelled data mining add-in for excel 2013, tried to use it - several tools was available, other needed MS SQL Server - i installed it too, connected Excel to Server and now a can't use this add-in at all. All i see is error "Object reference not
ser to an instance of an object".
Excel 2013 64 bit
MS SQL Server 2014 Trial version
Powerpivot included
Thank you in advise!did u deploy your dbadapter through console to the plan mentioned for deployment?
-
I want to create a local object reference variable in a TestStand sequence file programatically using C#.
Hi,
Accoring to your reply in this Thread
http://forums.ni.com/ni/board/message?board.id=330&thread.id=26984
Just try this example. There you will create a numeric variable during excuting a sequence!
Hope this is what you are looking for.
Please attach all your questions here.
juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
Attachments:
CTestStandDialog.zip 31 KB -
Using string to create object reference?
How do I use a string to dynamically set an object reference?
For example, I have a pop up window with a function to set
the text of a text object in the main application:
Application.application.t1.text = completeString;
The "t1" is the object, of course. There are several such
objects, t2, t3, etc. I'd like to make this a variable item in the
popup, and pass the reference to WHICH text object (eg, "t1' or
"t2") from the popup's parent.
So, if the variable was something like "whichBox" (not sure
what to type it as), then I'm looking for something like:
Application.application.
whichBox.text = completeString;
Which I cannot get to work... what am I missing here?perhaps you can try this...
Application.application[myParam].text
where myParam is a String var with the value of 'whichBox' or
whatever name you wanted.
Maybe you are looking for
-
I restarted my Mac mini and now it won't stop and stays on the apple logo screen. Why and how can I fix it?
-
File - Script menu is missing in my AE CS6
Hi, after reinstalling my OSX ML from a time machine I had some several crashing problems in Adobe suite, so I reinstalled them all, My problem is that my Script menu is gone in After Effects...
-
Delimiter for .xls file in lsmw
Hi, I am developing an lsmw..and the flat file is in the form of .xls file..so when sepcifying hte file it asks for the delimiter.what should i give for delimiter if my flat file is a .xls file? i would reward points for the helpful answers.
-
Where to dowload table script for demo table EMPLOYEE
Hello! I'm reading the book "Oracle PL/SQL Programming, Fourth Edition" By Steven Feuerstein. And I can't find the script for the employee table .. Where can I get it? Regards Tobias
-
ALV Report Development using OOPs concept
complete details of " ALV Report Development using OOPs concept". Thanks in advance ...