cancel
Showing results for 
Search instead for 
Did you mean: 

"Text Through Text Associations" in RAP triggers exception

Marian_Zeis
Active Contributor
1,312

Hi Experts,

currently on a On Premise S/4HANA FPS03 System with a OData V4 Service and Fiori Elements.

I´d like to use feature to get Text through an association in RAP described here to use a text from a cds view association without integrating it directly in the consuming CDS View and using "@ObjectModel.text.element".
Only read access is necessary.

The other feature "Getting Language-Dependent Text in Projection Views" worked.

When i try to use to use the text through an association i get the error "text association _Text is not allowed" (error from /IWFND/ERROR_LOG error-xml-file-iwfnd-error-log.txt).

At first I thought it was the association, but after debugging it seems that all text associations trigger an error.

Here is my Text CDS View:

@EndUserText.label: 'Basic Interface View for Text'
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.dataCategory: #TEXT
@ObjectModel.representativeKey: 'KeyField'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.resultSet.sizeCategory: #XS
@ObjectModel.usageType:{
    serviceQuality: #X,
    sizeCategory: #S,
    dataClass: #MIXED
}

define view entity ZI_TEXT_VIEW
  as select from ztexts
{
  key keyfield as KeyField,
      @Semantics.language: true
  key spras     as langu,
      @Semantics.text: true
      longtext  as LongText
}
Here is the consuming abbreviated Interface View:
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Interface View'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
    serviceQuality: #X,
    sizeCategory: #S,
    dataClass: #MIXED
}
define view entity ZI_OTHER_VIEW
  as select from zdata
  association [1..*] to ZI_TEXT_VIEW      as _Text on $projection.Key = _Text.KeyField
{
  key guid                                              as Guid,

      @Consumption.valueHelpDefinition: [{  entity: {name: 'ZI_VALUE_HELP', element: 'Key'}}]
      //@ObjectModel.text.association: '_Text'
      key                                    as Key,
      _Text
}<br>

Here are my debugging results:

In the method CL_SADL_EC_PROJECTION_VIEW->CHECK will be the method "CHECK_NO_TEXT_ELEMS_W_TXT_ASSO" called from class CL_SADL_EC_COMMON_CHECKS.

In this method, any usage of the annotation "@ObjectModel.text.association" will result in an "RAISE EXCEPTION".

Did i miss something in the documentation why this is not allowed?

I could find some usage in other CDS View like "C_IT_TaxReturnBoxQuery", but i guess this is not in usage with RAP.

DanielSchneider
Explorer
0 Kudos

Hi marianzeis,

did you manage to find a solution for this?

I'm facing the same issue right now. It is even kind of worse for me, since I am on a S/4H-Cloud system and I am using a released RAP object which I can't extend with the needed description/text fields. The only option I see is the annotation for text associations (I am able to add an association, which I then could use in the annotation).

Anyway, if you found a solution or a workaround, it would be great if you could share it!

Thanks,

Daniel

0 Kudos
Hi Marian. Have you found the explanation for such the behavior? I also was going to avoid explicit text field projection, but rather using text association. Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

Micha_Reisner
Explorer

Same issue for me!

Duplolas
Explorer
0 Kudos
For me too. Please, I need a solution for this ^^
Sachin_Kumar_To
Discoverer
0 Kudos

I faced the same issue. To resolve, I exposed the  reference Text element in same projection view . Finally used @ObjectModel.text.element instead of @ObjectModel.text.assocation.

Sachin_Kumar_To_1-1717218016555.png

Hope that will resolve the issue. p.s. As per SAP Help documentation "You cannot combine text associations with projection scenarios."