SAP Knowledge Base Article - Public

3709720 - Error M3 134 "Valid from date only defined in conjunction with status" during Product Update via API_PRODUCT_SRV API - SAP S/4HANA Cloud Public Edition

Symptom

While attempting to update or remove a plant-specific product status ("ProfileCode") from a Material Master record using API_PRODUCT_SRV the request fails and returns error message M3 134 "Valid from date only defined in conjunction with status.".

Environment

  • SAP S/4HANA Cloud Public Edition
    • Master Data - Product (Material Master)
    • API_PRODUCT_SRV OData API

Reproducing the Issue

  1. Create a material in a specific plant that has a plant-specific product status and an associated "ProfileValidityStartDate".
  2. Attempt a PATCH operation using the "API_PRODUCT_SRV/A_ProductPlant(Product='&',Plant='&')" endpoint with a payload that tries to remove the "ProfileCode" but either explicitly retains the "ProfileValidityStartDate" or does not explicitly clear it.
    - Example Payload that may cause the issue (if attempting to remove "ProfileCode" while "ProfileValidityStartDate" is present):
            <A_ProductPlant>
              <A_ProductPlantType>
                <Product>&</Product>
                <Plant>&</Plant>
                <ProfileCode></ProfileCode>
                <ProfileValidityStartDate>&</ProfileValidityStartDate>
              </A_ProductPlantType>
            </A_ProductPlant>
  3. The system returns the error message: "Valid from date only defined in conjunction with status."

Cause

The "ProfileValidityStartDate" field in the Material Master for plant-specific product status is inherently dependent on the existence of a "ProfileCode". This means that a "Valid From" date cannot exist in the system without an associated plant-specific product status.

The "API_PRODUCT_SRV" adheres to these standard Material Master validation rules. When a PATCH operation attempts to remove the "ProfileCode" (status) while the "ProfileValidityStartDate" (valid from date) is still present or not explicitly cleared in the same request, the system prevents the operation to maintain data consistency, as it would result in an parentless "ProfileValidityStartDate" without a "ProfileCode". This behavior is consistent across the API and the standard Material Master Fiori apps.

Resolution

To successfully manage (remove or update) a material's plant-specific product status and its associated "ProfileValidityStartDate" via the "API_PRODUCT_SRV", ensure that the dependency between these two fields is respected.

Follow one of these approaches:

First approach: Clear "ProfileValidityStartDate" first, then "ProfileCode" (Two-Step Process):

  1. Send a PATCH request to explicitly clear or remove the "ProfileValidityStartDate" for the specific material and plant. This operation is allowed as long as the "ProfileCode" still exists.
  2. After the "ProfileValidityStartDate" has been successfully cleared, send a subsequent PATCH request to clear or remove the "ProfileCode".

Second approach: Clear "ProfileCode" and "ProfileValidityStartDate" simultaneously:

  1. Construct a single PATCH request that explicitly sets both the "ProfileCode" and the "ProfileValidityStartDate" to an empty value, thereby removing both fields in one operation.
    This ensures that no "ProfileValidityStartDate" is left without a "ProfileCode".
    Example of clearing both:
            <A_ProductPlant>
              <A_ProductPlantType>
                <Product>&</Product>
                <Plant>&</Plant>
                <ProfileCode></ProfileCode>
                <ProfileValidityStartDate></ProfileValidityStartDate>
              </A_ProductPlantType>
            </A_ProductPlant>

By ensuring that the "ProfileValidityStartDate" is not left without an accompanying "ProfileCode", the system's validation rules will be satisfied, and the operation will complete without error.

See Also

Keywords

ProfileValidityStartDate, ProfileCode, Material Master, Product Master, API_PRODUCT_SRV, OData, PATCH, error, status, valid from date, dependency, S/4HANA Cloud Public Edition, A_ProductPlant, integration. , KBA , LO-MD-MM-2CL , Product Master for Public Cloud , Problem

Product

SAP S/4HANA Cloud Public Edition all versions