cancel
Showing results for 
Search instead for 
Did you mean: 

SALV IDA Fuzzy Search Prerequisites?

sas3
Explorer
0 Kudos

I have been working on text search functionality of SALV IDA and just didn't get it in place. Although I referred the standard programs 'SALV_IDA_FUZZY_SEARCH' and 'SALV_IDA_FUZZY_SEARCH_REFRESH' but couldn't figure out the exact problem in my code when compared the execution logic. Is there a tweak which I'm missing out somewhere? Attached is my full code. main.txt top.txt methods.txt

**** Text Search

    "Check DB Capability for search
    DATA(lv_is_text_search_supported) =
      cl_salv_gui_table_ida=>db_capabilities( )->is_text_search_supported( ).

    IF lv_is_text_search_supported IS NOT INITIAL.
      "Search Columns on some columns
      DATA: lts_field_name TYPE if_salv_gui_types_ida=>yts_field_name.
      INSERT CONV #( 'TEXT' ) INTO TABLE lts_field_name.
      lo_salv_ida->text_search( )->set_search_scope( lts_field_name ).


      "Set Search Similarity
      lo_salv_ida->text_search( )->set_field_similarity(
                                   EXPORTING
                                     iv_field_similarity = '1.0'
                                   ).

      lo_salv_ida->text_search( )->set_search_term( |{ p_text }| ).

      lo_salv_ida->field_catalog( )->enable_text_search(
                                     EXPORTING
                                       iv_field_name = 'TEXT').

    ENDIF.

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

I assume that you are using a DB with search text capabilities cause you added SAP HANA as secondary tag.

Then the question is why set a similarity value of 1.0? That means that you require a 100% match.

Regards,
Florian

sas3
Explorer
0 Kudos

I tried changing the similarity value but no luck yet. In fact, I am passing a text which has a 100% match in the table. Technically I should get the single row back as a search result. Don't thing the similarity value causing problem. Any other thoughts perhaps?