SAP Knowledge Base Article - Public

3734333 - EQ Parameter in a custom Query returns CP like results in querybyelements on variable-length string fields (absl)

Symptom

  • Custom query is not returning expected results.
  • Using selection parameter option "EQ" on a text field returns multiple records that match a pattern, as if "CP" (contains pattern) were used.
  • Query may end with a "timeout" error when unintended large result sets are returned.

Environment

  • SAP Business ByDesign
  • SAP Cloud for Customer 

Reproducing the Issue

  1. In this example we use an email activity with a custom BeforeSave event containing a custom query which searches for phone numbers which match exactly. 
  2. Open an email record in the system and switch to edit mode.
  3. Make a change and save to run a BeforeSave ABSL script that executes a QueryByElements.
  4. In the ABSL, build selection parameters similar to: BONameParams.Add(StringVariable, "I", "EQ", "user's phone");
  5. Execute the query. Observe that records with phone values containing parts of "user's phone" are returned, not only the exact match.

Cause

The data type of the searched attribute is STRING without a fixed length. For such text parameters, the Hana database converts the operator EQ (equals to) to CP (contains pattern), which leads to pattern-based matching. This is expected system behavior.

Resolution

This is expected behavior for variable-length STRING fields; no action is required. 

See Also

Keywords

querybyelements, selectionparams, eq operator, cp operator, contains pattern, equals, string field, variable length, text field, hana conversion, abs l, pdi query, phone field, exact match, timeout, performance, Custom Script, ABSL. Custom Query,  , KBA , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , Problem

Product

SAP Business ByDesign all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions