on 08-16-2016 7:42 AM
i have create Create Deep Entity in which create entity logic is present and its working fine in gateway client
But i dont know how to consume it in SAP WEB IDE
In sap web IDE i choose CRUD template for this.
but not able to create the entry plz help me regarding this.
Hi,
You have to create an instance of odata model & perform create operation on Model.
var oModel = new sap.ui.model.odata.ODataModel(gatewayServiceUrl,true);
Create a JSON type of data
var globalJSON;
var Items = []; // Item level Record
for(var i = 0 ;i <itemreocrd.length;i++)
{
// sample code
var objItems = new Object();
objItems.key1_Item = 'value1';
objItems.key2_Item = 'value2';
Items.push(objItems);
}
var oEntry= {};
oEntry.Key1_Header = 'Value1'.
oEntry.Key2_Header = 'Value2'.
oEntry.Items = Items; // contains array of objects.
try now oModel.create('/collectionName', oEntry, null, function(success){},function(oerror){});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
my sapui5 code is right but do u knw how to hit the create deep entity,i mean my create deep entity set is not going to be hit.
when i click on save button my HeaderEntity hits
Hi,
Could be please ensure that your oEntry.Items Name , i.e. Name of the Key which has array of objects , and the Navigation Name in developed model Gateway Service is same (Case sensitive).
Also could you please ensure that your navigation properties name in gateway model & the field name inside the Deep Structure which accepts Table Type is same.
this is the way i have created the service in odata gateway client m able to create PR that is working fine but when same service i consume from sapui5 my create deep entity is not hitting
What I am thinking , Instead of Using
/PRHeadreCollection() , Try using PRHeaderColletion ( i.e remove Brackets from the end)
and in the link , /PRItemCollection(PRNumber=''...) try using only /PRItemCollection.
Hope this could also hit you deep entity and also share UI5 code snapshot for better understanding.
Hi Prafulla,
Thanks for your valuable suggestions.now i am sharing screenshots of sapui5 code.
plz check if you could find something.
Screenshot1 : code of view.js.
Screenshot2: how it looks initial screen .
i have Display DocumentType and PRnumber on the initial page.
Screenshot3:- show controller code in which model is bind.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.