Skip to Content
0
May 06, 2016 at 11:07 AM

OdataModel create deep have error: No default virus profile active or found

297 Views

Dear Friends,

I create Header and item entityset and make a navigation between them. I also imp the method: /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY But when I try to use this code to create Order , it have this error :

No default virus profile active or found. Please check the offical guide.

My controller code:

//Create Body

var requestBody = {};

requestBody.Customerpo = '123';

requestBody.Soldto = 'WW';

//Child Body

var child = [];

child.push({ Itempos: '123', Product: '234234', Description: 'XCF'});

child.push({ Itempos: '153', Product: '23334', Description: 'YCF'});

//Add child to request

requestBody.SalesOrderToItem = child;

var createOdata = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZFCRM_ORDER_CREATE_SRV/");

createOdata.create("SaleOrderHeaderSet",requestBody,null,

function(oEvent){

alert(msg);

},function(oEvent){

alert(msg);

});

But When I create the entity without the navigation, it will work, it will enter the CREATE_ENTITY method withour error, So how do we create the odata with association ?

var oEntity1 = {Customerpo: "test"};

var createOdata1 = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZFCRM_ORDER_CREATE_SRV/");

createOdata1.create("SoldtoSet",oEntity1,null,

function(oEvent){

alert(msg);

},function(oEvent){

alert(msg);

});

Thanks for your sincerely answer!

Attachments