- 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
Hello,
ReplyDeleteWith reference to this post I created an Table Value Set as GET_LEMP_CODE having
From clause - HR_ALL_ORGANIZATION_UNITS_F
Value Column Name - ORGANIZATION_CODE
Where - LEGAL_ENTITY_ID = :{PARAMETER.LEGAL_ENTITY_ID}
In the FF I'm unable to get any value. please suggest what Im missing
Tried using the below
l_param = '|=LEGAL_ENTITY_ID=PER_ASG_LEGAL_ENTITY_ID'
l_le_code = GET_VALUE_SET('GET_LEMP_CODE', l_param)
====================================
l_param = '|=LEGAL_ENTITY_ID=300000034840956'
l_le_code = GET_VALUE_SET('GET_LEMP_CODE', l_param)
How to pass the LE ID from DBI. Even for hard coded value I'm unable to get any value.
Thanks,
Sankara K
Hello Sankara,
DeleteThe Get_Value_Set always return the ID Column value which seems missing while defining value set in application.
what is the ID column. please read my blog entirely :)
ReplyDeleteHi Tilak and Lakshmi,
ReplyDeleteI struck with an issue. I am unable to pass the inputs and get the value.Please find my below code and log messages for the same. Please guide me, if anything wrong with code...
ln_person_id = GET_CONTEXT (PERSON_ID, 0 )
ld_effective_date = GET_CONTEXT(EFFECTIVE_DATE,'4712/12/31 00:00:00' (DATE))
ln_cuurent_year=to_number(to_char(Get_context(EFFECTIVE_DATE, '1999/01/01 12:00:00' (date)),'YYYY')) - 1
ld_effective_date= to_date(to_char(ln_cuurent_year)+'/12/31')
L_LOG_DATA = ESS_LOG_WRITE('ln_person_id : '||to_char(ln_person_id))
L_LOG_DATA = ESS_LOG_WRITE('ld_effective_date : '||to_char(ld_effective_date))
l_param = '|=PERSON_ID=ln_person_id|EFF_DATE=ld_effective_date'
L_LOG_DATA = ESS_LOG_WRITE('Parameter Passed : '||l_param )
ln_sick_pln_id = GET_VALUE_SET('GET_SICK_PLAN_ID',l_param )
L_LOG_DATA = ESS_LOG_WRITE('value return : '||ln_sick_pln_id)
LOG MESSAGES:-
ln_assignment_id : 300000009180682
ln_person_id : 300000009180666
ld_effective_date : 2018-12-31T00:00:00.000Z
Parameter Passed : |=PERSON_ID=ln_person_id|EFF_DATE=ld_effective_date
value return :
The parameters are not passing any values... It's not working as a variables.
Very good blog.
ReplyDeleteLakshmi hats off to your knowledge.
Pleas can you help me ??
ReplyDeleteI need to use a lookup in the fast formula . How??
please let me know your sql
DeleteI need to get count on a column in Fast formula and i don't have any DBIs to get the count through while loop. How can we acheive this? Any idea?
ReplyDeleteI have not used any function yet, but I do not see any issue, why cant you use count(column_name) in ID and test your FF.
DeletePlease let us know the result.
Hi,Can we do a MIN in value column within a value set?
ReplyDeleteThanks in advance!
This comment has been removed by the author.
Deletethe images attached are not visible .
ReplyDeletesorry about that and thanks for letting me know. let me see how to fix it.
Deletethanks ...please fix it ASAP...
Deletetaken care. Let me know if you have any issues.
DeleteI Have requirement to fetch lookup value based on start date and end date of the lookup.I tried adding parameter for them in where clause but it is not working
ReplyDeleteHi
ReplyDeleteI have a requirement to pull the Requisition Approved Date by using hcm extract.But Requisition Approved date is not in DBI(Database Item group).so,i have called value set and fast formulae to pull the value set value.but i am unable to get the value for Req Approved date.the given below is fast formulae will i have write
Fast Formulae :
DEFAULT FOR DATA_ELEMENTS IS EMPTY_TEXT_TEXT
INPUTS ARE DATA_ELEMENT_CODE (TEXT), DATA_ELEMENTS (TEXT_TEXT) , l (TEXT_TEXT)
RULE_VALUE = ' '
l_num = add_rlog(100, 45,'entry the approved date')
if (DATA_ELEMENTS.EXISTS('Extracts_Requisition_Id')) then
(
l_REQUISITION_ID = DATA_ELEMENTS['Extracts_Requisition_Id']
RULE_VALUE = GET_VALUE_SET_VALUE('SM_GET_APPROVED_DATE','|=P_REQUISITION_ID='''||l_REQUISITION_ID||'''')
)
l_num = add_rlog(101, 45 ,'failed approved date ')
RETURN RULE_VALUE
please help on to this..
send a msg in ur mail, pls reply
DeleteSorry there was mistaken in my mail id venkatrambabu2016@gmail.com
Delete