cancel
Showing results for 
Search instead for 
Did you mean: 

CREATE_DEEP_ENTITY function

maheshgonda
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I have implemented a CREATE_DEEP_ENTITY function in Data Model , how to call this function from UI ?

can we call CREATE_DEEP_ENTITY function using oModel.create() ? if yes then how?

What all are the ways to call CREATE_DEEP_ENTITY function  from UI(Front end)?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Manish

Yes you can call it using oModel.create().

1) Create a oDataModel : = sap.ui.model.odata.ODataModel(url);

2) Make an array for item data : itemData = [];

3) itemData.push ({ Cid '123'. Vid '1111', vname: 'XYZ'});

     itemData.push ({ Cid '124'. Vid '1222', vname: 'ABC});


4) Create request body :  var requestBody = {};

                                             requestBody.cust_id = '123';

                                             requestBody.cust_name = 'YYY';

5) Add ItemData to request : requestBody.<navigation_name> = itemData;

                                             eg: requestBody.Vendors = itemData;


6) Issue Create : oModel.create('/<collection_name>', requestBody, null, function() { alert ('success')}, function() { alert('failed'} );


eg: oDataModel.create("/CUSTOMERS" , requestBody, null, fsuccess,ferror);

Regards

Kanika

saurabh_vakil
Active Contributor
0 Kudos

Refer this blog -