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

Sales Order OData V4 doesn't return the characteristics with date type correctly

AIT-LAHCEN
Explorer
0 Likes
856

Hello

We're using Sales Order OData V4 API to get the characteristics in item level, and for all characteristics with CharcDataType = DATE, the value of the date is not showing in the GET call result.

For example, I have a characteristic populated with 01/30/2025 in SO 73 item 10, and when calling the OData:

{hostname}/sap/opu/odata4/sap/api_salesorder/srvd_a2x/sap/salesorder/0001/SalesOrderItem(SalesOrder='73',SalesOrderItem='10')?$expand=_VariantConfiguration($expand=_Instance($expand=_Characteristic($expand=_AssignedValue($select=Characteristic,VarCnfCharacteristicValue,VarCnfCharcValueDescription))))

This is the characteristic piece of the result

{
                        "VarConfigurationBusObjectKey": "0000000073000010",
                        "VarConfigurationBusObjectType": "SalesOrderItem",
                        "VarConfignInstceInternalID": 1,
                        "Characteristic": "Z_HGM0400_040",
                        "CharcDataType": "DATE",
                        "CharcTemplate": "MM/DD/YYYY",
                        "Currency": null,
                        "CharcValueUnit": null,
                        "VarCnfCharcISOUnit": null,
                        "IsReadOnly": false,
                        "EntryIsRequired": false,
                        "CharcIsHidden": false,
                        "AdditionalValueIsAllowed": true,
                        "MultipleValuesAreAllowed": false,
                        "_AssignedValue": [
                            {
                                "VarConfigurationBusObjectKey": "0000000073000010",
                                "VarConfigurationBusObjectType": "SalesOrderItem",
                                "VarConfignInstceInternalID": 1,
                                "Characteristic": "Z_HGM0400_040",
                                "VariantConfigurationValueID": "1-",
                                "VarCnfCharacteristicValue": null,
                                "VarCnfCharcValueDescription": null
                            }
                        ]
                    }
Is this a standard behavior, if yes where I can see the 01/30/2025 value of the characteristic ?

Thanks & Regards,

Ahmed.

Accepted Solutions (1)

Accepted Solutions (1)

DequanXu
Product and Topic Expert
Product and Topic Expert

Hello,

In the response shared, the `VarCnfCharacteristicValue` is showing `null`, which is unexpectedly missing the date value '01/30/2025'.

This behavior may not be standard and can result from a few potential factors:

1. **Formatting Issue**: The formatting of the date might not be correctly handled in the OData service. Given that the `CharcTemplate` is "MM/DD/YYYY", ensure your system is correctly interpreting and returning this format as expected. Sometimes system locale or configuration settings can impact date representation.

2. **System Configuration**: Confirm that the configuration within SAP for the characteristic correctly maps and handles DATE types. Any middleware or transformation layer could potentially influence data display.

3. **Filtering or Query Adjustments**: Ensure that there are no additional filters or limitations in your OData Service that may strip out or mask specific types of data like dates.

4. **Testing with Direct API Calls**: Sometimes testing the service with a wider set of queries or confirming with direct database reads (if accessible and safe in your environment) may highlight if this is an API-specific issue or a wider data propagation issue.

To troubleshoot further, you could try:
- Checking if there's an update to the OData Service or any known issues reported for your version of SAP S/4HANA.
- Re-evaluating any enhancements or additional functionalities added to the system that might impact standard behavior.

Best regards,

Dequan Xu

AIT-LAHCEN
Explorer
0 Likes

Thanks Dequan,

The value was stored in VarCnfCharcFromDate, so the logic of this API is that for each type of data we have a field that contains the value specifically for that type (VarCnfCharcFromAmount, VarCnfCharcFromQuantity, VarCnfCharcFromNumericValue...).

Answers (0)