Calling Standard Method of Object
Dear All,
I had requirement to call standard method 'CANCEL' of Object(MOVEINDOC) in abap program.But the problem is that the method is not released.How can i call this method in abap program.
Thanks to all.
I found in Metalink that this is really NOT supported by Oracle Objects : http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=FOR&p_id=189601.995
Zlatko, your solution is pretty but i am not sure it is usable for my wide object hierarchy (very wide) which i have to rewrite.
Similar Messages
-
Calling a method from object o
hi
event.getsource() returned a variable of type object. But in fact, this object is of type JTextField.
Now, I want to call : the method getName of this returned object.
This doesn't work:
JTextField tf = (JTextField)e.getSource();
tf.getName();
it allways returns null.
what am i doing wrong?
Thank you!
Christianif tf.getName() returns null (rather than throwing a NullPointerException which is different) then the reason is that the name of the returned field IS null.
Are you sure you didn't mean to call tf.getText() ?
D. -
Calling inherited method of object
Dears,
I have this problem:
test case
-- base type
create or replace type T_integer as object
val Number,
member procedure set_value( pValue Number)
) not final instantiable
create or replace type body T_integer IS
member procedure set_value( pValue Number) is
begin
if( abs(mod(pValue,1)) > 0 ) then -- not whole number
raise value_error;
else
self.val := pValue;
end if;
end;
END T_integer;
-- subtype
create or replace type T_integer_positive under T_integer
overriding member procedure set_value( pValue Number)
) not final instantiable
create or replace type body T_integer_positive IS
overriding member procedure set_value( pValue Number) is
begin
if( pValue < 0 ) then -- not positive number
raise value_error;
else
/** HERE IS THE PROBLEM *******/
T_integer.set_value(self, pValue);
end if;
end;
END T_integer;
I need to call supertype's method in subtype but it leads to recurse.
declare
foo T_integer_positive := T_integer_positive(1);
begin
foo.set_value(58);
dbms_output.put_line(foo.val);
end;
this pl/sql block never ends.
Please can somebody help me how to call method of supertype in overriden method of subtype.
In Pascal there is reserved word "inherited", what is in Oracle ?
Many thanks fo any suggestion.
afThanks to all.
I found in Metalink that this is really NOT supported by Oracle Objects : http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=FOR&p_id=189601.995
Zlatko, your solution is pretty but i am not sure it is usable for my wide object hierarchy (very wide) which i have to rewrite. -
Flex call Java method/objects?
Hi guys,
I have a Flex application embedded in a Java Swing application.
Can I call Java methods or objects from the Flex application?
How to?
Thanks in advance!
Sha JiangYou register your java class as a bean and put an actionlistener or an action method on the button binding it to the bean.
Did you check out the tutorial section [http://www.oracle.com/technology/products/jdev/11/cuecards/index.html|http://www.oracle.com/technology/products/jdev/11/cuecards/index.html] ?
There is other useful stuff on the jdev home page.
One simple way is to select the button in the jspx file, open the property inspector, click the small triangle on the left to actionlistener. In the dialog appearing you hit new by managed bean and give it all information and new by the method name and enter a method name to call. The new method will be created in the bean class for you. From this method you call your custom method.
Timo -
How to call standard SAP method in the Custom Program ?
Hi,
i need to call sap standard method 'OpenItemRollinout' in my custom program. For the SAP Standard method 'OpenItemRollinoun' the BOR(Business Object) is 'PAYSCHEME'. So how to call the SAP standard method in the custom program ???Hi,
In the method that you have provided only one function module is being used so better use the FM and copy the remaining code based on ur requirement.
FM is ISU_S_PAYSCHEME_ROLLIN_ROLLOUT.
Regards,
Vijay. -
Static method called from a null object reference
Hello folks,
Here´s the code:
public class TestClass {
public static void main(String[] args) {
StaticNull _null_ = null;
_null_.testNull();
class StaticNull {
public static void testNull() {
System.out.println("testNull");
}I know that a static method belongs to the class, so you don´t need an
instantiated object of that class to call it. But in the code above, as
I'm calling the testNull method from a null reference, shouldn't a NullPointerException
be thrown?
Best regards,
Dannielsometimes wrote:
yawmark wrote:
Calling static methods from a reference variable should be considered a bad practice. Our coding standards prohibit it, and I suspect we're not the only ones.
~what are you trying to say? your coding standard encourages what tricks to invoke static methods? i mean other than using a 'reference variable'?I think you are misreading yawmark's comment. He was saying that invoking a static method using a reference variable -- as though the method weren't static:
var.staticMethod();...is bad practice. His shop's coding standards prohibit it. And that's a common coding style standard. IDE's often warn you of that, right?
edit: and judging by your reply #7, you and yawmark would bond over a few jars of cold beverages. You seem think with one mind. -
Which object called the method
Suppose there is a class A which has three objects a1,a2,a3 and a method m. Now I'd like to know which particular object has called the method m.
>
which particular object has called the method
What class called my method
http://developer.java.sun.com/developer/qow/archive/104
a.The advice in the posted link is unreliable as the format of printStackTrace() is not standardized. A more reliable way to find out the calling class is to use SecurityManager.getClassContext() or Throwable.getStackTrace() [in JDK 1.4+].
However, it is not clear whether the original poster wanted to know the calling class or the calling object. In the latter case there is no easy way except for modify the signature of method m to accept the reference to the calling object.
Vlad. -
Generically calling a method on an object
Hello,
I am trying to write a small utility method to generically call a method on an object.
This is what I have.
public static void doCall(Object o, String methodName, Object ... args){
Class[] types = new Class[args.length];
int i = 0;
for(Object arg : args){
types[i] = arg.getClass();
try {
Method m = o.getClass().getMethod(methodName, types);
m.invoke(o, args);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Error dynamically calling method " + methodName + " on " + o.toString());
}It doesn't work because it can't find the method. If I hard code the parameter types as "new Object[] {Double.TYPE}" it works fine (on methods that take a double).
So, my question is, how can I generically set up the parameter types based on the types of the arguments?
Thanks,
~EricThe problem is not on calling agr.getClass(), your primitive double is already autoboxed to a Double object. It is the doCall(...) method who expects an object, not a primitive. So when giving it a primitive value, java autoboxes it to the corresponding object type.
This means your attempt will only work if the methods to call do not have any primitives as parameters.
Test this code:
public class GenericMethodCaller {
public static void doCall(Object o, String methodName, Object ... args){
Class[] types = new Class[args.length];
int i = 0;
for(Object arg : args){
types[i++] = arg.getClass();
try {
Method m = o.getClass().getMethod(methodName, types);
m.invoke(o, args);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("Error dynamically calling method " + methodName + " on " + o.toString());
public static void main(String[] args) {
Callable callee = new Callable();
callee.callabelMethod(10d);
GenericMethodCaller.doCall( callee, "callabelMethod", 10d ); // 10d gets autoboxed to a Double object.
class Callable {
public void callabelMethod(Double o) {
System.out.println("callabelMethod(Double o) called");
public void callabelMethod(double o) {
System.out.println("callabelMethod(double o) called");
}The output will be:
callabelMethod(double o) called
callabelMethod(Double o) called
- Roy -
Problem in calling method with object in another class
Hi All,
Please tell me the solution, I have problem in calling a method I am posting the code also
First Program:-
import java.io.*;
public class One
public One()
System.out.println("One:Object created");
public void display()
System.out.println("One:executing the display method");
static
System.out.println("One:executing the static block");
Second Program:-
import java.io.*;
public class Two
public Two()
System.out.println("Two:Object created");
public static void main(String arg[])throws Exception
System.out.println("Two:executing the main method");
System.out.println("Two:loading the class and creating the object::One");
Object o=Class.forName("One").newInstance();
System.out.println(o);
o.display(); //displaying error here in compile time.
static
System.out.println("Two:executing the static block");
waiting for your answer,
thanks in advance,bye.Hi All,
Please tell me the solution, I have problem in
calling a method I am posting the code also
First Program:-
import java.io.*;
public class One
public One()
System.out.println("One:Object created");
public void display()
System.out.println("One:executing the display
method");
static
System.out.println("One:executing the static
block");
Second Program:-
import java.io.*;
public class Two
public Two()
System.out.println("Two:Object created");
public static void main(String arg[])throws
Exception
System.out.println("Two:executing the main
method");
System.out.println("Two:loading the class and
creating the object::One");
Object o=Class.forName("One").newInstance();
System.out.println(o);
o.display(); //displaying error here in compile
time.
static
System.out.println("Two:executing the static
block");
waiting for your answer,
hanks in advance,bye.the line
o.display()
could be written as
((One)o).display(); -
Calling a method from a UICommand Object
How do I call an action method from a UICommand object?
I create a HtmlCommandLink in my backing bean, and I think I should be setting the action, but with what? The method takes a MethodBinding but I can't find much detail on how to get that. I just want to call a method like linkAction1_action() in the example below, but you cannot pass a method.
public class Page1 extends AbstractPageBean {
private HtmlPanelGroup panel = new HtmlPanelGroup();
public HtmlPanelGroup getPanel() {
return panel;
public void setPanel(HtmlPanelGroup panel) {
this.panel = panel;
public Page1() {
HtmlCommandLink link = new HtmlCommandLink();
link.setAction(/* what do I put here */);
this.panel.getChildren().add(link);
public String linkAction1_action() {
return "GoBack";
}OK. A couple days later and I am able to answer my
own question. Anyway, I will lay it out there for
anyone interested. This worked for me...
public class Page1 extends AbstractPageBean {
private HtmlPanelGroup panel = new HtmlPanelGroup();
public HtmlPanelGroup getPanel() {
return panel;
public void setPanel(HtmlPanelGroup panel) {
this.panel = panel;
public Page1() {
HtmlCommandLink link = new HtmlCommandLink();
link.setAction(
FacesContext.getCurrentInstance()
.getApplication()
.createMethodBinding("#{Page1.linkAction1_action}",
new Class[0]));
this.panel.getChildren().add(link);
public String linkAction1_action() {
return "GoBack";
Since you're setting the action from within the Page1 object, why don't you create a method binding manually? This will be much more performant that using the application to create and EL-based binding.
Try:
link.setAction(new MethodBinding()
public Object invoke(FacesContext facesContext, Object[] objects) throws EvaluationException, MethodNotFoundException
return linkAction1_action();
public Class getType(FacesContext facesContext) throws MethodNotFoundException
return String.class;
});Note that you also avoid any naming convention - you do not require your Page1 object to be configured as a managed bean "Page1". -
RMI server calling a method on a client object ?
Hi All,
I am writing a client - server application and my intention is to use RMI for comunication.
When the client has to retrive datas from the server it's easy, but let's suppose that the server has to inform the client about some updates about the data, how can I do that?
I do not want the client keeping calling methods on the server to see if there is something of new :(
Is there some way to pass an OutputStream to the client, so when the server writes someting, the client reads it ? ( the client should have a thread which keeps reading)
Or maybe I could pass a reference of a client class to the server so when the server needs to inform the client, it calls a method on this class?
thanks, FabThe client can be a Remote Object to, passed as a remote reference when calling the server.
Basically all you'll have to do is "register" the client on the serverside.
Your serverside class would the have a:
register(RemoteClient client) method.
The server could the use this remote reference for callbacks.
So, all you have to do is declare the Remote Interface for the client and implement it, and the call the servers myRemoteServer.register(this).
If you've already implemented the server, it's a peace of cake to enhance your client. -
Calling a method in BPM Object from jsp page
hi all,
I try to call a method from BPM Object using <f:invokeUrl >
I change server side method properties to yes.
and then how can i get request and response object inside the BPM method.
Thanks.Thanks for ur response,
But i mention about BPM method inside BPM Object.
i found this inside the documentation.
methodName(Fuego.Net.HttpRequest request, Fuego.Net.HttpResponse response)
i need to match above BPM method and <f:invokeUrl > tag. am i right?
But i don't know how to create method with argument "Fuego.Net.HttpRequest request, Fuego.Net.HttpResponse response" inside BPM Object.
I can't find any place to define method argument inside Oracle BPM studio.
I don't know how to parse argument like "Fuego.Net.HttpRequest request, Fuego.Net.HttpResponse response"
With Regards,
Wai Phyo
Edited by: user8729650 on Sep 9, 2009 7:03 PM
Edited by: user8729650 on Sep 9, 2009 9:20 PM -
Calling a method in BPM Object from jsf page
Hi All,
How do I call a method in BPM object from JSF page? Is it possible to invoke it in a manner similar to invoking a method from managed bean in JSF application?
Please help.
Thanks and Regards,
VeronicaYou can use f:invoke (or f:invokea to with parameters)
For ajax calls, you can use f:invokeUrl to get the URL to a particular method within your BPM object, although make sure the Server-Side Method property is set to Yes.
http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/taglib/index.html -
Vector, calling a method of an object in a Vector
hi and sorry for my poor english.
problem:
i have a Vector:
Vector objects = new Vector();i put some Objects in this Vector:
objects.addElement(new testObject());in the class testObejct() i've defined some methods like:
public method1() {
System.out.println("bla");
}how can i call that methods now by my Vector?
this doesn work :(
objects.lastElement().method1();thanx :)The vector method lastElement() returns an Object type so you need to cast the Object retrieved to the correct type before you can call one of it's methods.
Try something like
testObject to = (testObject)objects.lastElement();
to.method1();you can use instanceof to test if a class is a member of a particular type -
Calling Java Method on an Object?????
It is quite clear how to call a method that passes an argument in Express i.e.
<invoke name='methodName' class='com.waveset.ui.ClassName'>
<ref>argument</ref>
</invoke>
Essentially this is the same as calling
methodName( argument );
How is is possible to call a method in a class that operates on the object i.e.
object.methodName( );
i.e.
com.waveset.object.GenericObject has a method called toMap( ) which returns the GenericObject back as a Map.
A User View is a GenericObject so how do you call a method on the User object i.e.
<ref>user</ref>.someMethod( ); or user.toMap( ); rather than
<invoke name='toMap' class='com.waveset.object.GenericObject'>
<ref>user</ref>
</invoke>
This will not work because there is no method called toMap that takes a GenericObject as a argument.
I can't find any documentation that addresses this issue.The invoke tag is handled differently depending on its arguments.
<invoke name='methodName' class='com.something'>
<ref>someVariable</ref>
</invoke>is calling static method methodName on class com.something and passes someVariable as an argument
If you leave the class name out of the invoke, it calls the method on the first variable within the tag (the object). The remaining variables act as arguments to the method.
Here's a trivial example. It creates a HashMap and then performs a 'get' on one of its keys (name)
<invoke name='get'>
<new class='java.util.HashMap'>
<map>
<s>name</s>
<s>Darth Vader</s>
<s>type</s>
<s>villain</s>
</map>
</new>
<s>name</s>
</invoke>Here's a more complex example:
<new class='com.waveset.object.Resource'>
<invoke name='toXml'>
<invoke name='getObject' class='com.waveset.ui.FormUtil'>
<ref>:display.session</ref>
<s>Resource</s>
<s>Active Directory Resource Adapter</s>
</invoke>
</invoke>
</new>This calls the static getObject method returns a com.waveset.object.PersistentObject, which in turn has toXML invoked on it (returning a java.lang.String serialized version of the object) which is then used as the argument for constructing a com.waveset.object.Resource object.
Jason
Maybe you are looking for
-
How do I disable the remote on my MacBook Pro
How do I disable the remote on my MacBook Pro, every time I use my remote for my Apple TV iTunes starts playing.
-
Movie on wrong machine - any way to move?
I think I messed up and am looking for some advice. I bought the Home Run Derby TV show for my son, and I used my computer to do that. But I'm an idiot -- my machine doesn't have a DVD burner on it; our other machine has that. I take this machine to
-
Video from PC to be saved in iCloud?
Can someone tell me how to upload video from PC to be saved iCloud? and then be played in my iPad through Videos? Thanks!
-
help?
-
Hi, iam displaying output using alv grid(function modulues). i want to display the page numbers like 1 of 4(total pages) in top-of-page. how can i display? Regards, suresh.