Skip to Content

somebody has a sample demo for odata model and table TwoWay data binding of SAPUI5?

hi, i new for sapui5,now i want to know how to get data from sap through odata and show them in table ,could you help me?

thanks advance!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 04, 2018 at 07:51 AM

    I would suggest you work through the SAPUI5 Walkthrough. In Step 26 you will learn about Remote OData Service.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 06, 2018 at 03:23 AM
    -2

    Hi,

    You can get the data from SAP to UI in many different ways. One of the ways is the use of ajax calls. Example:

    jQuery.ajax({
    				type: "GET",
    				contentType: "application/json",
    			        url: "/Northwind/V3/Northwind/Northwind.svc/Products",
    				dataType: "json",
    				async: false,
                                    success: function(rData, textStatus, jqXHR) {
                                    //this function executes if ajax call was successfull
                                    //'rData' array contains the data received from request
                                    },
    				error: function(jqXHR, textStatus, errorThrown) {
                                    //this function executes if ajax call was un-successfull
    					sap.m.MessageToast.show("Data Not Received");
    				}});
    <br>

    the above example receives the data from northwind odata service. Similar to this you can replace the url with your SAP Odata service url and get the data.

    After receiving the data you can bind it anywhere, like in a table or list.

    Regards,

    Deepak

    Add comment
    10|10000 characters needed characters exceeded