Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAPUI5 and OData dynamic Login



can anybody share some standard code that sapui5 and odata dynamic login screen navigation ?

Means User has to pass input Username and Password atrun time and get login.




Thank you in advanced

Former Member
Former Member replied

Hi Anil, As i see you were using the ODataModel,


jQuery.sap.require("sap.ui.model.odata.datajs");

Why cant you use the ODataModel, constructor to pass your url with username and password?

For eg.

var serviceURI = "http://192.168.0.7:8000/sap/opu/odata/sap/YNEW_SRV/";

var username = sap.ui.getCore().getControl("oNameInput") .getValue();

var password = sap.ui.getCore().getControl("oPWInput") .getValue();

var OData = new sap.ui.model.odata.ODataModel(serviceURI,true ,username,password);

Please have a look at the below link for other methods of ODataModel,

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.ui.model.odata.ODataModel

Also make sure you use the same Library version like the previous link, you can see at the footer of the link for version details.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question