cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unable to use PATCH method to Update Production Order Component using OData Service

prathmesh009
Explorer
0 Kudos
540

Hello Experts, 

Currently i am working on a scenario where the requirement is to update the Production Order Components values from a Third Party software, I am using OData Service: 
 https://{domain}:{port}/sap/opu/odata/sap/API_PRODUCTION_ORDER_2_SRV/A_ProductionOrderComponent_3(Re...

and testing it with the payload (shared below) : 

{
    "d": {
        "ManufacturingOrder": " 6000004",
        "ManufacturingOrderSequence": "0",
        "ManufacturingOrderOperation": "0010",
        "BOMItem": "6",
        "BOMItemCategory": "L",
        "BillOfMaterialItemNumber": "0030",
        "RequiredQuantity": "5",
        "StorageLocation": "FG01",
        "Batch": "0000000895"
    }   
}

In Postman, I am getting error as HTTP Status Code 400 with Error Text as 

Malformed URI literal syntax

prathmesh009_0-1736143093743.png
prathmesh009_1-1736143150516.png

CSRF : Used 
Etag i found from getting the metadata through browser. 

As referred to SAP API Hub it is having 3 fields as mandatory which are : 1. ReservationItem 2. ReservationItem 3. ReservationRecordType

But not able to find the 3rd field which is ReservationRecordType also kindly provide your feedbacks / solution on this. 


Thanks & Regards, 
Prathmesh 

Accepted Solutions (0)

Answers (1)

Answers (1)

Andrei_Karanchuck
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @prathmesh009 ,

I’ve reviewed your request to help with the issue. According to the documentation, you indeed need to include the following mandatory fields in the request:

  • Reservation
  • ReservationItem
  • ReservationRecordType

Here’s the link to the documentation: link

According to the documentation, you can only change the following fields:

  • RequiredQuantity
  • StorageLocation
  • Batch

I followed the documentation, and everything is working for me. 
Most likely, you used the sample body from Try Out, which does not suit this API.

Steps to replicate my scenario:
1. Add the x-csrf-token.
2. Make sure to include the ETag in the If-Match header. To do this, make a GET request and copy the LastChangeDateTime value.
Here’s a screenshot showing how to get the LastChangeDateTime:

Andrei_Karanchuck_0-1736175718128.png

Here’s a screenshot showing how to insert the ETag in the header:

Andrei_Karanchuck_2-1736175826907.png

3. Use the GET request to retrieve the three mandatory fields and insert them into the request.

Example:

A_ProductionOrderComponent_3(Reservation='63',ReservationItem='6',ReservationRecordType='')  

Then, enter the required body:

{
    "RequiredQuantity": "3"
}

Execute the request, and the result will be as shown in the screenshot below.

Andrei_Karanchuck_3-1736175966426.png

I hope this helps.

BR,
Andrei.