Skip to Content

Fill Navigation in Odata Model as payload

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 25 at 02:04 AM

    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"
            }
    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Aug 25 at 09:33 AM

    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(",");}

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.