Finally, you have the option to use SQL and its dynamic values to do a complex validation based on SQL, or use it to determine one of several Universal Functions to use.
First you need to create you SQL, which in most cases will have an IF/ELSE or a CASE/WHEN Structure (You can select such from the Common SQL combo box). In the SQL you can use the syntax $[$<ITEM>.<COLUMN>.<TYPE>] for dynamic values from items and $[<TABLE>.<FIELD>.<TYPE>] for data sources (Both work very similar to formatted searches).
NB. IF YOU USE AN ITEM THAT DOES NOT HAVE A COLUMN THEN SET THE COLUMN PART TO 0.
Types you can use:
Type
|
Description
|
0
|
As STRING
|
STRING
|
Treat as is
|
NUMBER
|
Convert to number
|
CURRENCY
|
Removes any Currency Indicators that might be and convert to a number
|
DATE
|
Converts to a data in format YYYY-MM-DD
|
Sample on Business Partner that does Universal Function OPT1 if BP is a Customer I, else OTP2:
IF($[$40.0.0]) = ‘C’
BEGIN
SELECT ‘OPTION1’ FOR BROWSE
END
ELSE
BEGIN
SELECT ‘OPTION2’ FOR BROWSE
END
You now have two values that your condition can output (The string “OPTION1” or “OPTION2”).
These can now be entered into the Condition Result Matrix where you decide what should happen for each result by assigning a Universal Function code
You do not need to provide a Condition result for all output your SQL can give… Just the ones you would like to react to…
You can use the result of the SQL condition result in the triggered Universal function by using the keywords.
- $[B1VALRESULT.STRING]
o To get the result as string
- $[B1VALRESULT.NUMBER]
o To get the result as a number. this will fail if the result is not a number
NB: PLEASE NOTE THAT THE CONDITION-RESULTS ARE CASE-SENSITIVE
NB: IN SAP HANA IT IS NOT POSSIBLE TO MAKE SQL IF/ELSE SENTENCES. INSTEAD USE THE SELECT CASE … FROM DUMMY SYNTAX
|