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);
    }

予想される:呼び出しが成功した場合は、null 以外の 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