03-18-2024 10:47 AM - edited 03-18-2024 10:47 AM
Hello experts,
There is a standard CDS view we would like to extend by adding a text field. We want to add a Material_Text field, which will contain the text of the existing field Material. Material would then have the annotation sap:text='Material_Text' in the OData metadata. We already have a text view properly setup.
If we were creating the view from scratch, it would be simple. We would just need to use:
{
...
@ObjectModel.text.association: '_Text'
matnr as Material,
_Text
}
But since we are trying to extend an existing view via, the code below fails:
extend view C_ConsumerView with ZC_CONSUMER
association [0..*] to I_MaterialText as _MaterialText on $projection.Material3 = _MaterialText.Material
{
@ObjectModel.text.association: '_MaterialText'
Material,
_MaterialText
}
as we get the "The name Material is not unique" error, as it tries to add a field that already exists. @ObjectModel.text.association or sap:text also not available via metadata extension
So what would be the correct way to approach this?
Best regards,
André
extend view C_ConsumerView with ZC_CONSUMER
association [0..*] to I_MaterialText as _MaterialText on $projection.Material3 = _MaterialText.Material
{
_MaterialText
}
create another metadata extension view to extend the annotation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.