cancel
Showing results for 
Search instead for 
Did you mean: 

com.sap.tc.webdynpro.progmodel.context.ContextException - Cannot modify ..

Former Member
0 Kudos

Hi All,

I am getting the below mentioned error, while running the application. I am trying to sent some values to backend from input box which is mapped to the context attribute in the view context controller....to be clear i am setting a value to be sent thro a model attribute from a UI element...

"com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(FinalWSTestView): cannot modify Portal_SpcQuery_SpcId because it is mapped and there is no active NodeElement to take the value "

Can anyone tell me how to bind the modelattribute to the uielement?? or else the reason for this error

Any Help greatly appreciated

Accepted Solutions (0)

Answers (2)

Answers (2)

nikhil_bose
Active Contributor
0 Kudos

You can directly assigning model to the input element field if all input elements gets the value.

Here the node you are trying to add has no parent at runtime.

you can see this in the cardinality of your model node - properties.

So you have to create an element for the node so that it comes into existence during runtime.

If you are still not clear, give me the model in view context and your code to initialize those in the view

regards,

nikhil

Former Member
0 Kudos

Hi,

This is how my context is in the view controller.All are model node with model attributes.

Context

Req_Work (ROOT MODEL NODE)

GetAcc_Prod (MODEL NODE)

AccID (MODEL ATTR) -


I have assigned my input UI field to this node attribute,this is where user enters some value and clicks enter using button

GetAcc_Prod_Response(MODEL NODE)

|

Prod_Response(MODEL ATTR) --- I have assigned this to an input field has well which will hold the response from the backend

Everytime i load the application the input field is disabled.As per your comments do i need to create a node element of type "GetAcc_Prod" and then assign it with "AccId" and then bind it??Am i right ?Could you please provide the sample code to do this based on the context and do i need to put in wdDoInit() of view controller??

Any help greatly appreciated..Thanks

Former Member
0 Kudos

Hi,

This is how my context is in the view controller.All are model node with model attributes.

Context

Req_Work (ROOT MODEL NODE)

GetAcc_Prod (MODEL NODE1)

AccID (MODEL ATTR I have assigned my input UI field to this node attribute,this is where user enters some value and clicks enter using button)

GetAcc_Prod_Response(MODEL NODE2)

Prod_Response(MODEL ATTR I have assigned this to an input field has well which will hold the response from the backend)

Everytime i load the application the input field is disabled.As per your comments do i need to create a node element of type "GetAcc_Prod" and then assign it with "AccId" and then bind it??Am i right ?Could you please provide the sample code to do this based on the context and do i need to put in wdDoInit() of view controller??

Any help greatly appreciated..Thanks

Edited by: Aravind Sathiyanarayanan on Feb 29, 2008 6:48 AM

Edited by: Aravind Sathiyanarayanan on Feb 29, 2008 6:58 AM

nikhil_bose
Active Contributor
0 Kudos

aravind,

field is disabled since all the node attributes are not talking the values at same time. So you have to create a value node and bind that to the model node.

[code]

// create Get acc_prod element

IPrivateView.IGetAcc_Prod acc_prod = wdContext.createGetAcc_ProdElement(); // it may ask model instance as param

wdContext.nodeReq_Work().addElement(acc_prod);

//set input values

acc_prod.setValue("params");

// execute RFC

wdContext.currentReq_workElement().modelObject().execute();

[\code]

reply status

Former Member
0 Kudos

Thanks for you help, i am getting this error now...

"Exception on execution of web service with WSDL URL 'C:\Documents and Settings\test.wsdl' with operation 'Req_Work' in interface 'Get_ProductSP'"

I have only mapped one input element from view controller to component controller where as my component controller is mapped to all the input element from the backend webservice.Do i need to get the only required input from backend webserive to component controller and then map it to view controller?

Former Member
0 Kudos

//set input values

acc_prod.setValue("params");

How to get the value of input field --"params"

nikhil_bose
Active Contributor
0 Kudos

Question is not clear. If this is an Output field of your RFC, you can directly map that value to the UI Element.

If it is input for your RFC, since you are not using model node, you have to create a value attribute to accept inputs and that node values should be put in to the model attributes before executing the RFC.

in the action() of the UI where you are calling the context.modelObject().execute() before that you have to put the input values for the RFC.

eg: suppose you have created a value attribute acc_no and mapped that to the UI element. You will get the value at runtime, now before calling RFC you need to set input value to RFC model.

For this you have to create an Element for your model say acc_prod is the element. and acc_prod has a field acc_no which is input to RFC.

before executing RFC, you have to set all input parameters for the RFC.

i.e. acc_prod.setAcc_no(wdContext.currentContextElement().getAcc_no());

hope you got the idea

Former Member
0 Kudos

hai Aravind,

This error usually occurs when you use IWDmodify class for value help and try to map the same attribute in context.If u use this class it ll not allow you to map that particular attribute.So plz check if you do mapping that way.

Thanks n Regards

Sharanya.R