cancel
Showing results for 
Search instead for 
Did you mean: 

Fill Navigation in Odata Model as payload

0 Kudos

Hello Experts,

Any idea how to fill the navigations HeaderToItemAA and HeaderToItemFI from SAP.m.Table(view data) as payload Odata Model

  1. Bukrs: "1111"
  2. Ckmaa: true
  3. Ernam: "Bikash"
  4. HeaderToItemAA: {__deferred: {…}}
  5. HeaderToItemFI: {__deferred: {…}

Thank

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member466198
Participant
0 Kudos

Hi Bikash,

from your question, i understand that you want to do two expand call in one time.

try this,

var aExpands = ['HeaderToItemAA','HeaderToItemFI']

and this in _bindViewNav:

this.getView().bindElement({

path: sObjectPath,

parallelExpand : aExpands.join(",");}

jhodel18
Active Contributor
0 Kudos

Hi Bikash,

Here's a sample if you're doing it in freestyle UI5 (my assumption):

_bindView: function (sObjectPath) {
    this.getView().bindElement({
        path: sObjectPath,
        parameters: {
            expand: "HeaderToItemAA,HeaderToItemFI"
        }
0 Kudos

Hello Jhodel,

Here is my code.I am trying to save all data header and items in one call. In header I am receiving the data but not in items. That is why I am trying push data to navigation HeaderToItemAA and HeaderToItemFI from UI5 level. I am using HEADER_UPDATE_ENTITY here.And the import structure is deep one.

handleSavePress: function(oEvent) {

var oDataModel = this.getView().getModel();

var vPath = this.getView().getBindingContext().getPath();

var vBukrs = this.getView().getModel().getProperty(vPath).Bukrs;

var sObjectPath = this.getModel().createKey("CompCodeHeaderSet", { Bukrs : vBukrs });

this._bindViewNav("/" + sObjectPath);

var payload = this.getView().getModel().getProperty(vPath);

oDataModel.update("/CompCodeHeaderSet('"+vBukrs+"')", payload,{

success: function(oResponse){ Toast.show("Success"); },

error: function(oResponse){ debugger; Toast.show("Error"); } });

_bindViewNav: function (sObjectPath) {

this.getView().bindElement({

path: sObjectPath, parameters: {

expand: "HeaderToItemAA" } }); },

Thanks