Brief introduction to ABAP’s open SQL and hybrid commerce’s flexible search

Time:2020-3-13

In ABAP application, our application developer uses open SQL to access database. These open SQL will be converted into database provider specific SQL by database interface and then executed.

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

Enterprise search / simple search is also supported in CRM and C4C,

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

In fact, the implementation principle is to call an RFC to Trex server to get the query results.

Hybris has a similar function: flexiblesearch service

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

Flexiblesearch service uses a set of SQL syntax based language invented by hybris, similar to ABAP’s open SQL

Here’s an example:

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

select * from {Product} where {code} = ‘cris03’

This flexible search language is precompiled into a query statement similar to SQL statement syntax:
SELECT * FROM products item_t0 WHERE ( item_t0.p_code = ‘cris03’) AND (item_t0.TypePkString IN (?,?,?,?,?,?,?) )

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

The values of the variables represented by the seven question marks in the above statement can be found in execution statistics:

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

In fact, there are seven catalogs:

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

Search results, corresponding to two records:

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

These two records can also be searched in backoffice:

Brief introduction to ABAP's open SQL and hybrid commerce's flexible search

For more original articles on Jerry, please pay attention to the official account of “Wang Zixi”:
Brief introduction to ABAP's open SQL and hybrid commerce's flexible search