on 05-16-2006 3:54 PM
Hi,
any idea how to give a parameter to a method of a remote used class?
the remote class gets initiated correct, but in the interface of the method I call is only a importing parameter that can not be changed...
thanks in advance,
Sebastian
Hello Sebastian,
It seems you have used ABAP-ENDABAP block in your eCATT command editor and then you tried calling one method of a remote class.
If above is what you have used then following verification can be done -
1. Call ABAP-ENDABAP block using Pattern button from the application toolbar of SECATT transaction in the command editor.
2. Use ABAP-ENDABAP block.
3. In the ABAP-ENDABAP block, initialize the class that you want to use.
4. Now using this newly created & instantiated object of the class, call the method.
5. Check for the visibility of the parameters you are passing i.e. whether they are private, public or protected of the same class or inherited from some other class.
6. For public & protected variables you will be able to pass on the values.
If above is not the case with you, kindly elaborate your query with code.
PS Plz reward points to everyone responding if the answer helps you.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
my coding is:
CREATEOBJ ( class_param , interface , destination ).
now I want to call a method of this remote created class using callmethod...
If I use pattern->callmethod for this remote object and enter the method eCATT says that the class was not found... I debugged eCATT and found that eCATT looks for the class, but the destination from the createobject is missing, so I entered the correct destination via debugger so that he found class and method... the following code is generated then
CALLMETHOD ( Class_Param , Method_Param , Interface ).
but the interface is not correct, I would expect the parameter 'INPUT' but there is only a 'IMPORTING' parameter which doesn't help me...
---
so how to call the method of a remote-created-object of a class?
Hello Sebastian,
The destination is optional parameters. So when the command of CREATEOBJ is inserted into the command editor of SECATT, remove the destination part. Destination you can give at execution time also in the SYSTEM DATA & TARGET SYSTEM.
Find the following link of SAP HELP for creating object using pattern button -
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/50423fd9575003e10000000a114084/content.htm
Now the method that you are calling needs to be ONLY PUBLIC. Find the following link of SAP HELP for calling method using pattern button -
http://help.sap.com/saphelp_erp2004/helpdata/en/12/ef383fe58d5900e10000000a114084/content.htm
Again if you are calling a static method then there is a separate method CALLSTATIC that you can use. Find the following link of SAPHELP for the details -
http://help.sap.com/saphelp_erp2004/helpdata/en/55/ef383fe58d5900e10000000a114084/content.htm
IMPORTING in eCATT denotes the input parameter.
Kindly check once again the methodology to be followed for the creation of object & calling of methods from the above SAP HELP links. Also check the visibility of the methods you are calling.
Hope this helps you!
PS Plz do reward points to everyone responding if the answer helps you.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.