sap.ui.model.odata.v2.ODataModel

Odata

//Create model

var url = ""; //your services url
var OdataInfo = new sap.ui.model.odata.v2.ODataModel(url, true);

//Create success and error function
var suc_func = function(obj){
debugger;
}
var er_func = function(obj){
debugger;
}

//Create filters
var filt;


sap.ui.define(['sap/ui/model/Filter',
'sap/ui/model/FilterOperator'],
function(Filter, FilterOperator) {
filt = new Filter({
path: "areaId",
operator: FilterOperator.EQ,
value1: '0000000116'
});
});

//Made Request
var rr = OdataInfo.read("/MY_INFO",
{
filters: [filt],
success: suc_func}
);

 

 

Sap Abap!!!

MY_INFO_GET_ENTITYSET.

    data: lv_filter_options type /iwbep/t_mgw_select_option .

    lv_filter_options = io_tech_request_context->get_filter( )->get_filter_select_options( ).

 

 

if you want create Entity, this we have one secrets ) Thanks for SAP for use our brain to open code

var url = «********/ZSEM_SRV/»;

var OdataInfo = new sap.ui.model.odata.v2.ODataModel( {serviceUrl:url} );

//Create success and error function

var suc_func = function(obj) { debugger; };

var er_func = function(obj) { debugger; };

var oData = { IdSource: «23123», Source: «fdffasdffsadfasdfasdfsadfsdfsdfsfddfsdfsdf», Title: «rrr», Type:»sdf» };

var sPath = ‘/ZSEM_SOURCESet’;

OdataInfo.create(sPath, oData, {success: suc_func, error: er_func});

and now in your class you must use structure for get keys

    try .
        data ls_s type html_sourc.   //<<you must set this or you could have a dump!!!

        io_data_provider->read_entry_data(
          importing
           es_data    = ls_s
        ).
      catch cx_root into data(lo_cx).
        data(lv_t) = lo_cx->get_text( ).
    endtry.