cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 - SAP Gateway - PUT method (AJAX)

mdiez
Participant

Hi experts,

I'm having a problem when put method is triggered.

What I'm doing is to create records in an Infotype from SAPUI5 so I use an AJAX call as follows:

$.ajaxSetup({

cache: false });

jQuery.ajax({

url: putURL,

async: true,

dataType: 'json',

cache: false,

data: JSON.stringify(data),

contentType: "application/json",

type: "PUT",

beforeSend: function(xhr) {

xhr.setRequestHeader("X-CSRF-Token", token); },

success: function(odata, textStatus, XMLHttpRequest) {

alert("OK");

},

error: function() {

alert("Error Put")

} });

In my case I have to create two records so I send two ajax calls. I am able to create both records in the infotype but the problem come with the response. With the first call the success function is fired without problems but with the second one the status in the console is pending and retrieve a 504 error.

sin-titulo.png

I don't know how to fixed that.

thanks in advance,

Regards.

View Entire Topic
former_member184867
Active Contributor
0 Kudos

What error are you getting in the Network ?