on 06-29-2015 12:21 PM
Hi! I'm trying to enhance our standard Create Sales Order Fiori Application. On the products tab, I need to show the products available to the chosen customer. Right now, it shows all products.
When I studied the code for SO creation, the list is binded through /Products
When accessing the OData service call
/sap/opu/odata/sap/SRA017_SALESORDER_CREATE_SRV/Products
it didn't show anything.
Is there a way to access the data on Products entity?
My initial solution was to edit the filter. Adding another filter for customerNo
updateProductsList : function(){
var filters = [];
filters.push(new sap.ui.model.Filter("SalesOrganization", sap.ui.model.FilterOperator.EQ, this.oSalesOrganization));
filters.push(new sap.ui.model.Filter("DistributionChannel", sap.ui.model.FilterOperator.EQ, this.DistributionChannel));
filters.push(new sap.ui.model.Filter("ProductID", sap.ui.model.FilterOperator.Contains, this.sFilterPattern));
filters.push(new sap.ui.model.Filter("CustomerNo", sap.ui.model.FilterOperator.Contains, this.sCustomerNo));
this.setDefaultSelection = true;
this.getList().bindItems("/Products", new sap.ui.xmlfragment("cus.sd.salesorder.create.view.ProductListItemTemplate",this), null,filters);
var sTitle = this.getView().byId("SOC_MasterListHeaderTitle");
sTitle.setText(this.oApplicationFacade.getResourceBundle().getText("PRODUCTS_CUST", [this.CustName]));
this.registerMasterListBind(this.getList());
},
but this didn't work.
So I'm assuming I need to edit the OData service for this. I'm guessing I need to create a navigation path to Products and create an OData filter.
Can someone point me to the right direction. Thank you in advance
Hi
Filter criteria must be handled from gateway service.
Shortcut for getting the Product list is , refresh the browser and record the gateway service call (Starts with sap/opu)
Once you get entity set(for eg : ProductListSet)
Go to the DPC_EXT class and redefine the method and apply filter criteria.
URI formation should be something like : sap/opu/odata/Zservicename/ZentitySet?$filter=Product eq 'xyz'
Regards,
Tejas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discussion successfully moved from SAP for Mobile to SAP Fiori where this topic should be.
Regards, Mike (Moderator)
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
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.