LIKE & ESCAPE Feature in SQL Cockpit

LIKE & ESCAPE Feature in SQL Cockpit

Should wildcard characters be part of the search term? What should I do?

The solution is very easy in our SQL Cockpit, LIKE statement must be told that for example ‘%‘ is understood as a simple character instead of wildcard character. This is done by placing a special character in front of it and specifying this character as an „ESCAPE character“ at the end of command.

Example

User wants to select the table line(s) which in DOKTEXT field are containing the 100% word.

The database table contains the following entries.

Using the LIKE addition with the pattern will have the following result, because the percent sign represents zero, one, or multiple characters in SQL.

The first and last percent signs indicate that before and after the string any content is possible. The middle percent sign is connected with the escape character ‚\‘ and is therefore part of the search string. This specification ‚\%‘ is to be understood as a character, because of ESCAPE ‘\’ addition.

Links

https://help.sap.com/doc/abapdocu_740_index_htm/7.40/en-US/abenwhere_logexp_like.htm

https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenwhere_logexp_like.htm

https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.00/en-US/20fa17f375191014a4d8d8cbfddfe340.html?q=LIKE

Domain Text Feature in SQL Cockpit

I don’t see the domain description in the result SQL statement screen? What should I do?
The solution is very easy in our SQL Cockpit, there is an user setting with which the user can see not only the fixed value, but the description of the value itself. There is no need to manual check the description, in case it exists it is displayed in the result screen.

Example
The “Business partner category“ domain contains the following values entries in the Value Range tab. In a simple standard SQL statement selection the description it is not displayed as a part of the selection query, so the user should manually check the value.

Executing a simple select statement with multiple parameters (Partner, Type) from “Business Partner: General Data I“ table.

Second column values comes from the first data element domain. The name of the new field is a generated value. It can be used also with the Column Header: “Fieldtext“ and “Show alias in header“ functionality from the user Personal Settings, which allows the user to customize the result list header name.

Personal Settings
On the SQL Cockpit main screen the Personal Settings button is highlighted.

If the user wants to use the Domain Text functionality must tick the “Add Domain Text” checkbox. It is saved permanently (after the system log off as well), in case of it is not needed anymore should be unchecked after the use.

Links
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenddic_domains.htm
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenddic_domains_sema.htm