CDS - Filter List Reports by Child Entity Fields

👋 Hello Everyone!

Filter List Reports by Child Entity Fields

Have you ever wanted to filter a list report based on a field from a child entity? For example, filtering travel records by the AirlineID from the associated _Booking entity?

You can achieve this by adding the following annotation to the root CDS view metadata extension (e.g., Travel):

@UI.selectionField: [{ element: '_Booking.AirlineID', position: 50 }]
_Booking;

🎥 Demo: Filtering by Child Entity Field (OData V4)

I tested this in the BTP ABAP Environment, and it works perfectly — but only with OData V4.

Comments

  1. My problem is that I need two fields from the same child entity, but you can’t reference the entity twice. How would you handle that?

    ReplyDelete
    Replies
    1. Hi, You can define your fields like this.
      @UI.selectionField: [{ element: '_entity.field1', position: 10 },
      { element: '_entity.field2', position: 20 }]
      _entity;

      Delete

Post a Comment

Popular posts from this blog

Fiori URL Generation and Navigation Using CL_LSAPI_MANAGER

RAP - Real Time UI Updates Using Event-Driven Side Effects

ABAP - Create CSV Files Easily Using CL_CSV_FACTORY