Skip to Content

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

Internal Server Error :SAPUI5 consuming oData

Hi all,

I created a list sap.m   in XML VIEW,

and binded items from oData, i.e from ABAP table,

List items Generated fine.

i'm trying to perform Search Operation, but its throwing Error "Internal Server Error",

is there any issue with my below code:?

or the prblm is with backend?

if so how to resolve?

============ VIEW =============

<Page

    showHeader="false" >

    <subHeader>

      <Toolbar>

        <SearchField

          liveChange="onSearch"

          width="100%" />

      </Toolbar>

    </subHeader>

    <content>

      <List

        id="idList"

        items="{/flightdata2Set}"

        selectionChange="onSelectionChange"

        mode="MultiSelect"

        includeItemInSelection="true" >

        <infoToolbar>

          <Toolbar

            visible="false"

            id="idInfoToolbar" >

            <Label id="idFilterLabel" />

          </Toolbar>

        </infoToolbar>

        <items>

          <StandardListItem

            title="{Carrid}"

            description="{Carrid}"

            iconDensityAware="false"

            iconInset="false" />

        </items>

      </List>

    </content>

  </Page>

==================CONTROLLER=====================

var url;

  if(window.location.hostname == 'localhost')

  {

  url = "proxy/" + "sap/opu/odata/sap/*************/";

  }

  else{

  url = "/sap/opu/odata/sap/*************/";

  }

  var oModeldata = new sap.ui.model.odata.ODataModel(url);

  sap.ui.getCore().setModel(oModeldata);

  },

  onSearch : function (oEvt) {

     // add filter for search

     var aFilters = [];

     var sQuery = oEvt.getSource().getValue();

     if (sQuery && sQuery.length > 0) {

       var filter = new sap.ui.model.Filter("Carrid", sap.ui.model.FilterOperator.Contains, sQuery);

       aFilters.push(filter);

     }

     // update list binding

     var list = this.getView().byId("idList");

     var binding = list.getBinding("items");

     binding.filter(aFilters, "Application");

   },

   onSelectionChange : function (oEvt) {

     var oList = oEvt.getSource();

     var oLabel = this.getView().byId("idFilterLabel");

     var oInfoToolbar = this.getView().byId("idInfoToolbar");

     // With the 'getSelectedContexts' function you can access the context paths

     // of all list items that have been selected, regardless of any current

     // filter on the aggregation binding.

     var aContexts = oList.getSelectedContexts(true);

     // update UI

     var bSelected = (aContexts && aContexts.length > 0);

     var sText = (bSelected) ? aContexts.length + " selected" : null;

     oInfoToolbar.setVisible(bSelected);

     oLabel.setText(sText);

   }

Can anyone help to resolve the issue,

thanks ,

CHANDRAN.

errror.png (153108 B)
Tags:
Not what you were looking for? View more on this topic or Ask a question