on 2023 Mar 09 6:32 PM
Hi Experts,
I am trying to consume an OData v4 Service trough CAP. The Entity Builder for the Purchase Requisition Service works as expected. This is how my entity looks in CAP.

However - when I send the request to an SAP S/4HANA System using the Request Builde, the number field gets converted to a string with double quotes and I get an XML parsing Error. The request would work without the double quotes(Tested with Postman).

I am using the Odata Client as mentioned in the API Business Hub: https://api.sap.com/api/OP_PURCHASEREQUISITION_0001/cloud-sdk/JavaScript
Any hint would be highly appreciated. Below my code snippet.
const purReqItems = req.data.PurchaseReqn._PurchaseRequisitionItem // create an array of requests to create the PR item entities const itemsArray = purReqItems.map((item: PurchaseReqnItem) => purchaseReqnItemApi.entityBuilder(). purchaseRequisitionItemText( item.PurchaseRequisitionItemText). accountAssignmentCategory( item.AccountAssignmentCategory). materialGroup( item.MaterialGroup). baseUnit( item.BaseUnit). purchaseRequisitionPrice(12). purReqnItemCurrency( item.PurReqnItemCurrency). purchasingGroup( item.PurchasingGroup). plant( item.Plant). companyCode( item.CompanyCode). requestedQuantity(10). build())Request clarification before answering.
Have u got any solution for that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you checked the meta data of your SAP interface for that field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.