SAP Knowledge Base Article - Public

3631660 - Error When Attempting to Nullify Automatic Renewal Fields in Service Contract Item in API_SERVICE_CONTRACT_SRV in SAP S/4HANA Cloud Public Edition

Symptom

When updating a Service Contract Item via the BTP Integration Suite (using the standard API), the following error occurs:

  • Error message: "Validation error due to mandatory fields"

Environment

SAP S/4HANA Cloud Public Edition

 

Reproducing the Issue

  1. Open the Manage Service Contracts app in SAP Fiori Launchpad.
  2. Search for a Service Contract that has Automatic Renewal enabled (checkbox ticked in the item details).
  3. Select the contract and click into the relevant item (e.g., item 121).
  4. Scroll to the Service Contract Item Details section, click "Show More", and verify:
    • Renewal Period, Contract Extension, and corresponding unit fields are populated.
  5. Open the SAP BTP Integration Suite or use a tool like Postman to send a PATCH request to update the contract item.

In the payload, attempt to set the following fields to "0" or "":

json

{
  "SrvcContrItemRnwlDuration": "0",
  "SrvcContrItmRnwlDurnUntSAPCode": "",
  "SrvcContrItmRnwlDurnUntISOCode": "",
  "SrvcContrItemExtensionDuration": "0",
  "SrvcContrItmExtnDurnUntSAPCode": "",
  "SrvcContrItmExtnDurnUntISOCode": ""
}
Execute the request.

The system returns a 400 Bad Request or validation error, indicating that these fields cannot be null or zero.

Cause

The error is due to backend validation constraints in the Service Contract Item API. The fields SrvcContrItemRnwlDuration, SrvcContrItmRnwlDurnUntSAPCode, SrvcContrItmRnwlDurnUntISOCode, SrvcContrItemExtensionDuration, SrvcContrItmExtnDurnUntSAPCode, and SrvcContrItmExtnDurnUntISOCode are defined as mandatory in the "Service Contract Item (for create)" schema and cannot be updated to NULL, "0", or empty values once they have been initially set.

Resolution

Two Options

Option 1: Disable Automatic Renewal

    • Uncheck the checkbox in the UI, or send a PATCH request with:

             json
            { "AutoRenewalEnabled": false }
        This allows the fields to be left as-is without violating validation.

Option 2: Keep Valid Values

  • Leave valid values in the renewal and extension fields.
  • Do not attempt to clear or nullify them while renewal is enabled.

See Also

3480857 - Auto-renewal error "Item &1: Date type-specific customizing is missing for recurring type &2" occurs for service contract

Keywords

SAP S/4HANA Cloud Public Edition, Public Cloud, Service Contract, Automatic Renewal, PATCH error, API_SERVICE_CONTRACT_SRV, SrvcContrItemRnwlDuration, Contract Extension, renewal period, BTP Integration Suite, 400 Bad Request, validation error, null update, service contract item API, OData, SAP API Hub, field cannot be empty, service contract item, API_SERVICE_CONTRACT_SRV , KBA , CRM-S4-SRV-CTR-2CL , S4CRM: Service Contract (Public Cloud) , Problem

Product

SAP S/4HANA Cloud Public Edition all versions