cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Row selection column does not appear in the List Report

Karthik_Gali
Participant
0 Likes
790

Dear Community,

I have created a Fiori Elements application using the List Report template. After generating the app, I added the required configuration in the manifest.json to enable multi-row selection. However, the row-selection column still does not appear, and multi-selection is not working.

 

"controlConfiguration": {
                "@com.sap.vocabularies.UI.v1.LineItem": {
                  "tableSettings": {
                    "type": "ResponsiveTable",
                    "selectionMode":"Multi"
                  }Multi selection.png

Regards,
Karthik

Accepted Solutions (1)

Accepted Solutions (1)

MioYasutake
SAP Champion
SAP Champion

@Karthik_Gali 

After adding an action to the behavior definition, you need to add annotations for adding the action button on the table toolbar. Please see the sample below:

@UI.lineItem: [
  {
    type:#FOR_ACTION,
    label: 'Change Criticality (#ActionInLineItem)',
    dataAction: 'changeCriticality',
    position: 10
  }
]
LastChangedAt;

https://github.com/SAP-samples/abap-platform-fiori-feature-showcase/blob/main/03_list_report_content...

 

 

Karthik_Gali
Participant
0 Likes

Thank you, @MioYasutake!

1)Could you please share how to add multiple buttons? I tried adding several, but only the last action in the list is being displayed.

2)If I understood correctly, we need to define the buttons as you mentioned and set the selection mode to ‘multi’ in the controller extension to enable multiple selection, as also suggested by @junwu, is that right?

I’m asking again because, at one point, multi-selection worked even without adding anything in the controller extension, but it suddenly stopped working. So I’m trying to understand what might be causing this inconsistent behavior.

MioYasutake
SAP Champion
SAP Champion

@Karthik_Gali

1) You can add as many actions as you want, like the example below:

@UI.lineItem: [
  {
    type:#FOR_ACTION,
    label: 'Change Criticality (#ActionInLineItem)',
    dataAction: 'changeCriticality',
    position: 10
  },
  {
    type:#FOR_ACTION,
    label: 'Second Action',
    dataAction: 'secondAction',
    position: 20
  }
]
LastChangedAt;

2) You can enable multi-selection in the manifest.json file as shown below (no need for a controller extension):

"SalesOrderManageList":{
         "type":"Component",
         "id":"SalesOrderManageList",
         "name":"sap.fe.templates.ListReport",
         "options":{
            "settings":{
               "contextPath":"/SalesOrderManage",
               "controlConfiguration":{
                  "@com.sap.vocabularies.UI.v1.LineItem":{
                     "tableSettings":{
                        "type":"ResponsiveTable",
                        "selectionMode":"Multi"
                     }
                  }
               }
            }
         }
      }

 https://sapui5.hana.ondemand.com/#/topic/116b5d82e8c545e2a56e1b51b8b0a9bd

 

Karthik_Gali
Participant
0 Likes

Thank you, @MioYasutake! Do you see any issue in the below Behavior definition and annotations in the consumption view ? as I get to see only last action 'One Click Action' on the UI. Also, the actions are not appearing in the metadata and despite re-publishing the service binding several times, it still does not work.

Annotations in Consumption view:

define view entity Z_C_BP_CONTACTS
  as select from Z_I_BP_CONTACTS
{
  @UI.lineItem: [
    { position: 10, importance: #HIGH },
    { type: #FOR_ACTION, position: 10, dataAction: 'action_x', label: 'Action X' },
    { type: #FOR_ACTION, position: 20, dataAction: 'print_y', label: 'Print Y' },
    { type: #FOR_ACTION, position: 30, dataAction: 'print_z', label: 'Z' },
    { type: #FOR_ACTION, position: 40, dataAction: 'send_payment', label: 'Send Payment' },
    { type: #FOR_ACTION, position: 50, dataAction: 'one_click_action', label: 'One Click Action' }
  ]
  @UI.selectionField: [{ position: 20 }]
  @UI.identification: [{ position: 20 }]
  @EndUserText.label: 'Service Id'
  key ServiceId,

 

Behavior Definition:

unmanaged implementation in class zcl_i_bp_contacts unique;
strict ( 2 );

define behavior for Z_I_BP_CONTACTS
//late numbering
lock master
authorization master ( instance )
//etag master <field_name>
{
  create ( authorization : global );
  update;
//  delete;
  field ( readonly ) ServiceId;

  action action_x result [1] $self;
  action print_y result [1] $self;
  action print_z result [1] $self;
  action send_payment result [1] $self;
  action one_click_action result [1] $self;
}

 

MioYasutake
SAP Champion
SAP Champion
@Karthik_Gali Have you exposed all the actions in the behavior projection?
Karthik_Gali
Participant
0 Likes

So far, I have created a root view CDS(Z_I_BP_CONTACTS) to define the BO and also created a behavior definition for this CDS. Later, I created another view entity CDS(Z_C_BP_CONTACTS) on top of Z_I_BP_CONTACTS to maintain UI annotations. After this, I have created List report app using (Z_C_BP_CONTACTS). On the UI, only the first action defined in the action list is being displayed ignoring the rest. I have not created or used any behavior projection.

Karthik_Gali
Participant
Thank you, @MioYasutake! After creating the behavior projection, everything worked.

Answers (1)

Answers (1)

junwu
SAP Champion
SAP Champion

look like you have readonly entity, that's why they didn't render the selection box

junwu
SAP Champion
SAP Champion
0 Likes
setSelectionMode("Multi") use code to enable it.
Karthik_Gali
Participant
0 Likes

Thank you @junwu ! Although this is a read-only entity, we still need to trigger certain actions. I tried adding a Create operation as well as an action in the behavior definition, but the row selection is still not enabled.You mentioned using setSelectionMode("Multi"). Just to confirm, should this be added in the List Report controller extension?

junwu
SAP Champion
SAP Champion
yes, in the ext controller