Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

How to bind Multi Model / OData Services in Fiori Project?

$
0
0

Hello SAPUI5 developers,

 

 

I try to extend an Fiori app "Approve Supplier Invoice" and want to bind an additional Odata service from the application "TrackPurchase Order".

 

"Approve Supplier Invoice"  MM_SUPPLINV_APV  is used odata service: MM_SUPPLIER_INVOICE_APPROVE

"TrackPurchase Order"       MM_PURORD_TPO    is used odata service: SRA020_PO_TRACKING


I want to use both odata services in one fiori project / extension project.


I have created a project in Ecplise with a structure


     appconfig (fiori sandbox)

     mm_supplinv_apv (main application) - shared with SAPUI5 ABAP Repository - MM_SUPPLIER_INVOICE_APPROVE

     zm_supplinv_apv (extended)

 

 

The binding for odata service and data model is placed in Configuration.js by mm_supplinv_apv application

 

jQuery.sap.declare("ui.s2p.mm.supplinvoice.approve.Configuration");

jQuery.sap.require("sap.ca.scfld.md.ConfigurationBase");

jQuery.sap.require("sap.ca.scfld.md.app.Application");

sap.ca.scfld.md.ConfigurationBase

  .extend( "ui.s2p.mm.supplinvoice.approve.Configuration",

  {

       oServiceParams : {

            serviceList : [ {

            name : "MM_SUPPLIER_INVOICE_APPROVE_Entities",

            masterCollection : "WorkflowItems",

            serviceUrl : "/mm_supplinv_apv/proxy/sap/opu/odata/sap/MM_SUPPLIER_INVOICE_APPROVE;mo/",

            isDefault : true,

            useBatch : false,

            mockedDataSource : "/ui.s2p.mm.supplinvoice.approve/model/metadata.xml"

            } ]

  },

       getServiceParams : function() {

       return this.oServiceParams

  },

       getServiceList : function() {

       return this.getServiceParams().serviceList

  },

       getMasterKeyAttributes : function() {

       return [ "Id" ]

  },

  });

 

The application zm_supplinv_apv has a Component.js where I have defined an extansion points.

 

I want use an additional odata service just in the extension application, where I whant to define a new screens.

 

How and where shoud I define or bind this new odata service SRA020_PO_TRACKING?

 

 

If I define it in Configuration.js by mm_supplinv_apv application, I get a frontend error during starting an app from fioriSandbox on the Tomcat server.

 

oServiceParams : {

            serviceList : [ {

            name : "MM_SUPPLIER_INVOICE_APPROVE_Entities",

            masterCollection : "WorkflowItems",

            serviceUrl : "/mm_supplinv_apv/proxy/sap/opu/odata/sap/MM_SUPPLIER_INVOICE_APPROVE;mo/",

            isDefault : true,

            useBatch : false,

            mockedDataSource : "/ui.s2p.mm.supplinvoice.approve/model/metadata.xml"

            } ,

                    {

            name : "SRA020_PO_TRACKING_SRV",

            masterCollection : "POLists",

            serviceUrl : "/mm_supplinv_apv/proxy/sap/opu/odata/sap/SRA020_PO_TRACKING_SRV;mo/",

            isDefault : true,

            mockedDataSource : "/ui.s2p.mm.purord.tracking/model/metadata.xml"

  }

]

  },

 

Odata service SRA020_PO_TRACKING is activated and the application MM_PURORD_TPO is running separately without errors.


The Projekt mm_supplinv_apv was shared with Odata Service MM_SUPPLIER_INVOICE_APPROVE hosted by ABAP Repository.

May be an additional odata service should be shared as well, but how?

 

share_odata_service.png


I found as well the following blog

Multi Model Support and Binding For OData Services

, however I don't have a big experience in java script and don't know where should I define this code in Fiori project.


 

Do you have any idea how to solve this problem?


Thanks in advance!

 

Regards,

 

Dmitry




Viewing all articles
Browse latest Browse all 3523

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>