Build Expression (WHERE Clause) Page

Use the Build Expression (WHERE Clause) page to specify selection criteria that you want to use to select the SAP R/3 tables for which you want to extract metadata. You can use this page to specify the WHERE clause for an SQL query that you want to submit.
Because there are many tables in your SAP R/3 System, searching through all of them to find the tables you want to use can be a lengthy process. You can use the Build Expression (WHERE Clause) page to generate an SQL WHERE clause that is used to select tables. By doing this, you can generate a manageable list or subset of SAP R/3 tables by selecting only the tables that match your criteria.
If you used the Extract from R/3 wizard in SAS Management Console to pre-extract your SAP R/3 metadata to SAS data sets, here is the default query syntax:
SELECT *
  FROM R3LIB.tables
WHERE user-defined-where-clause;
The R3LIB represents the library into which you have extracted SAP R/3 metadata.
If you dynamically access the metadata in your SAP R/3 System rather than using pre-extracted metadata, here is the default query syntax:
SELECT DISTINCT P.tabname, P.tabclass, P.ddtext as tabtext
  FROM R3Eng.dd02l as P
  LEFT JOIN R3Eng.dd02t as G on P.tabname = G.tabname
  AND G.as4local = P.as4local AND G.ddlanguage='E'
WHERE (G.ddlanguage='E') 
  AND (P.tabclass='CLUSTER' OR P.tabclass='POOL'
    OR P.tabclass='TRANSP' OR P.tabclass='VIEW')
  AND WHERE user-defined-where-clause;
The Build Expression (WHERE Clause) page contains the following items:
Expression Text
specifies the SQL WHERE clause that you want to use to identify your selection criteria. You can type the WHERE clause in the Expression Text field. You can also use the syntax shortcuts toolbar, Functions tab, and the Data Sources tab to create your WHERE clause. The first time that you display this page, the default expression text displays in the Expression Text field. Each subsequent time that you display the page, the last valid expression or WHERE clause that was created and submitted displays in the Expression Text field.
syntax shortcuts toolbar
displays a list of buttons that you can use to insert operators, conditions, and punctuation marks rather than typing them in. Syntax shortcut buttons include the Boolean AND Operator button, Greater Than Or Equals Condition button, String Concatenation Operator button, and so on, as well as shortcut buttons for enclosing selected text in either quotation marks or parentheses.
Functions tab
displays all valid functions that you can use in your SQL WHERE clause. In the left pane of the tab, functions are grouped according to type of task. For example, all functions related to calculating financial data are included in the Financial function group. When you select a function group, all functions included in that group are listed in the right pane of the tab. When you select a specific function in the right pane, the function name and description displays at the bottom of the Functions tab. You can insert a function into your SQL WHERE clause by either double-clicking on the function in the right pane of the tab or by selecting the function in the right pane of the tab and then clicking Insert.
Data Sources Tab
displays all valid data sources that you can use in your SQL WHERE clause. You can insert a data source into your SQL WHERE clause by either double-clicking on the data source in the left pane of the tab or by selecting the data source in the left pane of the tab and then clicking Insert.
The Build Expression (WHERE Clause) page contains the following buttons:
Validate Syntax
validates the syntax of the SQL WHERE clause that you have written. When you click this button, the WHERE clause that currently displays in the Expression Text field is validated, and either a confirmation message or an error message displays. The syntax must be valid in the SAS SQL procedure.
Undo
reverses the previous changes to the expression in the Expression Text field.
Redo
repeats the changes that were reversed with the Undo button.
Insert
inserts the selected function or data source into the Expression Text field.