Search This Blog

Thursday, January 10, 2013

EBS CP Parameters - small but useful stuff :)

Let's say you have 2 parameters in a EBS concurrent program (CP).

1 p_ledger_name
2. p_ledger_id

You want to set the value for the p_ledger_id based on the value choosen for p_ledger_name. You can do it this way.

SETP 1
=====
Set the p_ledger_name default parameter type = SQL Statement
SQL statement can be this which ensures the users get to choose only the ledgers they have access to.
select name from gl_ledgers where ledger_id = gl_access_set_security_pkg.get_default_ledger_id(:$PROFILES$.GL_ACCESS_SET_ID, 'R')

STEP 2
=====
p_ledger_id parameter should also be set as SQL Type and SQL can be as follows,
select gl_ledger_utils_pkg.get_ledger_id_of_short_name(:$FLEX$.GL_SRS_LEDGER_WITH_SETS_AND_ALCS_STORE_SHORT_NAME) FROM DUAL

Here GL_SRS_LEDGER_WITH_SETS_AND_ALCS_STORE_SHORT_NAME is the value set name of the p_ledger_name parameter (my first parameter). Now lets have a look at this Value Set.

This value set is a character type value set. Validation Type = Table. You can check the value set details by clicking Edit Information button.

STEP 3
=====
Save your CP and Test it. When you choose the ledger name in the first parameter, you will get the ledger id in the second parameter automatically. Cool!!

No comments:

Post a Comment