Symptom
The value of any Language field of a custom CDS view is only a single character, but in the OData service for that view, the Language field is 2 characters
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Create a custom CDS view using the Custom CDS Views app
- As the primary data source pick a source that has a field called Language
- Ensure that OData API is selected for this CDS view so that an OData service is created for the view
- Publish the view, and preview the data
- At this point you will see that the value of the Language field is always a single character
- Set up a communication scenario and arrangement so the OData service can be accessed via a browser
- Now access the OData service to see the data that is in the view
- Notice that the values for the Language field are now displayed as 2 characters
Cause
- For views with the Language field there will be a built in association to the _Language view
- This _Language view contains the Name for the Language, as well as the ISO Code for the language
- It is the ISO Code that is displayed in the OData service
Resolution
- This is working as expected, the ISO Code is more valuable to most users, so it is the one displayed in the OData service
- The single character language code is called te SAP Language Code
- The relation between the ISO Code and the SAP Language Code are described at Supported Languages and Code Pages
Keywords
SAP Language Code ISO Code length , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem
Product
SAP S/4HANA Cloud Public Edition all versions ; SAP S/4HANA Cloud all versions