cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK - How do I filter items in a list of items?

emorales
Explorer
0 Kudos
103

Hello community! I'll tell you what I want to achieve. I have this list of "Areas" in a "Simple Property Collection"

emorales_0-1726596093631.png

Each area has a list of certain teams associated with it, these teams must be filtered by the ID of the Area entered, because each area has different teams (Equipos).

I have a navigation called "NavTo_Equipos.action"

emorales_1-1726596272038.png

This is my "Equipo" page, I thought it would automatically filter the teams according to their areas but it didn't.

emorales_2-1726596505104.png

For each area it shows me the same complete list of equipment. And this is wrong.

I also tried setting up this filter but it didn't work. This way it shows me absolutely nothing.

emorales_3-1726596615397.png

What am I doing wrong? I am attaching this just in case how the relationship was presented in my CAP service.

entity AREA : cuid, AUDITORIA, ACTIVO {
    EMPRESA : Association to one EMPRESA;
    DESCRIPCION : String100;
    DESCRIPCIONCONCATENADA : String5000;
    AREANIVEL : Association to one AREANIVEL;
    CODIGOSAP : String;
    ACTIVOSAP : Boolean;
    EQUIPOS : Association to many EQUIPO on EQUIPOS.AREA = $self;
}

entity EQUIPO : cuid, AUDITORIA, ACTIVO {
    DESCRIPCION : String100;
    AREA : Association to one AREA;
    SECTOR : Association to one SECTOR;
    LIDER : Association to one PERSONA;
    COORDINADORCORPORATIVO : Association to one PERSONA;
    COORDINADORGENERAL : Association to one PERSONA;
}

Thanks for the help

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

When you select an AREA from the simple property collection, MDK will set the default binding object for the next page to be the selected AREA record.  Since your AREA record has a navigation property to EQUIPOS you can just set the target of your list to be based on the readLink and nav property.

{@odata.readLink}/EQUIPOS

 This should then just display the EQUIPOS associated to the AREA assuming the Nav Property is properly filtering.