# How to handle long field names in your OData: solutions and alternatives

> Who has never had to adapt a CDS field because it exceeded 30 characters? And, as a side effect, it is therefore impossible to have the desired field in the OData service. Here is a quick and effective solution to avoid this problem. An example is available on our Gitlab. I. CDS in error Let’s

- URL: https://abaper.app/articles/how-to-handle-long-field-names-in-your-odata-solutions-and-alternatives/
- Published: 12 November 2025 (updated 12 February 2026)
- Author: Clément Ringot
- Category: ABAP
- Tags: ABAP Cloud, BTP, BTP, ABAP Environment, Classic ABAP, S/4 Hana, S/4 HANA - On Premise, S/4 HANA - Private Cloud, S/4 HANA - Public Cloud

Who has never had to adapt a CDS field because it exceeded 30 characters? And, as a side effect, it is therefore impossible to have the desired field in the OData service.

Here is a quick and effective solution to avoid this problem.

An example is available on our Gitlab.

## I. CDS in error

Let’s take a simple case of a CDS we created where one field exceeds 30 characters.

![](https://abaper.app/images/articles/how-to-handle-long-field-names-in-your-odata-solutions-and-alternatives/image-01.png)

We can see that there is an error and that we cannot activate the CDS.

We could shorten the field name and then activate CDS to expose it within a service and consume it in OData, but we really want this field name.

## II. Solution

There is an OData annotation to work around the problem: [OData.property.name](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/ABENCDS_311850322-_ANNO.html).

This annotation is a framework-specific annotation and is evaluated at runtime by the SADL framework.

Our corrected CDS is therefore:

![](https://abaper.app/images/articles/how-to-handle-long-field-names-in-your-odata-solutions-and-alternatives/image-02.png)

Here, there are no more errors, and we can activate the CDS and create the associated OData service:

![](https://abaper.app/images/articles/how-to-handle-long-field-names-in-your-odata-solutions-and-alternatives/image-03.png)

![](https://abaper.app/images/articles/how-to-handle-long-field-names-in-your-odata-solutions-and-alternatives/image-04.png)

In this example, we are using an S/4 Hana system, Private Cloud, but this annotation is also available on BTP, ABAP Environment, S/4 Hana, Public Cloud, and On Premise.

## III. Test

![](https://abaper.app/images/articles/how-to-handle-long-field-names-in-your-odata-solutions-and-alternatives/image-05.png)

We can see that the desired field is well exposed and consumable via OData.
