Ansicht
Dokumentation

ABENDISTANCE_FUNCTIONS - DISTANCE FUNCTIONS

ABENDISTANCE_FUNCTIONS - DISTANCE FUNCTIONS

TXBHW - Original Tax Base Amount in Local Currency   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

- distance

... distance( val1 = text1 val2 = text2 $[max = max$] ) ...

Effect

This built-in function returns the Levenshtein distance between two strings text1 and text2. This distance is the minimum number of insert, delete, and replace operations required to pass one string to another and hence reflects the similarity of the two strings. The return value has the type i.

max can be used to specify a positive value other than 0, that terminates the calculation of the Levenshtein distance if the distance is greater than max. The value max is then returned instead. max is a numeric expression position with type i. If the value of max is less than or equal to 0, an exception of the class CX_SY_STRG_PAR_VAL is raised. If max is not specified, the calculation is not terminated

Notes

  • The complexity of the function increases in line with the product of the lengths of the two strings. The calculation time can be limited by specifying max.
  • This function can typically be used to find those words in a word set that are most similar to a word entered in a search using the minimum editing space.

The result of the following function calls is 0, 1, and 3.

String Functions, distance

Exceptions

Catchable Exceptions

CX_SY_STRG_PAR_VAL

  • Cause: Value in max is less than or equal to 0.
    Runtime Error: STRG_ILLEGAL_PAR





BAL Application Log Documentation   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 2677 Date: 20240425 Time: 144801     sap01-206 ( 50 ms )