cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable single selection in a Fiori Element list report

gzghidi
Explorer
0 Kudos
312

Hello everyone,
I'm working with SAP RAP OData V4, now when using OData V2 the list report is using radio button for selection so i can select only one record but when using V4 it uses a checkbox so i can select multiple records as shown below.

gzghidi_0-1745179602157.png

My question is, is it possible to change the checkbox to a radio button or add certain annotation so that i can only select one record.
Below is my metadata extension. 

@Metadata.layer: #PARTNER
@UI:{
   headerInfo:{ typeName: 'Congé',
                typeNamePlural: 'Liste des congés',
                title: { type: #STANDARD, label: 'Congé', value: 'Id' }},
                presentationVariant: [{ sortOrder: [{ by: 'Status', direction: #DESC }] }]
   }

annotate entity ZC_CONGE_RH
    with 
{


 @ui.facet: [{ id : 'Conge',
               purpose: #STANDARD,
               type: #IDENTIFICATION_REFERENCE,
               label: 'Detail de congé',
               position : 10
            }]   
    
 
    @ui: { lineItem: [{ position: 10, label: 'Id congé' }], identification: [{ position: 10, label: 'Id congé' }] }        
    Id;
    @ui: { lineItem: [{ position: 20, label: 'Type congé' }], identification: [{ position: 20, label: 'Type congé' }] }
    @Consumption.valueHelpDefinition: [{ entity: { name:'ZI_CONGE_DOM', element: 'Value' },
    distinctValues: true }]
    Type;
    @ui: { lineItem: [{ position: 30, label: 'Date debut congé' }], identification: [{ position: 30, label: 'Date debut congé' }] }
    Dob;
    @ui: { lineItem: [{ position: 40, label: 'Date fin congé' }], identification: [{ position: 40, label: 'Date fin congé' }] }
    Doe;
    @ui: { lineItem: [{ position: 50, label: 'Status' }, 
                      { type: #FOR_ACTION, dataAction: 'setValidation', label: 'Validate'}, 
                      { type: #FOR_ACTION, dataAction: 'setRejection', label: 'Reject'}], 
           
           identification: [{ position: 50, label: 'Status' }, 
                            { type: #FOR_ACTION, dataAction: 'setValidation', label: 'Validate'}, 
                            { type: #FOR_ACTION, dataAction: 'setRejection', label: 'Reject'}] 
         }
    Status;
    @ui: { lineItem: [{ position: 60, label: 'Demandé par' }], 
           identification: [{ position: 60, label: 'Demandé par' }] 
         }
    Createdby;
    @ui: { lineItem: [{ position: 65, label: 'Créé à' }], 
           identification: [{ position: 65, label: 'Créé à' }] 
         }
    CreatedAt;
    @ui: { lineItem: [{ position: 70, label: 'Date Validation / Rejection' }], identification: [{ position: 70, label: 'Date de Validation / Rejection' }] }
    ValidationDate;   
    
     
    
}

And this is my data definition Interface

@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Interface conge'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
@ObjectModel.usageType:{
    serviceQuality: #X,
    sizeCategory: #S,
    dataClass: #MIXED
}
define root view entity ZI_CONGE_RH
  as select from zpfe_conge_rh
  association to ZI_CONGE_DOM as _type on $projection.Type = _type.Value
{
  key id                as Id,
      type              as Type,
      dob               as Dob,
      doe               as Doe,
      status            as Status,
      createdby         as Createdby,
      createdat         as CreatedAt,
      validation_date   as ValidationDate,
      joursconge        as JoursConge,
      @Semantics.systemDateTime.lastChangedAt: true
      lastchangedat     as Lastchangedat,
      @Semantics.systemDateTime.localInstanceLastChangedAt: true
      locallastchange   as Locallastchange,
      _type,
      _type.Description as TypeDesc
}

And the consumption view

@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Consumption view conge'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
@ObjectModel.usageType:{
    serviceQuality: #X,
    sizeCategory: #S,
    dataClass: #MIXED
}
define root view entity ZC_CONGE_RH as projection on ZI_CONGE_RH
{
    @EndUserText.label: 'Id congé'
    key Id,
    @EndUserText.label: 'Type de congé'
    Type,
    @EndUserText.label: 'Date debut congé'
    Dob,
    @EndUserText.label: 'Date fin congé'
    Doe,
    @EndUserText.label: 'Status'
    Status,
    @EndUserText.label: 'Créé par'
    Createdby,
    @EndUserText.label: 'Créé à'
    CreatedAt,
    @EndUserText.label: 'Date de validation'
    ValidationDate,
    @ui.hidden: true
    JoursConge,
    @ui.hidden: true
    Lastchangedat,
    @ui.hidden: true
    Locallastchange
}

 

 

 

 

View Entire Topic
junwu
SAP Champion
SAP Champion
0 Kudos
gzghidi
Explorer
0 Kudos

Thanks for the answer, i'm using Eclipse as my IDE i can't really locate the manifest.json file.

I came across this https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-35.htm should proceed with it ?

junwu
SAP Champion
SAP Champion
0 Kudos
google how fiori is developed, you are way off.....
gzghidi
Explorer
0 Kudos
I started SAP RAP this week so i still have a long journey ahead of me, however thanks for your delightful answers.