on 03-26-2009 7:27 AM
Hello Experts!
I'm trying to call a custom RFC in my WebDynpro application. No problem calling it. I can even use the return parameters. But when I try to access some EXPORTING parameters, the exceptions are triggered. I've checked that all required importing parameters are passed and that the custom RFC works correctly in R/3.
Here are the exception stacks I get:
java.lang.ArrayIndexOutOfBoundsException: -1
at com.sap.mw.jco.JCO$Record.getString(JCO.java:12829)
at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValueAsString(JcoBaseTypeData.java:669)
at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getAttributeValueAsString(DynamicRFCModelClass.java:427)
at com.kaisa.mwci.models.getprojects.Zps_Fm_Get_Projects_Output.getEx_Name1(Zps_Fm_Get_Projects_Output.java:164)
at com.kaisa.mwci.wd.wdp.IPublicVODownloadComp$IProjectsElement.wdGetObject(IPublicVODownloadComp.java:602)
... 53 more
and
java.lang.NullPointerException
at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValueAsBigDecimal(JcoBaseTypeData.java:648)
at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getAttributeValueAsBigDecimal(DynamicRFCModelClass.java:259)
at com.kaisa.mwci.models.getnetworks.Zps_Fm_Get_Network_Num_Output.getEx_Cwcost(Zps_Fm_Get_Network_Num_Output.java:164)
at com.kaisa.mwci.wd.wdp.IPublicVODownloadComp$INetworksElement.wdGetObject(IPublicVODownloadComp.java:1206)
at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.wdGetObject(MappedNodeElement.java:351)
... 52 more
Hoping for your expert advice on my problem. Thanks!
Cheers,
Alfonso
Hi Paul,
By any chance was there a change in structure of the RFC import, export or table
parameters? Any change in data type of a variable? If yes, then refresh the
meta data cache of J2ee Server. One method of refreshing is by restarting the
J2EE server. There are other method also in which I am not an expert to advice.
Best Regards,
Gopal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
If you are using EP 7.0 and SP>=13 , there is cache invalicaion and i hope there is
no need for server re-start. Below link can help .
murali
Hi All,
Thanks for all the help and suggestion. Gopal had it spot on. There was nothing wrong with my code, this was a server issue which was solved by the server reset.
Thanks for everybody's help. Points awarded.
Cheers,
Alfonso
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Please try to debug the applicaiton , ArrayIndexOutofBound and NullPointer may be due to the
values you are passing to the import parameters , or if you are using Values Node change the cardinality , please try to HARD CODE the values (same values that you have provided in the back end
for the RFC to get output ) , use same HARD CORDED values and debug the application .
This may either due to the values use are passing or cardinality properblem .
And even try to check the size of the output node after you have executed the RFC .
murali
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ayyapparaj,
That's just it. That node is NOT empty. I can get and use the values of the other values within that node except for some.
Thanks,
Alfonso
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paul,
What is the cardinality of your model node? Make sure after executing the RFC you have invalidate the output node.(wdContext.node<Output>.invalidate())
If its 0..1 Then
if(wdContext.node<ModelName>.size > 0)
wdContext.nodeCustomNode.currentCustomNodeElement.setCustomValue( wdContext.node<ModelName>.current<ModelName>Element().get<ParameterName>());
If its 0..n Then
if(wdContext.node<ModelName>.size > 0)
{
int i = wdContext.node<ModelName>.getLeadSelection(); wdContext.nodeCustomNode.currentCustomNodeElement.setCustomValue( wdContext.node<ModelName>.get<ModelName>ElementAt(i).get<ParameterName>());
}
Regards,
Mithu
Hi Yogesh,
But the exceptions occur whenever I access that Model Node. Even if I try to copy it to a Value node like so:
wdContext.nodeCustomNode.currentCustomNodeElement.setCustomValue(
wdContext.node<ModelName>.current<ModelName>Element.get<ParameterName>());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use as follows
//before accessing the current<ModelName>Element make sure that a valid element exists
if(!wdContext.node<ModelName>.isEmpty())
wdContext.nodeCustomNode.currentCustomNodeElement.setCustomValue(
wdContext.node<ModelName>.current<ModelName>Element.get<ParameterName>());
Regards
Ayyapparaj
Hi Yogesh,
Which part of the code? So far, I don't really need any code since the data is directly bound to the Layout element.
Thanks.
Regards,
Alfonso
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please send the code, let me go through
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.