0

我正在使用 VDM 来查询函数导入。它返回 null,这不是预期的。它不会进入异常流程,因此无法确定调用是否成功。

    PurchaseRequisitionHeaderBOView resultPojo = null;
    try {
        resultPojo = sspprService.purchaserequisition_WdActivation(purchaseRequisition, draftUUID, isActiveEntity)
                .execute(new ErpConfigContext(s4destination));
        if (resultPojo == null)
            logger.error("VDM call returned null!");
    } catch (ODataException e) {
        logger.error(EXCEPTION_ACTIVATING_CART, e);
        throw new org.apache.olingo.odata2.api.exception.ODataException(EXCEPTION_ACTIVATING_CART, e);
    }

预期:如果调用成功,则为非空 POJO。如果调用失败,它应该命中 catch 块。

函数导入的响应

{
  "d" : {
    "__metadata" : {
      "id" : "https://uyt700-er9003.wdf.sap.corp/sap/opu/odata/sap/MMPUR_REQ_GPR_MAINTAIN_SRV/I_Purchaserequisition_Wd(PurchaseRequisition='12444947',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)",
      "uri" : "https://uyt700-er9003.wdf.sap.corp/sap/opu/odata/sap/MMPUR_REQ_GPR_MAINTAIN_SRV/I_Purchaserequisition_Wd(PurchaseRequisition='12444947',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)",
      "type" : "MMPUR_REQ_GPR_MAINTAIN_SRV.I_Purchaserequisition_WdType",
      "etag" : "W/\"20190920072451.9970020m\""
    },
    "Activation_ac" : false,
    "Edit_ac" : true,
    "Preparation_ac" : false,
    "Validation_ac" : false,
    "PurReqnDescription_fc" : 3,
    "PurReqnSSPRequestor_fc" : 3,
    "PurchaseRequisition" : "12444947",
    "PurReqnSSPRequestor" : "00001076",
    "PurReqnSSPAuthor" : "CSAC",
    "PurchaseRequisitionType" : "NB",
    "CreationDate" : "\/Date(1568937600000)\/",
    "LastChangeDateTime" : "20190920072451.9970020",
    "IsOnBehalfCart" : "",
    "BusinessUser" : "CSAC",
    "PurReqnIsCreatedInExpertMode" : false,
    "PurReqnDescription" : "",
    "EmployeeFullName" : "Don Draper",
    "PurReqnOrigin" : "S",
    "IsSrchEnabled" : false,
    "PurReqnLifeCycleStatus" : "",
    "PurReqnLifeCycleStatusName" : "",
    "NumberOfItems" : 0,
    "TotalNetAmount" : "0.00",
    "Currency" : "",
    "IsExtPurgScenario" : false,
    "PurReqnIsCopyDraft" : false,
    "HasDraftEntity" : false,
    "DraftUUID" : "00000000-0000-0000-0000-000000000000",
    "DraftEntityCreationDateTime" : null,
    "DraftEntityLastChangeDateTime" : null,
    "HasActiveEntity" : false,
    "IsActiveEntity" : true,
    "DraftAdministrativeData" : {
      "__deferred" : {
        "uri" : "https://uyt700-er9003.wdf.sap.corp/sap/opu/odata/sap/MMPUR_REQ_GPR_MAINTAIN_SRV/I_Purchaserequisition_Wd(PurchaseRequisition='12444947',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)/DraftAdministrativeData"
      }
    },
    "SiblingEntity" : {
      "__deferred" : {
        "uri" : "https://uyt700-er9003.wdf.sap.corp/sap/opu/odata/sap/MMPUR_REQ_GPR_MAINTAIN_SRV/I_Purchaserequisition_Wd(PurchaseRequisition='12444947',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)/SiblingEntity"
      }
    }
  }
}
4

1 回答 1

0

请更新您对SAP Cloud SDK的依赖,3.6.0因为它修复了解析 OData 函数导入响应的问题。不再需要定制。请让我知道,如果它适合你。

于 2019-10-29T15:52:28.893 回答