cancel
Showing results for 
Search instead for 
Did you mean: 

Action in Fiori Element List Report

chrisgr
Explorer
0 Kudos

Hello,

I am trying to create a Fiori App based on the Fiori Element List Report template.

I have created my CDS views with relevant annotations ( field to be dislplayed, action, filter...).

I have created a SEGW project and added the Entities via Data Source References (exposures via SADL).

in SEGW, I have redefined the method DEFINE of the class MPC_EXT to add function imports: Function imports cannot be created directly in SEGW when using ‘exposures via SADL’: ‘return type’ and ‘return entity set’ cannot be added. Below it is the code for the function imports

 DATA(lo_action) = model->create_action( iv_action_name ).
        lo_action->set_action_for( 'xABCDxC_REV_DeductionItemType' ).
        "set return parameter
        lo_action->set_return_entity_type( 'xABCDxC_REV_DeductionItemType' ) .
        lo_action->set_return_entity_set( 'xABCDxC_REV_DeductionItem' ).
        lo_action->set_http_method( 'PUT' ).
        lo_action->set_return_multiplicity( /iwbep/if_mgw_med_odata_types=>gcs_cardinality-cardinality_1_1 ).
        "specify input parameters


        DATA(lo_parameter) = lo_action->create_input_parameter(
                                      iv_parameter_name = 'DedDoc'
                                      iv_abap_fieldname = 'DEDOC' ).
        lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_string( ).
        lo_parameter->set_maxlength( iv_max_length = 10 ).


   DATA(lo_annotation) = lo_action->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' ).
    lo_annotation->add( iv_key = 'action-for' iv_value = 'xABCDxC_REV_DeductionItemType' ).
    lo_annotation = lo_action->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' ).
    lo_annotation->add( iv_key = 'applicable-path' iv_value = 'IsActive' ).

I have generated the App with the help of webide based on the ‘List report application’ template. In the annotation Selection popup, I have selected both proposed annotation files (Selected service Metadata and annotation from the CDS view).

I have chnaged the manifest.json to enable mutliple views with different entity sets:

"quickVariantSelectionX": {
							"showCounts": true,
							"variants": {
								"0": {
									"key": "_tab1",
									"entitySet": "xABCDxC_REV_DeductionItem",
									"annotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#DtlView"
								},
								"1": {
									"key": "_tab2",
									"entitySet": "xABCDxC_REV_DeductionH",
									"annotationPath": "com.sap.vocabularies.UI.v1.SelectionVariant#SumView"
								}
							}
						}

When I run the App, I get a nice layout but the button are not active:

In the console I have the following errors:

In the metadata of the service I can see the function imports.

I cannot understand why the buttons are not active. Could you help me?

Thank you for your support

Christophe

Accepted Solutions (0)

Answers (0)