Hi,
I have a number of fields which use the annotation
@ObjectModel.text.association: '_<StandardSAPObject>Text'
MyFieldID,
to automatically add and populate a field in the resulting OData service called <MyFieldID>_TEXT
When these fields are shown in the UI, they have the field label from the underlying standard CDS, which is often something like 'Short Text' or 'Description'. I need to be able to give them more helpful labels so the user can tell one from another.
I have tried adding @EndUserText.label annotation to the exposed associations, e.g.
@EndUserText.label: 'My Own Label'
_<StandardSAPObject>Text
but this doesn't seem to make any difference.
I have also added the same annotation to the _TEXT field in a Metadata Extension. It gives me a warning because the field is not present in the CDS View, which is understandable, but it still doesn't change the label in the $metadata.
Is there a CDS annotation I can use (and where should I use it) to relabel these fields that are generated by the SADL framework?
Thanks,
Andrew
Request clarification before answering.
I believe the annotations for the _Text field will be coming from it's cds view(association), which is the standard cds view in your case. So trying to add annotation in your main cds view view metadata extension will not change the text as the field (_text) is not available there yet, it will be generated by SADL layer. So I think you have the below choices.
1. If you have MPC_EXT class, you can add the annotation (@EndUserText.label) for the standard cds view(association) by redefining the "DEFINE" method. you will find a lot of blogs regarding this.
2. You can create a metadata extension for the standard cds view(association) and add your annotion to it. (Likely not possible as lot's of std. cds view doesn't support metadata extension)
3. This is simple, Just create another CDS view on top of the standard cds view and use that in your association and add it to ur objectmodel.text annotation. In the new cds view, just mention the @enduser.label annotation, which will be enough, remaining annotations will flow(propage) from stanard cds view to your new cds view (only element level, if other level annotations, you need to add them manually again)
Thanks,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I did the same by extending standard CDS view and added the annotation to the MPC_EXT class in Define method. It was working fine in 1709. But after upgrading to 2020, the value help annotations are not loading. I am able to see the custom fields that I have created using the extended view but not all the annotations are getting loaded properly and value help is not coming for the custom field.
Am I missing something or do I need to redo some activity? request your input here.
Regards,
Mahendran B.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.