- P_VALUESET: This is a required parameter and is used for passing the Value Set name.
- P_BINDS: this is an optional parameter. If you have defined your Value Set with bind variable in where clause, you can pass a value to the bind variable with this parameter. The Formula Function uses a predefined format for passing the value.
- P_FILTER: This is an optional parameter. With this parameter, we can pass additional filter condition. The Filter value is validated against the Value column Name of the Value Set. The function uses like condition to validate the value.
- P_ENABLE_CACHE: I don’t think this parameter is used anywhere in Fast Formula, so we can ignore this parameter.
The Value Set needs to have at a minimum - Table, ID and Value columns. The Formula Function, Get_Value_Set returns ID column value to the Fast Formula. The following Value Set is defined for returning Lookup Code for the lookup type, CMP_TCS_COLS_BNFTS.
Value Set: Bind variable are defined with the following format
In our example, the bind value is passed as ‘|=TYPE_CODE=’CMP_TCS_COLS_BNFTS’ ‘
- The first character, | defines the delimiter.
- The second character, = defines the assignment character.
- TYPE_CODE is the bind variable name from the Set Value and = is the assignment character.
- Finally we pass the value of the bind variables, ‘CMP_TCS_COLS_BNFTS’.
Value Set: With two bind variables, one is equi joint and other one is a like condition. Please note that the like condition is already defined within quotes.
In our example, ‘Meaning’ of the lookup is the value column Name. We pass the value ‘Company’ to filter the row.
As per our Value Set and bind values, we expect company contribution Lookup Code, ERC_CNTRB.
Hope the above examples helped you understand how a Formula and Value Set can be used to execute any SQL in Fast Formula.
/******************************
Name: CMP_PERSON_SELECTION
Type: Compensation Person Selection
Programer: Tilak
purpose: Do not process the people who where already process by
checking the period processed flag and row in person statement
**********************************/
INPUTS ARE CMP_IV_STMT_ID, CMP_IV_PERIOD_ID
ltem = ess_log_write('Entering CMP_PERSON_SELECTION' )
l_value = 'Y'
stmtprocessed = GET_VALUE_SET('TCS_STMT_PROCESSED')
ltem = ess_log_write('TCS_STMT_PROCESSED ' + stmtprocessed)
IF stmtprocessed = 'Y' then (
l_value = 'N'
)
ltem = ess_log_write('Leaving CMP_PERSON_SELECTION ' + l_value )
RETURN l_value
YouTube Video 20 Formula:
/******************************
Name: CMP_PERSON_SELECTION
Type: Compensation Person Selection
Programer: Tilak
purpose: Do not process the people who where already process by
checking the period processed flag and row in person statement
/******************************
Name: CMP_PERSON_SELECTION
Type: Compensation Person Selection
Programer: Tilak
purpose: Do not process the people who where already process by
checking the period processed flag and row in person statement
**********************************/
INPUTS ARE CMP_IV_STMT_ID, CMP_IV_PERIOD_ID
ltemp = ess_log_write(' Entering CMP_PERSON_SELECTION')
l_value = 'Y'
/* Calling valueSet */
/*
stmtprocessed = GET_VALUE_SET('TCS_PERSON_SELECTION')
*/
stmtperd = TO_CHAR(CMP_IV_PERIOD_ID)
ltemp = ess_log_write(' CMP_IV_STMT_PERD_ID: ' + stmtperd )
param = '|=STMTPERDID='|| stmtperd
ltemp = ess_log_write(' param ' + param)
stmtprocessed = GET_VALUE_SET('TCS_STMT_PROCESSED', param)
ltemp = ess_log_write(' TCS_PERSON_SELECTION: ' + stmtprocessed)
/* Validating result of value set */
If stmtprocessed = 'Y' Then (
l_value = 'N'
)
ltemp = ess_log_write(' Leaving CMP_PERSON_SELECTION: ' + l_value )
RETURN l_value
Youtube Video 21 Formula
/******************************
Name: CMP_PERSON_SELECTION
Type: Compensation Person Selection
Programer: Tilak
purpose: Do not process the people who where already process by
checking the period processed flag and row in person statement
**********************************/
INPUTS ARE CMP_IV_STMT_ID, CMP_IV_PERIOD_ID
ltem = ess_log_write('Entering CMP_PERSON_SELECTION' )
l_value = 'Y'
personid = get_context(PERSON_ID, -1)
perid = TO_CHAR(CMP_IV_PERIOD_ID)
ltem = ess_log_write('stmt id ' + to_char(CMP_IV_STMT_ID) )
ltem = ess_log_write('CMP_IV_PERIOD_ID ' + perid)
ltem = ess_log_write('person id ' + to_char(personid) )
param = '|=STMTPERDID='||perid
ltem = ess_log_write('param ' + param)
/* calling value set */
stmtprocessed = GET_VALUE_SET('TCS_PERSON_SELECTION',param )
ltem = ess_log_write('TCS_PERSON_SELECTION ' + stmtprocessed)
IF stmtprocessed = 'Y' then (
param = '|=STMTPERDID='||perid ||' |STMTID='|| TO_CHAR(CMP_IV_STMT_ID)||' |PERSON_ID='|| to_char(personid)
ltem = ess_log_write('param ' + param)
perperdid = GET_VALUE_SET('TCS_STMT_PROCESSED',param )
ltem = ess_log_write('perperdid ' + perperdid )
if perperdid != ' ' then (
l_value = 'N'
)
)
ltem = ess_log_write('Leaving CMP_PERSON_SELECTION ' + l_value )
RETURN l_value