The following lines contain the word 'select', 'insert', 'update' or 'delete':
# This procedure will be called from Subledger update program
# directly and from wrapper in this package.
#
# HISTORY
# 10-Jun-2002 Uday Moogala Bug 2468906 - Created.
# 11-Jul-2006 rseshadr Bug 5384550 - use GL# explicitly in queries
# against fnd_id_flex_structures
########################################################################*/
PROCEDURE validate_segments(
p_co_code IN gl_plcy_mst.co_code%TYPE,
p_acctg_unit_id IN gl_accu_mst.acctg_unit_id%TYPE,
p_acct_id IN gl_acct_mst.acct_id%TYPE,
p_acctg_unit_no IN gl_accu_mst.acctg_unit_no%TYPE,
p_acct_no IN gl_acct_mst.acct_no%TYPE,
p_create_combination IN VARCHAR2 DEFAULT 'N',
x_ccid OUT NOCOPY NUMBER,
x_concat_seg OUT NOCOPY VARCHAR2,
x_status OUT NOCOPY VARCHAR2,
x_errmsg OUT NOCOPY VARCHAR2
)
IS
--
-- Selecting delimiter from plcy mst and flex struct as there is a chance that delimiter
-- can be different at these two place. Using plcy delimiter to parse the concatenated
-- segments and flex struct delimiter to pass to FND cross-validation routine.
--
/**
* rs Bug 5384550 - use GL# explicitly
**/
CURSOR c_struct_dtls (p_co_code gl_plcy_mst.co_code%TYPE)
IS
SELECT
flex.application_id,
flex.id_flex_code,
flex.id_flex_num,
plcy.segment_delimiter,
flex.CONCATENATED_SEGMENT_DELIMITER,
sob.chart_of_accounts_id
FROM
fnd_id_flex_structures flex,
gl_sets_of_books sob,
gl_plcy_mst plcy
WHERE
flex.id_flex_num = sob.chart_of_accounts_id
AND sob.set_of_books_id = plcy.sob_id
AND plcy.co_code = p_co_code
AND flex.id_flex_code = 'GL#'
;
SELECT DISTINCT mst.acctg_unit_id, mst.acctg_unit_no -- Bug xxx
FROM gl_accu_mst mst, gl_accu_map map
WHERE mst.acctg_unit_id = map.acctg_unit_id
AND map.co_code = p_co_code
AND map.delete_mark = 0
AND mst.delete_mark = 0 ;
# Code Combination will be created only if dynamic inserts is ON.
#
# DEPENDENCIES
#
# USAGE
#
# HISTORY
# 10-Jun-2002 Uday Moogala Bug 2468906 - Created.
# 12-Nov-2002 Uday Moogala Bug xxx
# 1. changes to return proper error messages.
# 2. Calling parse_ccid routine only if p_create_acct = Y and
# ccid is valid.
########################################################################*/
PROCEDURE get_accu_acct_ids
(
p_co_code IN gl_plcy_mst.co_code%TYPE,
p_acctg_unit_no IN gl_accu_mst.acctg_unit_no%TYPE,
p_acct_no IN gl_acct_mst.acct_no%TYPE,
p_create_acct IN VARCHAR2 DEFAULT 'N',
x_acctg_unit_id OUT NOCOPY gl_accu_mst.acctg_unit_id%TYPE,
x_acct_id OUT NOCOPY gl_acct_mst.acct_id%TYPE,
x_ccid OUT NOCOPY NUMBER,
x_status OUT NOCOPY VARCHAR2,
x_errmsg OUT NOCOPY VARCHAR2
)
IS
l_errmsg VARCHAR2(4000);
* SELECT decode(p_create_acct, 'Y', 1, 0)
* INTO l_create_acct
* FROM dual;
SELECT
acct_no
FROM
gl_acct_mst
WHERE
acct_id = p_acct_id
AND co_code = p_co_code
;
SELECT
acctg_unit_no
FROM
gl_accu_mst
WHERE
acctg_unit_id = p_acctg_unit_id
AND co_code = p_co_code
;