cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro RFC module BAPI_MATERIAL_GET_DETAIL

Former Member
0 Kudos

Hi, Experts:

My environment is Netweaver CE 7.1, and NWDS version is 7.1.0.081107100357. I have created a component to use Adaptive RFC2 model-BAPI_MATERIAL_GET_DETAIL, and code as below:

try

{

MaterialListModel materialListModelModel = new MaterialListModel();

Bapi_Material_Get_Detail_Input bapi_Material_Get_Detail_Input = new Bapi_Material_Get_Detail_Input(materialListModelModel);

// Bapi_Material_Get_Detail_Output output = new Bapi_Material_Get_Detail_Output(materialListModelModel);

// Bapimatdoa material_General_Data = new Bapimatdoa(materialListModelModel);

// output.setMaterial_General_Data(material_General_Data);

bapi_Material_Get_Detail_Input.setMaterial(wdContext.currentSearchElement().getMaterial());

wdContext.nodeBapi_Material_Get_Detail_Input().bind(bapi_Material_Get_Detail_Input);

wdContext.currentBapi_Material_Get_Detail_InputElement().modelObject().execute();

// for(int i = 0; i < wdContext.nodeMaterial_General_Data().size(); i++)

// {

// //IMaterial_DetailElement MatDetail = wdContext.createMaterial_DetailElement();

// //IMaterial_General_DataElement MatData = wdContext.currentMaterial_General_DataElement();

// //MatDetail.setBase_Uom("PA");

//// MatDetail.setBase_Uom(MatData.getBase_Uom());

//// MatDetail.setBasic_Matl(MatData.getBasic_Matl());

//// MatDetail.setMatl_Desc(MatData.getMatl_Desc());

//// MatDetail.setMatl_Group(MatData.getMatl_Group());

//// MatDetail.setMatl_Type(MatData.getMatl_Type());

// //wdContext.nodeMaterial_Detail().addElement(MatDetail);

wdComponentAPI.getMessageManager().reportSuccess(wdContext.currentMaterial_General_DataElement().getMatl_Desc());

// }

wdContext.nodeOutput().invalidate();

}

catch(ARFC2ModelExecuteException e)

{

wdComponentAPI.getMessageManager().reportException(e.getMessage());

}

Once I run the application, the error as below:

com.sap.tc.cm.base.exception.BaseModelRuntimeException: Class 'java.lang.String' of new attribute value is not assignment compatible for attribute 'Emptiesbom' of type 'boolean' in model class 'com.sap.demo.wdrfc2.materiallistmodel.Bapimatdoa'

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.ARFC2GenericModelClass.checkOrInitiateUnMarshalling(ARFC2GenericModelClass.java:205)

at com.sap.tc.cm.arfc2.model.ARFC2GenericModelClass.getRelatedModelObject(ARFC2GenericModelClass.java:402)

at com.sap.tc.cm.arfc2.gci.ARFC2TypedModelClass.getRelatedModelObject(ARFC2TypedModelClass.java:113)

... 83 more

As my understanding, the field Emptiesbom is Char 1 in R/3 system, then after import to NWDS, it's changed to boolean type, so how can I change the field type in NWDS's model structure, or it's belong to the NWDS bug?

Thanks in advanced.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Finished`

Former Member
0 Kudos

Can you tell me how you resolved this?

Former Member
0 Kudos

Luciano,

Sorry for reply lately, to call RFC, you must create destination in your server.

In NWA->Configuration Management->Security->Destination, Create the two destinations you want to use in your model.

Former Member
0 Kudos

Were you able to resolve this issue?

Former Member
0 Kudos

Yes, Thanks.

I have solved this issue.