使用创建Depp实体(Odata)的SAP UI5中的POST操作问题

2020-08-24 18:59发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 我在SAP UI5中使用...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

我在SAP UI5中使用创建深度实体。

我的应用程序从表的选择行中获取数据,并将表中的数据作为输入参数,它应该创建一张发票。

我从表中输入的内容如下:

----------

{" SoldToParty":" 234234"," SoldToPartyName":"","发票":""," Nav_Invoice":[{" SoldToParty":" 102124"," BillDate":" 2019-04-05T05 :30:00"," SalesOrg":" 1070"," BillCat":" L"," BillType":" F2B"," DestCountry":" BR"," SalesDoc":" 80106498"," SDDocCat": " J","地址":" 51087"," SoldToPartyName":"即将到来的COUROS LT","位置":" TRINDADE"," BillingBlock":""," DistrChannel":" 10"," 部门":" 10"," ShipRecPoint":" BR01"}]}

--------------------

我的实体集如下:

/ZOTC_INVOICE_CREATE_SRV/SoldToPartyF4Set('');

这可以导航到Nav_Invoice

----------------

我正在UI5中编写如下逻辑:

var oModel = this.getView()。getModel();

var个项= []; var oContext = this.getView()。byId(" iddueitems")。getSelectedContexts(" filterResults");

var sObjects = oContext.map(function(ele){return ele.getObject();});

var oTable = this.getView()。byId(" iddueitems")。getSelectedItems();

for(var i = 0; i

var oEntity = {}; oEntity.SoldToParty = oTable [i] .getCells()[0] .getText();

oEntity.BillDate = oTable [i] .getCells()[1] .getText();

oEntity.SalesOrg = oTable [i] .getCells()[2] .getText();

oEntity.BillCat = oTable [i] .getCells()[3] .getText();

oEntity.BillType = oTable [i] .getCells()[4] .getText();

oEntity.DestCountry = oTable [i] .getCells()[5] .getText(); oEntity.SalesDoc = oTable [i] .getCells()[6] .getText(); oEntity.SDDocCat = oTable [i] .getCells()[7] .getText(); oEntity.Address = oTable [i] .getCells()[8] .getText(); oEntity.SoldToPartyName = oTable [i] .getCells()[9] .getText(); oEntity.Location = oTable [i] .getCells()[10] .getText(); oEntity.BillingBlock = oTable [i] .getCells()[11] .getText(); oEntity.DistrChannel = oTable [i] .getCells()[12] .getText(); oEntity.Division = oTable [i] .getCells()[13] .getText(); oEntity.ShipRecPoint = oTable [i] .getCells()[14] .getText(); 我

tems.push(oEntity); //项目数据}

var oEntry1 = {};

//标题数据

oEntry1.SoldToParty =" 234234";

oEntry1.SoldToPartyName ="";

oEntry1.Invoice ="";

oEntry1.Nav_Invoice =项目;

oModel.create("/img/SoldToPartyF4Set",oEntry1,

{方法:" POST",

成功:函数(odata,oResponse){调试器; alert("是"); },

错误:函数(oError,oResponse){调试器; alert(" sorry"); }});

},

-----------

调试器; 我看到有效载荷(oEntry1)如下

  1. {SoldToParty:" 234234",SoldToPartyName:"",发票:"",Nav_Invoice:Array(1)}
    1. SoldToParty:" 234234"
    2. SoldToPartyName:""
    3. 发票:""
    4. Nav_Invoice:数组(1)
    1. 0:
    1. SoldToParty:" 102124"
    2. BillDate:" 2019-04-05T05:30:00"
    3. SalesOrg:" 1070"
    4. BillCat:" L"
    5. BillType:" F2B"
    6. DestCountry:" BR"
    7. SalesDoc:" 80106498"
    8. SDDocCat:" J"
    9. 地址:" 51087"
    10. SoldToPartyName:"即将到来的COUROS LT行业"
    11. 位置:" TRINDADE"
    12. BillingBlock:""
    13. DistrChannel:" 10"
    14. 部门:" 10"
    15. ShipRecPoint:" BR01"
    16. __ proto__:对象
  2. 长度:1
  3. __ proto__:数组(0)
  • __ proto__:对象..
  • ----------------------------------------------- --------------------------------------
  • 我收到如下错误:

    " {"错误":{"代码":"/img/IWBEP/CM_MGW_RT/058","消息":{" lang":" en","值":"更改集延迟处理模式下缺少响应数据。 诊断在延迟模式下运行的变更集中某些操作缺少响应数据系统响应过程修复了数据提供者中的编程错误系统管理过程"}," innererror":{" application":{" component_id":""," service_namespace ":"/img/SAP/"," service_id":" ZOTC_INVOICE_CREATE_SRV"," service_version":" 0001"}," transactionid":" 5D35607018970070E005E22C3C243973","时间戳":" 20200128094459.4189810"," Error_Resolution" :: {" SAP_Transaction": "在SAP Gateway集线器系统上运行事务/IWFND/ERROR_LOG并使用上面的时间戳搜索条目以了解更多详细信息"," SAP_Note":"请参阅SAP Note 1797736进行错误分析( https://service.sap.com/sap/support/notes/1797736)"}," errordetails":[ {"代码":"/img/IWBEP/CX_MGW_TECH_EXCEPTION","消息":"更改集延迟处理模式下缺少响应数据"," propertyref":"","严重性":"错误","目标": ""}]}}}"

    -------------------

    能否请您告诉我问题是来自SAPUI5还是Odata。

    在Odata中保留调试器---创建DeepEntity方法和ChangeSet处理方法时,它会触发ChangeSetProcess,但不会触发创建深度实体方法。

    帮我解决这个问题。

    预先感谢

    RR

    2条回答
    CJones
    2020-08-24 19:32

    您好 Chowdary Raghu

    现在我了解了您的问题。

    对,您不应该对此置评。 现在您有2个选择

    1。 如果在您触发deepcreate的情况下,请检查更改集中的CD实体类型和操作模式是否为deep创建,如果存在,则将延迟模式传递为ABAP false否则ABAP true

    您是在告诉系统创建深度执行,创建深度方法和跳过变更集处理方法的情况。 问题是,如果您的请求同时具有两个相关的URI,则无法同时执行chnage set流程代码和深度创建代码。

    2。 不用处理深度创建方法,而仅在变更集过程中处理深度创建操作,您可以根据操作类型CD进行识别,并在此处编写相同的创建深度方法逻辑,根据我的理解,这将是一个更好的选择

    让我知道您是否遇到面部问题。

    谢谢

    Mahesh

    一周热门 更多>