SAP 데이터 게이트웨이 서비스에 일부 데이터를 보내려고합니다. 이 코드를 example "저장"하는 방법을 사용하고 있지만 코드에서 "OData is not defined"오류가 발생합니다.SAPUI5 - OData가 정의되지 않았습니다.
다음은 시도 할 때 사용하는 방법입니다.
handleConfirmationMessageBoxPress: function(oEvent) {
var bCompact = !!this.getView().$().closest(".sapUiSizeCompact").length;
MessageBox.confirm(
"Deseja confirmar a transferência?", {
icon: sap.m.MessageBox.Icon.SUCCESS,
title: "Confirmar",
actions: [sap.m.MessageBox.Action.OK, sap.m.MessageBox.Action.CANCEL],
onClose: function(oAction) {
if (oAction == "OK") {
var oParameters = {};
oParameters.loginfrom = this.getView().byId("multiInput").getValue();
oParameters.loginfrom = this.getView().byId("loginPara").getValue();
oParameters.loginfrom = this.getView().byId("datade").getValue();
oParameters.loginfrom = this.getView().byId("datapara").getValue();
OData.request({
requestUri : "http://<host name>:<port no>/sap/opu/odata/sap/ZMM_EMP_SRV/EmployeeSet",
method : "GET",
headers : {...}
},
function(data, response) {
...
var oHeaders = {
... };
OData.request({
requestUri : "http://<host name>:<port no>/sap/opu/odata/sap/ZMM_EMP_SRV/EmployeeSet",
method : "POST",
headers : oHeaders,
data:oParameters
},
function(data,request) {
MessageToast.show("Transferência realizada!");
location.reload(true);
}, function(err) {
MessageToast.show("A transferência falhou!");
});
}, function(err) {
var request = err.request;
var response = err.response;
alert("Error in Get — Request " + request + " Response " + response);
});
} else {
...
X가 정의되지 않은 경우 대개 지정된 변수 X가 아직 정의되지 않았 음을 의미합니다. OData 변수를 제대로 초기화해야합니다. 안타깝게도, 예제를 읽은 후에, 저자가 생각한 것이 무엇인지 모르겠다. 어쩌면 OData는 그의 예제에서 일부 전역 변수인가? – Marc