Skip to Content
0
Former Member
Jun 29, 2015 at 11:21 AM

Filter Products to be shown in Create Sales Order

63 Views

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