This Space has blogs on various topics in the field of SAP. These blogs point out solutions to various technical and functional issues that consultants face during implementation or support of SAP Projects. Readers/followers are welcome to contribute to this space by emailing your content at bohra.mohammadi@gmail.com. You will be rewarded according to the topic/number of words/complexity of the topic/issue which are you addressing in your blog.
Monday, May 22
SAPUI5 Table Binding with Data Coming from Backend
The Data that need to be displayed on SAPUI5 Table control resides of a backend system. The Data is fetched via oData services read call and rendered in table UI Control in below fashion
oModelECST_FETCH.read(url5,null, null, true, function(oData, oResponse){ debugger;
oInvoices = new sap.ui.model.json.JSONModel({ "Invoices" : oData.results }); oInvoices.iSizeLimit = 100000;
var tab =this.getView().byId("invoicestable"); // invoicestable is the ID of Table UI Control
tab.setModel(oInvoices);
var i=0;
tab.bindAggregation("items", {
path: "/Invoices",
template: new sap.m.ColumnListItem({
cells: [
//
new sap.m.CheckBox({visible:invoicesThat.strtoBool(oData.results[tableIndex1].Count)}).setSelected(true),
new sap.m.CheckBox("cbinv",{visible:"{Count}", selected:"{Sel}"}),
new sap.ui.commons.TextView({ text: "{InvNo}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InvDate}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{Tin}" , design:"Standard", semanticColor:"{semCol}"}),
// new sap.ui.commons.TextView({ text: "{FormNum}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text:"{TypeOfTx}",design:"Standard",semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{TaxableGoodsVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{AmtTaxVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InclTaxVal}", design:"Standard", semanticColor:"Default", visible:inctaxval}),
new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default",visible:labchargval}),
new sap.ui.commons.TextView({ text: "{OtherChrgesVal}", design:"Standard", semanticColor:"Default"}),
//new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{GrossTotalVal}", design:"Standard", semanticColor:"Default"}),
]
})
});
},function(err){
debugger;
});
oModelECST_FETCH.read(url5,null, null, true, function(oData, oResponse){ debugger;
oInvoices = new sap.ui.model.json.JSONModel({ "Invoices" : oData.results }); oInvoices.iSizeLimit = 100000;
var tab =this.getView().byId("invoicestable"); // invoicestable is the ID of Table UI Control
tab.setModel(oInvoices);
var i=0;
tab.bindAggregation("items", {
path: "/Invoices",
template: new sap.m.ColumnListItem({
cells: [
//
new sap.m.CheckBox({visible:invoicesThat.strtoBool(oData.results[tableIndex1].Count)}).setSelected(true),
new sap.m.CheckBox("cbinv",{visible:"{Count}", selected:"{Sel}"}),
new sap.ui.commons.TextView({ text: "{InvNo}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InvDate}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{Tin}" , design:"Standard", semanticColor:"{semCol}"}),
// new sap.ui.commons.TextView({ text: "{FormNum}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text:"{TypeOfTx}",design:"Standard",semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{TaxableGoodsVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{AmtTaxVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{InclTaxVal}", design:"Standard", semanticColor:"Default", visible:inctaxval}),
new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default",visible:labchargval}),
new sap.ui.commons.TextView({ text: "{OtherChrgesVal}", design:"Standard", semanticColor:"Default"}),
//new sap.ui.commons.TextView({ text: "{LabourChrgesVal}", design:"Standard", semanticColor:"Default"}),
new sap.ui.commons.TextView({ text: "{GrossTotalVal}", design:"Standard", semanticColor:"Default"}),
]
})
});
},function(err){
debugger;
});
Subscribe to:
Post Comments (Atom)
This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.
ReplyDeleteSalesforce Training in Chennai
Web Designing Training in Chennai
Superb explanation & it's too clear to understand the concept as well, keep sharing admin with some updated information with right examples.Keep update more posts.
ReplyDeleteSAP Training in Chennai
ABAP Training in Chennai
Great Post, Thanks for Sharing
ReplyDeletePlaces more posts.....
SAP Online Guides
Wow amazing i saw the article with execution models you had posted. It was such informative. Really its a wonderful article. Thank you for sharing and please keep update like this type of article because i want to learn more relevant to this topic.
ReplyDeleteSAP Training in Chennai
SAP ABAP Training in Chennai
Thank you guys for providing online SAP Training. It is very helpful.
ReplyDeleteHere i had read the content you had posted. It is much interesting so please keep update like this.
ReplyDeleteSAP ABAP Training in Chennai
SAP MM Training in Chennai
SAP HR Training in Chennai
Hi there, awesome site. I thought the topics you posted on were very interesting.Internet Of Things Courses and Training Institutes, Classes in Pune
ReplyDelete