Skip to Content
avatar image
Former Member

SALV IDA Fuzzy Search Prerequisites?

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.
main.txt (2.2 kB)
top.txt (513 B)
methods.txt (14.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 08, 2017 at 09:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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?