Skip to Content
0
Jun 25, 2018 at 09:24 AM

cancellation of purchase invoice by service layer

414 Views

Dear Experts,

We are trying to post a cancellation to a purchase invoice.

When we post /PurchaseInvocie(id)/Cancel we receive the following response

{ "error": { "code": -5006, "message": { "lang": "en-us", "value": "The requested action is not supported for this object." } } }

According to the service layer API documentation (SAP 9.3 PL3) this function should be supported -

The steps we are doing -

1. Post /PurchaseDeliveryNotes

{ "CardCode": "VO_Main", "DocDate": "2018-06-20", "DocDueDate": "2018-07-20", "DocumentLines": [ { "ItemCode": "SP234325", "Quantity": "100", "UnitPrice": "30" } ] }

Response - 201 Created

{ "odata.metadata": "https://.....:50000/b1s/v1/$metadata#PurchaseDeliveryNotes/@Element", "DocEntry": 460, "DocNum": 436,


2. Post /PurchaseInvoices

{ "CardCode": "VO_Main", "DocDate": "2018-06-25", "DocDueDate": "2018-07-25", "DocumentLines": [ { "BaseType": 20, "BaseEntry": 460, "BaseLine": 0 } ] }

Response - 201 Created

{ "odata.metadata": "https://......:50000/b1s/v1/$metadata#PurchaseInvoices/@Element", "DocEntry": 457, "DocNum": 424, "DocType": "dDocument_Items", "HandWritten": "tNO",


3. Post /b1s/v1/PurchaseInvoices(457)/Cancel

Response - 400 Bad Request

{ "error": { "code": -5006, "message": { "lang": "en-us", "value": "The requested action is not supported for this object." } } }

Attachments

capture.png (28.6 kB)