on 11-05-2008 6:19 AM
Hi,
This is very simple RFC web dynpro application
the error java.lang.NullPointerException is seen
this happens whenver i access my model node
error is for the code line where i pass value to the model node or when i initialise the model node
cardinality of this node is 0....1
kindly help
thanks
Hi
Change cardinality 1:n
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I added the code of adding element to the node
i got the message
com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(Datacust.Bapi_Repmanconf_Create_Mts_Input.Bflushdatagen): value node is created without a reference
data is passed
from node 1...1(this ones mapped to the view)
to node 0...1 (this is a model node and its sub node of a node which is also 0..1)
my code is simple -
wdContext.currentBflushdatagenElement().setBackflquant(wdContext.currentCtx_inputElement().getBackflquant());
kindly help
thanks
Hi Rita,
In the component controller, you need to execute that model as well. RFC call is handled automatically by the model.
Please look into this code snippet.
wdcontext.current<XYX>_input_elements().modelObject.execute();
This code will execute the model and hence the RFC call for getting the input data.
You need to execute the model for getting the data.
Thanks and Regards
Pravesh
hi,
I have already done rfc call.
now its working
wid different combinations of cardinalities and also to make sure that empty node is not passed to 1...1 cardinality node
but as it worked with random settings, i dont know the exact rules
cud u please recommend any document which i can always refer while coding ?
thanks very much fr helpful inputs
Hi
Following will help you https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2brfc
Regards
Ayyapparaj
Hi Rita,
Please refer to my first reply. There I have explained the reason why and how the cardinality is effecting the output and the error is displayd to you.
When cardinality is
0:1
0:n
Then that means that there are initially no element for that node and you need to create the element explicitly. Please refer to the code I have sent in my first reply.
If the cardinality is:
1:1
1:n
That means that there is a defualt element created for thisn ode and you can access this element without creating a new element.
Cardinalities depend on your requirements. Please refer to the link posted by Ayyapparaj above. Hope these inputs will help you.
Also close this thread if the problem is solved.
Thanks and Regards,
Pravesh
Hi,
before reading it call the rfc.
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rita,
Try to create an element of the node first and then access this particular element. I think you are accessing the nod element without creating it. Since the node cardinality set by you is 0:1, therefore initiallly there will no elements in the node.
Just try this line of code..
wdContext.createAndAdd<Node_Name>Element();
OR
Change the cradinality of the node to 1:1 if you require only 1 element in the node always OR ELSE change it to 1:n if there are more than 1 elements.
If you need any further information please revert back.
Thanks and Regards
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you post the entire stack of the error and the code that you are using?
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.