According to the documentation of the SAP Cloud SDK the quantity of a variable-size item in a bill of material needs to be recalculated after changing a field that affects this property (e.g. size1, size2, size3, formulaKey).
To do this the contents of quantityVariableSizeItem should be deleted. How can this be accomplished?
I tried several values to update an existing variable-size item using the MaterialBomItemRequestBuilder.update method (which results in a PATCH request):
const item = MaterialBomItem.builder()
/*request fails with error message: Property 'QuantityVariableSizeItem' at offset '[...]' has invalid value '-Infinity'*/
//.quantityVariableSizeItem(new BigNumber('-Infinity))
/*request fails with error message: Property 'QuantityVariableSizeItem' at offset '[...]' has invalid value 'NaN'*/
//.quantityVariableSizeItem(new BigNumber(NaN))
/*TypeScript error before request is sent: Argument of type 'null' is not assignable to parameter of type 'Value'.*/
//.quantityVariableSizeItem(null)
/*TypeScript error before request is sent: Argument of type 'undefined' is not assignable to parameter of type 'Value'.*/
//.quantityVariableSizeItem(undefined)
.billOfMaterialItemNodeNumber(<value>)
.billOfMaterial(<value>)
.material(<value>)
.billOfMaterialCategory(<value>)
.billOfMaterialVariant(<value>)
.billOfMaterialVersion(<value>)
.headerChangeDocument(<value>)
.plant(<value>)
.build();
const result = await MaterialBomItem.requestBuilder()
.update(item)
.withCustomHeaders(<headers>)
.execute(<destination>);
Thanks in advance,
ujj
This is solved with release 1.30.0 of @sap-cloud-sdk/core and @sap/cloud-sdk-vdm-bill-of-material-v2-service.