Skip to Content
avatar image
Former Member

How can I have a search help in a dialog of the SAP Fiori List Report Application?

Hi,

We are developing an SAP Fiori List Report Application with the help of CDS Views.

For the UI we are using the template app “List Report Application” which is given by the WebIDE in SCP.

The SAPUI5 version we used for the template app is “1.44”. We are facing a problem with the Search Helps.

In the selection fields for filtering foreseen by the template application, we are able to implement and use the Search Helps but when we want to implement it in a dialog no search field is attached. Can you please give us a hint how we can add a search field to a dialog?

Please, check the document attached for more details and screenshots.

Thanks in advance and kind Regards,

Ermanno Cerutti

searchhelp.jpg (109.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 04 at 12:56 PM

    Hi Ermanno

    You have to annotate the corresponding function import parameter with the "com.sap.vocabularies.Common.v1.ValueList" term by extending the metadata.xml of your service via the model provider class. This could look like this:

        DATA:
          lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target,
          lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation,
          lo_record     TYPE REF TO /iwbep/if_mgw_vocan_record,
          lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection.
    
    "<Target> = {Technical name of service}.{Technical name of service}_Entities/{FunctionImport}/{ParameterName}'
        lo_ann_target = vocab_anno_model->create_annotations_target( iv_target = '<Target>' ).
        lo_annotation = lo_ann_target->create_annotation( iv_term = 'com.sap.vocabularies.Common.v1.ValueList' ).
        lo_record = lo_annotation->create_record( ).
    
        lo_record->create_property( 'Label' )->create_simple_value( )->set_string( 'Value Help Meter Reader' )        ##NO_TEXT.
    
        lo_record->create_property( 'CollectionPath' )->create_simple_value( )->set_string( '<entityset of the valuehelp>' ) ).
    "if annotation "@Search.searchable: true" is set in the CDS view of the value help
        lo_record->create_property( 'SearchSupported' )->create_simple_value( )->set_boolean( abap_true ).    
    
        "Collect parameters of value help (incl. result fields)
        lo_collection = lo_record->create_property( 'Parameters' )->create_collection( )      ##NO_TEXT.
    
        lo_record = lo_collection->create_record( 'com.sap.vocabularies.Common.v1.ValueListParameterInOut' ).
        lo_record->create_property( 'LocalDataProperty' )->create_simple_value( )->set_property_path( '<property name of target>' ). "this corresponds to the parameter name of the annotation target
        lo_record->create_property( 'ValueListProperty' )->create_simple_value( )->set_string( '<valuelist property name>' ) ). "property on F4
    
    "Optional: bind some additional import parameters
        lo_record = lo_collection->create_record( 'com.sap.vocabularies.Common.v1.ValueListParameterIn' ).
        lo_record->create_property( 'LocalDataProperty' )->create_simple_value( )->set_property_path( '<localdataproperty>' ).
        lo_record->create_property( 'ValueListProperty' )->create_simple_value( )->set_string( '<valuelistproperty>' ).
    
    
    "Optional: bind some additional export parameters
        lo_record = lo_collection->create_record( 'com.sap.vocabularies.Common.v1.ValueListParameterOut' ).
        lo_record->create_property( 'LocalDataProperty' )->create_simple_value( )->set_property_path( '<localdataproperty>' ).
        lo_record->create_property( 'ValueListProperty' )->create_simple_value( )->set_string( '<valuelistproperty>' ).
    
    
    "Bind additional display parameters on the result list of the value help:
        lo_record = lo_collection->create_record( 'com.sap.vocabularies.Common.v1.ValueListParameterDisplayOnly' ).
        lo_record->create_property( 'ValueListProperty' )->create_simple_value( )->set_string( '<valuelistproperty>' ). " display attribute on F4

    Regards
    Gabriel

    Add comment
    10|10000 characters needed characters exceeded