【发布时间】:2020-07-29 09:17:31
【问题描述】:
我想一步将一定数量的存储单元从 WebIDE 传递到 SAP。我需要 SAP 的 CREATE_ENTITY 方法中的所有存储单元(CREATE_ENTITY 或 CREATE_DEEP_ENTITY 还是...?),因为我必须对一些值进行比较。
我尝试了一个批处理请求。这不起作用,因为为每个存储单元调用了 CREATE_ENTITY 方法。所以每次调用我只能访问一个存储单元。
我还搜索了有关 deep_entities 的教程。但我只发现一些具有深层结构(头部 - 项目)。但是我有一个平面结构(键:存储单元)并且想将它作为表/数组传递给我的“CREATE_ENTITY”方法。在 SAPUI5 中应该可以做到这一点。
作为解决方法,我可以将所有存储单元传递给一个字符串并将其传递给 CREATE_ENTITY 方法。但这对我来说似乎很业余。
非常感谢和最好的问候
朱莉娅
更新 31.07.20
这是我如何调用 CREATE 方法:
´´´
onStartVert: function () {
// TAs zum i-Punkt quittieren & Check ob bereits
// TA vom i-Punkt zum VKL angelegt ist, dann
// Meldung ausgeben, sonst TA anlegen
// oData Methode create aufrufen und Tabelle übergeben
// LenumIPunkt
// this.getModel().setUseBatch(true);
// var aDeferredGroup = this.getModel().getDeferredGroups();
// aDeferredGroup.push("lenum");
// this.getModel().setDeferredGroups(aDeferredGroup);
//Create Parameters
// var oParameters = {
// groupId: "lenum"
// };
// 31.07.20 this.getModel().setUseBatch(true);
this.oContext = this.getModel().createEntry("/LenumIPunktSet", {
success: this._successSave.bind(this),
error: this._errorSave.bind(this)
});
var oBindingPath = {
path: this.oContext.getPath()
};
this.getView().bindObject(oBindingPath);
var sLenum;
for (var i = 0; i < this._data.LePool.length; i++) {
sLenum = this._data.LePool[i].lenum;
// 31.07.20 this.getModel().create("/LenumIPunktSet", { lenum: sLenum } ,oParameters);
this.getModel().create("/LenumIPunktSet", {
lenum: sLenum
});
}
//Submit the Changes based on the groupId(doSomething)
this.getModel().submitChanges({
//groupId: "lenum"
});
// 31.07.20 this.getModel().setUseBatch(false);
// 2. View aufrufen
this.getRouter().navTo("iPunkt02");
},
The signature for the CHANGESET_PROCESS method is:
CT_CHANGESET_DATA TYPE /IWBEP/IF_MGW_CORE_SRV_RUNTIME=>TY_T_CHANGESET_DATA
/IWBEP/CX_MGW_BUSI_EXCEPTION Business Exception
/IWBEP/CX_MGW_TECH_EXCEPTION Technical Exception
So by now there is no table IT_CHANGESET_REQUEST available.
My entity type has only this one field (lenum) I need as key.
Many thanks again
【问题讨论】:
标签: javascript odata sapui5