on 07-16-2009 5:19 AM
Hi Experts ,
I'm using Web Dynpro for Java to develop our project. I have issues when I use RFC 2 model to call BAPI function . I already create the RFC 2 model successfully to call one PO BAPI function --- BAPI_PO_GETDETAIL. The whole project build and deploy successfully. At run time, it will call the execute() function of the model object. It also works fine and get the return values.
I just want to get two return objects : PO_Items and PO_Item_Schedules .
So far, every thing works fine. But when I want to iterate the PO_Items node and get each property value of current element, the following error occurs :
com.sap.tc.cm.base.exception.BaseModelRuntimeException: Class 'java.lang.String' of new attribute value is not assignment compatible for attribute 'Prnt_Price' of type 'boolean' in model class 'com.sap.demo.localwd.qaspomodel.Bapiekpo'
at com.sap.tc.cm.base.model.BaseGenericModelClass.setAttributeValue(BaseGenericModelClass.java:306)
at com.sap.tc.cm.arfc2.model.ARFC2GenericModelClass.unmarshalFromJCoRecord(ARFC2GenericModelClass.java:287)
at com.sap.tc.cm.arfc2.model.ARFC2ModelObjectCollection.doUnMarshalAt(ARFC2ModelObjectCollection.java:97)
at com.sap.tc.cm.arfc2.model.ARFC2ModelObjectCollection.get(ARFC2ModelObjectCollection.java:120)
at com.sap.tc.webdynpro.progmodel.context.ModelElementList.getElement(ElementList.java:1726)
... 72 more
I use the same way to iterate PO_Item_Schedules element. It also works fine. Therefore, I don't know why this error happens?
Hi,
Prnt_Price attribute is returning boolean value, you are assigning it to string that's what u r getting that exception.
u try these options.
1) declare one boolean variable and assign Prnt_Price to that variable.
2) Explicity convert boolean to string.
Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
I continue this thread because it seems that I have the same problem as the one asked by Wester Wei.
I'm developping an application on NWDS using CE 7.11 (I've learned RFC2 with the tutorial [here|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0b102ea-efff-2b10-b3aa-d9e84a2c6bb6?overridelayout=true] ). The problem seems to come from the RFC2 Model, but I just import it (and I can't modify it afterwards, because it is a read-only model).
So, you advise to "declare one boolean variable and assign Prnt_Price to that variable." or to "Explicity convert boolean to string.", I think you are right, but I don't know how to do that in my app (in the component controller ?). Therefore, the attribute that occurs the problem is in the context outputs, to I don't know I will be able to affect it before calling the BAPI.
Could you tell me how to fix this problem without modifying the model (because it's read-only) ?
Thank you for advance,
Louis
hi
some times it happens that when you integrate the RFC in NWDS , the attributre for the RFC would be boolean
and it would reflect as String in NWDS. This may occur because the attribute for the RFC is of type boolean
and its domain type may be char. you have to change either the domain for the attribute or you can
data type of the attribute to string , this would solve your problem.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
prnt_price attribute of BAPI_PO_GETDETAIL type is boolean and you are trying to assign this attribute value to a String variable,so because of type incompatability it is throwing an error.
assign it to a boolean varaible.
Regards
sowmya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.