Symptom
- The API A_SlsPrcgConditionRecord does not return material data directly at the header level.
- Users expect to retrieve material information linked to the condition record ID.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Use the API A_SlsPrcgConditionRecord to retrieve condition record information.
- Attempt to retrieve material data directly at the header level without expanding the navigation property.
- Observe that material data is not returned in the response.
Cause
- The Material field is not part of the root entity A_SlsPrcgConditionRecord. Instead, it resides in a related entity called A_SlsPrcgCndnRecdValidity.
- This modeling is intentional, as the Material is associated with the validity period of the condition record, not the condition header itself.
Resolution
To retrieve the Material field linked to a specific ConditionRecord, use the $expand query option on the navigation property to_SlsPrcgCndnRecdValidity.
Example Request
- GET /sap/opu/odata/sap/API_SLSPRICINGCONDITIONRECORD_SRV/A_SlsPrcgConditionRecord('123')?$expand=to_SlsPrcgCndnRecdValidity
Example Response
- <d:ConditionRecord>0000008050</d:ConditionRecord>
...
<m:properties>
<d:Material>300000001</d:Material>
<d:ConditionValidityStartDate>2025-01-29T00:00:00</d:ConditionValidityStartDate>
<d:ConditionValidityEndDate>9999-12-31T00:00:00</d:ConditionValidityEndDate>
</m:properties>
If you are retrieving multiple condition records, you can expand all in one call:
- GET /sap/opu/odata/sap/API_SLSPRICINGCONDITIONRECORD_SRV/A_SlsPrcgConditionRecord?$expand=to_SlsPrcgCndnRecdValidity
Note
- The metadata ($metadata) of the API confirms that Material is defined under the entity type A_SlsPrcgCndnRecdValidityType.
- Navigation from A_SlsPrcgConditionRecord to A_SlsPrcgCndnRecdValidity is standard and available to all consumers of this API.
Keywords
material retrieval, condition record, A_SlsPrcgConditionRecord, A_SlsPrcgCndnRecdValidity, $expand function, nested structure, SAP S/4HANA Cloud Public Edition, API_SLSPRICINGCONDITIONRECORD_SRV, material data, header level, condition record ID, material not shown, S/4HANA Cloud , KBA , SD-SLS-API-2CL , API (Public Cloud) , Problem
SAP Knowledge Base Article - Public