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

AJAX request over SAP Gateway (ajax same origin policy)


I am running a SAPUI5 Webapp on our Server. How it is possible to route a ajax request over the SAP Gateway (or something else).

JSONP is no option.

The request is like

var url = "" + sTerm + "&sensor=false"


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 13, 2015 at 11:00 AM

    Please check this example. its should be useful Simple cross-domain Ajax request

    Kindly let me know if you need any more information.

    Add a comment
    10|10000 characters needed characters exceeded

    • I used this code in my application. this code don't have "JSONP". is it useful

      var sServiceUrl = "http://hostName:portNumber/";

      var oModel = new sap.ui.model.json.JSONModel();

      var ptnergrpdetails;

      function getPartnerGroupDetails(datak)



      processData: false,

      url : sServiceUrl,

      type : "POST",

      contentType : "application/json; charset=utf-8",

      data :JSON.stringify(datak),

      dataType: 'json',

      //async : true,

      //username : cUserName,

      //password : cPassword,

      success : function(data, textStatus, jqXHR) {

      ptnergrpdetails = data;


      //console.log("json data "+oModel.getJSON());



      error : function(xhr, status) {



      complete : function(xhr, status) {





      url: "http://hostName:portNumber/",
      data: cred,
      type: "POST",
      xhrFields: {
      withCredentials: true
      success: function(response){
      failure: function(message){
  • Posted on Nov 13, 2015 at 11:28 AM

    Hi Maximilian,

    You can use ODATA model to call server. It is an advanced version of ajax call.

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

    Refer this:



    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.