Skip to Content
author's profile photo Former Member
Former Member

SAP UI5 Sales Order - no data

Hello!

I'm trying one example with Sales Order table and SAP UI5.

I have an "index.html" file, like that:

<!DOCTYPE html><html>          <head>                    <meta http-equiv='X-UI-Compatible' content='IE=edge'>                    <title>SAPUI demo</title>                    <script id="sap-ui-bootstrap"                    src="../sapui5/resources/sap-ui-core.js"                    data-sap-ui-theme="sap_platinum"                    data-sap-ui-libs="sap.ui.commons, sap.ui.table"></script>                      <script src="app.js"></script>          </head>            <body class="sapUiBody">                    <img src="saplogo.jpg">                    <div id="salesorders"></div>                    <div id="lineitems"></div>          </body></html>

And an "app.js" js file:

var ODataModel = sap.ui.model.odata.ODataModel,    TextField = sap.ui.commons.TextField,    TextView = sap.ui.commons.TextView,    Label = sap.ui.commons.Label,    DataTable = sap.ui.table.DataTable,    Column = sap.ui.table.Column,    SelectionMode = sap.ui.table.SelectionMode;// SAP Gateway SalesOrderService as an Odata modelvar salesOrderService =    "https://gw.esworkplace.sap.com/sap/opu/sdata/IWFND/SALESORDER",// username and passwd for SDN    username = "GW@ESW",    password = "ESW4GW",    asJson = false,    salesOrderModel = new ODataModel(salesOrderService, asJson, username, password),    salesOrderCollection = "SalesOrderCollection";    var salesOrders = new DataTable({        title: "Sales Orders",        width: "100%",        visibleRowCount: 5,        selectionMode: SelectionMode.Single,        editable: false    });  var salesOrderColumns = [    { header: "Sales Order ID", value: "{SalesOrderID}", width: '100px' },    { header: "Customer Name", value: "{CustomerName}", width: '50%' },    { header: "Amount", value: "{TotalSum}", width: '50%' }  ];// create the columns       salesOrderColumns.forEach(function (column) {        var label = new Label({text: column.header }),            template = new TextView({ text: column.value }),            column = new Column({                            label: label,                            template: template,                            width: column.width            });        salesOrders.addColumn(column);    });// connect the data table to the Sales Order servicesalesOrders.setModel(salesOrderModel);// An OData request will return sales orderssalesOrders.bindRows(salesOrderCollection);//Put table in the DOMsalesOrders.placeAt("salesorders");//Create the line items datatablevar lineItems = new DataTable({    title: "Line items",    width: "100%",    visibleRowCount: 10,    selectionMode: SelectionMode.Single,    editable: false});lineItemCoumns = [    { header: "Line item #", value: "{SalesOrderItem}", width: '100px' },    { header: "Product Name", value: "{ProductName}", width: '50%' },    { header: "Amount", value: "{NetSum}", width: '50%' }    ]lineItemCoumns.forEach(function (column) {    var label = new Label({ text: column.header }),        template = new TextView({ text: column.value }),        column = new Column({        label: label,        template: template,        width: column.width    });    lineItems.addColumn(column);       });lineItems.setModel(salesOrderModel);lineItems.placeAt("lineitems");

I've disabled web security with "--disable-web-security" in chrome.

But I have not retrieved any information... And there are no errors in console...

http://gyazo.com/da1ab9f8d0b8710ae0bb2b4a3bcbd4fe.png?1356337873

Please, help me!

P.S. Sorry for my english.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2013 at 09:55 AM

    I too have the same problem.............but i am not using Netweaver .....I am Calling an Jason data from a free sales order webservice 😔

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2013 at 10:48 AM

    Hi Elias,

    Use a forward slash in front of collection name

    salesOrderCollection = "/SalesOrderCollection";


    find attached file with changes


    services could be used form below message too

    http://scn.sap.com/docs/DOC-31221


    service https://gw.esworkplace.sap.com/sap/opu/sdata/IWFND/SALESORDER seems to be down when pasted on the browser no response is obtained.


    Thanks and Regards, Venkatesh


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 26, 2013 at 10:56 AM

    Hi Elias and Vishnu,

    Check out the below link and change some code as they said then you will get it,

    How to create SAPUI5 application consuming Gateway service with the help of SAP NW Gateway Plug-in for Eclipse

    Thanks,

    Ranjani Sekar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.