SAP Knowledge Base Article - Public

3688550 - Update/Creation of Schedule Lines via API_SALESORDER OData V4 fails with error "405 – Method Not Allowed"

Symptom

While processing a sales order through the OData V4 API SRVD_A2X (API_SALES_ORDER), attempts to create (POST) or update (PATCH) a schedule line using the A_SalesOrderScheduleLine entity fail with the error as "405 – Method Not Allowed".

Environment

SAP S/4HANA Cloud Public Edition

Cause

Creation or update of Schedule Lines is not enabled in the OData V4 Sales Order API (API_SALESORDER), as the A_SalesOrderScheduleLine entity is currently exposed as read-only and supports only GET operations.

Resolution

Follow either of the given solutions below as a workaround: 

  • Use the OData V2 API, which still supports POST (create) and PATCH (update) operations for schedule lines.
    • Example: POST - create a new schedule line for item -> <host>/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrderItem(SalesOrder='{{SO ID}}',SalesOrderItem='{{SO ITEM ID}}')/to_ScheduleLine
  • Maintain or correct the schedule lines manually in the Manage Sales Orders - Version 2 app.

See Also

Keywords

OData V4 API, SRVD_A2X, API_SALESORDER, OData V2 API, A_SalesOrderScheduleLine, 405 – Method Not Allowed, POST, PATCH, Schedule lines , KBA , SD-SLS-API-2CL , API (Public Cloud) , SD-SLS , Sales , Problem

Product

SAP S/4HANA Cloud Public Edition 2508