SAP Function Modules

ADDR_FUZZY_SEARCH SAP Function module







ADDR_FUZZY_SEARCH is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ADDR_FUZZY_SEARCH into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SZAS
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ADDR_FUZZY_SEARCH - ADDR FUZZY SEARCH





CALL FUNCTION 'ADDR_FUZZY_SEARCH' "
  EXPORTING
*   dialog_allowed = 'X'        " t_boole       Flag: Dialog allowed
*   search_in_address_type_1 = SPACE  " t_boole  Flag: Search in type1 addresses
*   search_in_address_type_2 = SPACE  " t_boole  Flag: Search in type2 addresses
*   search_in_address_type_3 = SPACE  " t_boole  Flag: Search in type3 addresses
*   search_in_all_object_types = SPACE  " t_boole  Flag: Search in all object types
    t_search_fields =           " adsrchlist    Search Criteria
    t_object_types_for_search =   " adref_indx_tab  Object types to be searched
  IMPORTING
    t_search_result =           " adkey_indx_tab  Search Result
    number_of_hits =            " i             Number of Hits
    selected_address_key =      " adkey_indx
    selected_address_type =     " ad_adrtype
    index_incomplete =          " t_boole       Flag: Search index incomplete
    search_status =             " ad_dupstat
    t_object_types =            " adobjlist
    t_reference_table =         " szadr_addr_ref_read_tab
  EXCEPTIONS
    COMMUNICATION_ERROR = 1     "               Communication error, external index search not possible
    INTERNAL_ERROR = 2          "               Internal error, external index search not possible
    SEARCH_INCOMPLETE = 3       "               No search result, e.g. because of inaccurate search criteria
    PARAMETER_ERROR = 4         "
    .  "  ADDR_FUZZY_SEARCH

ABAP code example for Function Module ADDR_FUZZY_SEARCH





The ABAP code below is a full code listing to execute function module ADDR_FUZZY_SEARCH including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_t_search_result  TYPE ADKEY_INDX_TAB ,
ld_number_of_hits  TYPE I ,
ld_selected_address_key  TYPE ADKEY_INDX ,
ld_selected_address_type  TYPE AD_ADRTYPE ,
ld_index_incomplete  TYPE T_BOOLE ,
ld_search_status  TYPE AD_DUPSTAT ,
ld_t_object_types  TYPE ADOBJLIST ,
ld_t_reference_table  TYPE SZADR_ADDR_REF_READ_TAB .

DATA(ld_dialog_allowed) = 'Check type of data required'.
DATA(ld_search_in_address_type_1) = 'Check type of data required'.
DATA(ld_search_in_address_type_2) = 'Check type of data required'.
DATA(ld_search_in_address_type_3) = 'Check type of data required'.
DATA(ld_search_in_all_object_types) = 'Check type of data required'.
DATA(ld_t_search_fields) = 'Check type of data required'.
DATA(ld_t_object_types_for_search) = 'Check type of data required'. . CALL FUNCTION 'ADDR_FUZZY_SEARCH' EXPORTING * dialog_allowed = ld_dialog_allowed * search_in_address_type_1 = ld_search_in_address_type_1 * search_in_address_type_2 = ld_search_in_address_type_2 * search_in_address_type_3 = ld_search_in_address_type_3 * search_in_all_object_types = ld_search_in_all_object_types t_search_fields = ld_t_search_fields t_object_types_for_search = ld_t_object_types_for_search IMPORTING t_search_result = ld_t_search_result number_of_hits = ld_number_of_hits selected_address_key = ld_selected_address_key selected_address_type = ld_selected_address_type index_incomplete = ld_index_incomplete search_status = ld_search_status t_object_types = ld_t_object_types t_reference_table = ld_t_reference_table EXCEPTIONS COMMUNICATION_ERROR = 1 INTERNAL_ERROR = 2 SEARCH_INCOMPLETE = 3 PARAMETER_ERROR = 4 . " ADDR_FUZZY_SEARCH
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_t_search_result  TYPE ADKEY_INDX_TAB ,
ld_dialog_allowed  TYPE T_BOOLE ,
ld_number_of_hits  TYPE I ,
ld_search_in_address_type_1  TYPE T_BOOLE ,
ld_selected_address_key  TYPE ADKEY_INDX ,
ld_search_in_address_type_2  TYPE T_BOOLE ,
ld_selected_address_type  TYPE AD_ADRTYPE ,
ld_search_in_address_type_3  TYPE T_BOOLE ,
ld_index_incomplete  TYPE T_BOOLE ,
ld_search_in_all_object_types  TYPE T_BOOLE ,
ld_search_status  TYPE AD_DUPSTAT ,
ld_t_search_fields  TYPE ADSRCHLIST ,
ld_t_object_types  TYPE ADOBJLIST ,
ld_t_object_types_for_search  TYPE ADREF_INDX_TAB ,
ld_t_reference_table  TYPE SZADR_ADDR_REF_READ_TAB .

ld_dialog_allowed = 'Check type of data required'.
ld_search_in_address_type_1 = 'Check type of data required'.
ld_search_in_address_type_2 = 'Check type of data required'.
ld_search_in_address_type_3 = 'Check type of data required'.
ld_search_in_all_object_types = 'Check type of data required'.
ld_t_search_fields = 'Check type of data required'.
ld_t_object_types_for_search = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ADDR_FUZZY_SEARCH or its description.