Purchase order SDK not support item selection .
See original GitHub issueDescribe the bug The following code worked 👍
const {purchaseOrderService} =require(‘@sap/cloud-sdk-vdm-purchase-order-service’); const {purchaseOrderApi, purchaseOrderItemApi} = purchaseOrderService();
function getPurchaseOrders(req) {
return purchaseOrderApi.requestBuilder()
.getAll()
.top(1)
.filter(purchaseOrderApi.schema.PURCHASE_ORDER.equals(req.body.purchaseOrder))
.select(
purchaseOrderApi.schema.PURCHASE_ORDER,
purchaseOrderApi.schema.PURCHASE_ORDER_DATE,
purchaseOrderApi.schema.PURCHASING_ORGANIZATION,
purchaseOrderApi.schema.PURCHASING_GROUP,
purchaseOrderApi.schema.COMPANY_CODE
)
.execute({
destinationName: 'O5P',
JWT: retrieveJwt(req)
});
} The following code does not work, but it should work ,it is a bug
const {purchaseOrderService} =require(‘@sap/cloud-sdk-vdm-purchase-order-service’); const {purchaseOrderApi, purchaseOrderItemApi} = purchaseOrderService();
function getPurchaseOrders(req) {
return purchaseOrderApi.requestBuilder()
.getAll()
.top(1)
.filter(purchaseOrderApi.schema.PURCHASE_ORDER.equals(req.body.purchaseOrder))
.select(
purchaseOrderApi.schema.PURCHASE_ORDER,
purchaseOrderApi.schema.PURCHASE_ORDER_DATE,
purchaseOrderApi.schema.PURCHASING_ORGANIZATION,
purchaseOrderApi.schema.PURCHASING_GROUP,
purchaseOrderApi.schema.COMPANY_CODE,
purchaseOrderApi.schema.TO_ITEM
.select(purchaseOrderItemApi.schema.MATERIAL,purchaseOrderItemApi.schema.STORAGE_LOCATION)
)
.execute({
destinationName: 'O5P',
JWT: retrieveJwt(req)
});
}
To Reproduce Steps to reproduce the behavior:
- Set up …
- Execute …
- Confirm …
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Used Versions:
- node version via
node -v
- npm version via
npm -v
- SAP Cloud SDK version you used as dependency
Code Examples If applicable, add code snippets as examples to help explain your problem. Please remove sensitive information.
Log file If applicable, add your log file or related error message. Again, please remove your sensitive information.
Impact / Priority
Affected development phase: e.g. Getting Started, Development, Release, Production
Impact: e.g. No Impact, Inconvenience, Impaired, Blocked
Timeline: e.g. Go-Live is in 12 weeks.
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Found the document , thanks!
const { businessPartnerApi, businessPartnerAddressApi } = businessPartnerService(); const businessPartner = businessPartnerApi .entityBuilder() .firstName(‘John’) .lastName(‘Doe’) .businessPartnerCategory(‘1’) .toBusinessPartnerAddress([ businessPartnerAddressApi .entityBuilder() .country(‘DE’) .postalCode(‘14469’) .cityName(‘Potsdam’) .streetName(‘Konrad-Zuse-Ring’) .houseNumber(‘10’) .build() ]) .build();
// execute the create request businessPartnerApi .requestBuilder() .create(businessPartner) .execute(myDestination);
I’ll close this issue. Feel free to reopen, if you have further questions.