The following lines contain the word 'select', 'insert', 'update' or 'delete':
DELETE FROM XLA_AE_HEADERS_GT;
DELETE FROM XLA_AE_LINES_GT;
DELETE FROM XLA_VALIDATION_HDRS_GT;
DELETE FROM XLA_VALIDATION_LINES_GT;
DELETE FROM XLA_BAL_CTRL_CTRBS_GT;
DELETE FROM XLA_BAL_PERIOD_STATS_GT;
DELETE FROM XLA_BAL_RECREATE_GT;
DELETE FROM XLA_BAL_ANACRI_LINES_GT;
DELETE FROM XLA_BAL_ANACRI_CTRBS_GT;
DELETE FROM XLA_BAL_SYNCHRONIZE_GT;
DELETE FROM XLA_BAL_STATUSES_GT;
DELETE FROM XLA_BAL_CTRL_LINES_GT;
DELETE FROM XLA_EVENTS_GT;
DELETE FROM XLA_EVT_CLASS_SOURCES_GT;
DELETE FROM XLA_EVT_CLASS_ORDERS_GT;
DELETE FROM XLA_TAB_ERRORS_GT;
DELETE FROM XLA_SEQ_JE_HEADERS_GT;
DELETE FROM XLA_TAB_NEW_CCIDS_GT;
DELETE FROM XLA_EXTRACT_OBJECTS_GT;
DELETE FROM XLA_REFERENCE_OBJECTS_GT;
DELETE FROM XLA_TRANSACTION_ACCTS_GT;
DELETE FROM XLA_UPG_LINE_CRITERIA_GT;
DELETE FROM XLA_TRIAL_BALANCES_GT;
DELETE FROM XLA_ACCT_PROG_EVENTS_GT;
DELETE FROM XLA_ACCT_PROG_DOCS_GT;
DELETE FROM XLA_MERGE_SEG_MAPS_GT;
DELETE FROM XLA_EVENTS_INT_GT;
DELETE FROM XLA_REPORT_BALANCES_GT;
DELETE FROM XLA_TB_BALANCES_GT;
DELETE FROM XLA_BAL_AC_CTRBS_GT;
24 , --COST_UPDATE
27 ) --RECEIPT
THEN
-- If Action ID is outside this range no custom inv txn allowed
-- hence always in the standard list
x_list_result := 'Y';
SELECT NVL(PA_POSTING_FLAG, 'N')
INTO l_pjm_blueprint
FROM PJM_ORG_PARAMETERS
WHERE ORGANIZATION_ID = p_trx_info.inv_organization_id;
SELECT
EVENT_TYPE_CODE
INTO
l_event_type_code
FROM
CST_XLA_RCV_EVENT_MAP
WHERE TRANSACTION_TYPE_ID = p_trx_info.ACCT_EVENT_TYPE_ID
AND ATTRIBUTE = p_trx_info.ATTRIBUTE;
SELECT
EVENT_TYPE_CODE
INTO
l_event_type_code
FROM
CST_XLA_RCV_EVENT_MAP
WHERE TRANSACTION_TYPE_ID = p_trx_info.ACCT_EVENT_TYPE_ID
AND ATTRIBUTE is NULL;
INSERT into XLA_ACCT_PROG_EVENTS_GT (Event_Id) VALUES (l_event_id);
- Insert this event into PSA_BC_XLA_EVENTS_GT
- Call the Budgetary Control API to create the BC accounting entries */
/* For the DELIVER and RTR events, we do not have the encumbrance amount populated in
* RRS. This information is populated against the ENCUMBRANCE_REVERSAL event.
* For the ENCUMBRANCE_REVERSAL event, the event that created this encumbrance
* reversal is the event type that is created in SLA. This event is created
* with a BUDGETARY_CONTROL_FLAG = 'Y' to distinguish it
* The accounting for this BC event is done by PSA through the BC API
* Note accounting_event_type_id = 13 mains "Encumbrance Reversal" */
IF ( p_trx_info.ENCUMBRANCE_FLAG = 'Y' AND p_trx_info.ACCT_EVENT_TYPE_ID = 13 ) THEN
l_stmt_num := 45;
SELECT ACCOUNTING_EVENT_ID,
EVENT_TYPE_ID
INTO l_source_data.SOURCE_ID_INT_2,
l_event_type_id
FROM RCV_ACCOUNTING_EVENTS
WHERE RCV_TRANSACTION_ID = p_trx_info.TRANSACTION_ID
AND EVENT_TYPE_ID in (2, 3, 5);
SELECT nvl(PARENT_TRANSACTION_ID, -1)
INTO l_parent_rcv_txn_id
FROM RCV_TRANSACTIONS
WHERE transaction_id = p_trx_info.TRANSACTION_ID;
SELECT TRANSACTION_TYPE
INTO l_parent_txn_type
FROM RCV_TRANSACTIONS
WHERE transaction_id = l_parent_rcv_txn_id;
SELECT event_type_code
INTO l_event_type_code
FROM CST_XLA_RCV_EVENT_MAP
WHERE transaction_type_id = l_event_type_id
AND attribute = l_parent_txn_type;
DELETE PSA_BC_XLA_EVENTS_GT;
INSERT INTO PSA_BC_XLA_EVENTS_GT (
EVENT_ID,
RESULT_CODE )
VALUES (
l_bc_event_id,
'UNPROCESSED' );
SELECT count(*)
INTO l_mta_exists
FROM MTL_TRANSACTION_ACCOUNTS
WHERE TRANSACTION_ID = p_trx_info.transaction_id
AND rownum=1;
SELECT NVL(PA_POSTING_FLAG, 'N')
INTO l_pjm_blueprint
FROM PJM_ORG_PARAMETERS
WHERE ORGANIZATION_ID = p_trx_info.txn_organization_id
AND EXISTS ( SELECT 'X'
FROM MTL_MATERIAL_TRANSACTIONS MMT
WHERE MMT.TRANSACTION_ID = p_trx_info.transaction_id
AND ( (NVL(MMT.LOGICAL_TRANSACTION,2) = 2)
OR( (NVL(MMT.LOGICAL_TRANSACTION,2) = 1)
AND MMT.TRANSACTION_TYPE_ID = 19
AND MMT.TRANSACTION_ACTION_ID = 26
AND MMT.TRANSACTION_SOURCE_TYPE_ID = 1
AND NVL(MMT.LOGICAL_TRX_TYPE_CODE,5) = 2
AND EXISTS ( SELECT 'X'
FROM rcv_transactions rt
WHERE rt.transaction_id =
mmt.rcv_transaction_id
AND rt.organization_id =
p_trx_info.txn_organization_id
)
)
)
);
SELECT DECODE( EVENT_TYPE, 3, G_COGS_REC_EVENT, G_COGS_REC_ADJ_EVENT)
INTO l_events(1).event_type_code
FROM CST_COGS_EVENTS
WHERE MMT_TRANSACTION_ID = p_trx_info.transaction_id;
SELECT nvl(process_enabled_flag, 'N')
INTO l_txfr_process_flag
FROM MTL_PARAMETERS
WHERE organization_id = p_trx_info.txfr_organization_id;
SELECT p_trx_info.transaction_id,
decode(organization, 'TRANSFER', p_trx_info.txfr_organization_id,
p_trx_info.txn_organization_id ),
-- Leave this transaction src type ID to initial in source_id_int_3
nvl( p_trx_info.txn_src_type_id, -1),
event_type_code
BULK COLLECT INTO l_events
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND ( ( transaction_source_type_id = l_txn_src_type_id ) --p_trx_info.txn_src_type_id
/* Added following OR condition for Bug6792259 */
OR (l_txn_src_type_id = 8 AND transaction_source_type_id = 7)
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
)
AND ( ( p_trx_info.tp is null and tp = 'N' ) or
( p_trx_info.tp is not null and tp = p_trx_info.tp ) )
AND NOT (organization = 'SAME' AND transfer_type = 'RCPT');
SELECT p_trx_info.transaction_id,
p_trx_info.txn_organization_id,
--Leave this value in source_id_int_3
nvl( p_trx_info.txn_src_type_id, -1),
event_type_code
INTO
l_events(1).transaction_id,
l_events(1).organization_id,
l_events(1).txn_src_type_id,
l_events(1).event_type_code
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND transfer_type = DECODE(SIGN(p_trx_info.primary_quantity),-1,'SHIP','RCPT')
AND ( ( transaction_source_type_id = l_txn_src_type_id ) --p_trx_info.txn_src_type_id
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
)
AND organization = p_trx_info.attribute
AND ( ( p_trx_info.tp is null and tp = 'N' ) or
( p_trx_info.tp is not null and tp = p_trx_info.tp ) );
SELECT p_trx_info.transaction_id,
p_trx_info.txn_organization_id,
nvl ( p_trx_info.txn_src_type_id, -1),
event_type_code
INTO
l_events(1).transaction_id,
l_events(1).organization_id,
l_events(1).txn_src_type_id,
l_events(1).event_type_code
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
)
AND attribute = p_trx_info.attribute;
SELECT nvl(process_enabled_flag, 'N')
INTO l_txfr_process_flag
FROM MTL_PARAMETERS
WHERE organization_id = p_trx_info.txfr_organization_id;
SELECT p_trx_info.transaction_id,
decode(organization, 'TRANSFER', p_trx_info.txfr_organization_id,
p_trx_info.txn_organization_id ),
nvl( p_trx_info.txn_src_type_id, -1),
event_type_code
BULK COLLECT INTO l_events
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id )
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
)
AND fob_point = p_trx_info.fob_point
AND ( tp is null or ( tp is not null and tp = p_trx_info.tp ));
SELECT p_trx_info.transaction_id,
p_trx_info.txn_organization_id,
nvl( p_trx_info.txn_src_type_id, -1),
event_type_code
INTO l_events(1).transaction_id,
l_events(1).organization_id,
l_events(1).txn_src_type_id,
l_events(1).event_type_code
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id )
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
)
AND fob_point = p_trx_info.fob_point
AND ( tp is null or ( tp is not null and tp = p_trx_info.tp ))
AND organization = 'SAME';
SELECT p_trx_info.transaction_id,
p_trx_info.txn_organization_id,
nvl( p_trx_info.txn_src_type_id, -1),
event_type_code
INTO l_events(1).transaction_id,
l_events(1).organization_id,
l_events(1).txn_src_type_id,
l_events(1).event_type_code
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND ( ( transaction_source_type_id = p_trx_info.txn_src_type_id )
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
)
AND ( tp is null or ( tp is not null and tp = p_trx_info.tp ));
SELECT p_trx_info.transaction_id,
p_trx_info.txn_organization_id,
nvl( p_trx_info.txn_src_type_id, -1),
event_type_code
INTO l_events(1).transaction_id,
l_events(1).organization_id,
l_events(1).txn_src_type_id,
l_events(1).event_type_code
FROM cst_xla_inv_event_map
WHERE transaction_action_id = p_trx_info.txn_action_id
AND attribute is null
AND ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id )
OR( transaction_source_type_id is null
AND NOT EXISTS (
SELECT 1
FROM cst_xla_inv_event_map
WHERE transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
AND transaction_action_id = p_trx_info.txn_action_id )
)
);
Inserts are done into the table in the following loop */
l_stmt_num := 115;
DELETE PSA_BC_XLA_EVENTS_GT;
SELECT
ledger_id,
operating_unit
INTO
l_source_data.ledger_id,
l_security_data.security_id_int_2
FROM CST_ACCT_INFO_V
WHERE organization_id = l_events(l_index).ORGANIZATION_ID;
- Insert these events into PSA_BC_XLA_EVENTS_GT */
IF ( P_TRX_INFO.ENCUMBRANCE_FLAG = 'Y')
--{BUG#6125007
AND l_events(l_index).event_type_code IN
(
---------------------------
-- Class DIR_INTERORG_RCPT
---------------------------
'DIR_INTERORG_RCPT' ,'DIR_INTERORG_RCPT_NO_TP' ,'DIR_INTERORG_RCPT_TP',
---------------------------
-- Class PURCHASE_ORDER
---------------------------
'LOG_PO_DEL_ADJ','LOG_PO_DEL_INV','LOG_RET_RI_INV',
'PO_DEL_ADJ' ,'PO_DEL_INV' ,'RET_RI_INV' ,
---------------------------
-- Class FOB_RCPT_RECIPIENT_RCPT
---------------------------
'FOB_RCPT_RECIPIENT_RCPT_NO_TP','FOB_RCPT_RECIPIENT_RCPT_TP',
---------------------------
-- Class FOB_SHIP_SENDER_SHIP
---------------------------
'FOB_SHIP_SENDER_SHIP_NO_TP' ,'FOB_SHIP_SENDER_SHIP_TP' ,
-----------------------------------
--6611359 Internal order to expense
-----------------------------------
'EXP_REQ_RCPT_NO_TP','EXP_REQ_RCPT_TP',
'INT_ORDER_ISSUE_NO_TP','INT_ORDER_ISSUE_TP')
--}
THEN
--BUG#6125007
IF l_psa_ins_flag = 'N' THEN
l_psa_ins_flag := 'Y';
INSERT INTO PSA_BC_XLA_EVENTS_GT (
EVENT_ID,
RESULT_CODE )
VALUES (
l_bc_event_id,
'UNPROCESSED' );
SELECT NVL(PA_POSTING_FLAG, 'N')
INTO l_pjm_blueprint
FROM PJM_ORG_PARAMETERS
WHERE ORGANIZATION_ID = p_trx_info.inv_organization_id;
SELECT
ledger_id,
operating_unit
INTO
l_source_data.ledger_id,
l_security_data.security_id_int_2
FROM CST_ACCT_INFO_V
WHERE organization_id = p_trx_info.INV_ORGANIZATION_ID;
SELECT
EVENT_TYPE_CODE
INTO
l_event_type_code
FROM
CST_XLA_WIP_EVENT_MAP
WHERE TRANSACTION_TYPE_ID = p_trx_info.TXN_TYPE_ID
AND ATTRIBUTE = p_trx_info.ATTRIBUTE;
SELECT
EVENT_TYPE_CODE
INTO
l_event_type_code
FROM
CST_XLA_WIP_EVENT_MAP
WHERE TRANSACTION_TYPE_ID = p_trx_info.TXN_TYPE_ID
AND ATTRIBUTE IS NULL;
SELECT NVL(PA_POSTING_FLAG, 'N')
INTO l_pjm_blueprint
FROM PJM_ORG_PARAMETERS
WHERE ORGANIZATION_ID = p_organization_id;
SELECT ledger_id,
operating_unit
INTO l_ledger_id,
l_operating_unit
FROM CST_ACCT_INFO_V
WHERE ORGANIZATION_ID = p_organization_id;
DELETE XLA_EVENTS_INT_GT;
INSERT INTO xla_events_int_gt(
application_id,
ledger_id,
entity_code,
source_id_int_1,
source_id_int_2,
source_id_int_3,
transaction_number,
event_class_code,
event_type_code,
event_date,
event_status_code,
security_id_int_1,
security_id_int_2,
transaction_date,
reference_date_1
)
SELECT DISTINCT
G_CST_APPLICATION_ID,
l_ledger_id,
'WIP_ACCOUNTING_EVENTS',
WTA.TRANSACTION_ID,
WTA.RESOURCE_ID,
WTA.BASIS_TYPE,
WTA.TRANSACTION_ID,
'ABSORPTION',
DECODE( WTA.COST_ELEMENT_ID, 3, G_RES_ABS_EVENT,
4, DECODE (WCTI.SOURCE_CODE, 'IPV',
G_IPV_TRANSFER_EVENT,
DECODE(WCTI.AUTOCHARGE_TYPE, 3, G_OSP_EVENT,
4, G_OSP_EVENT, G_RES_ABS_EVENT)),
5, G_OVH_ABS_EVENT ),
WCTI.TRANSACTION_DATE,
XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
WCTI.ORGANIZATION_ID,
l_operating_unit,
WCTI.TRANSACTION_DATE,
INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
WCTI.TRANSACTION_DATE,
l_operating_unit)
FROM
WIP_TRANSACTION_ACCOUNTS WTA,
WIP_COST_TXN_INTERFACE WCTI
WHERE
WCTI.TRANSACTION_ID = WTA.TRANSACTION_ID
AND WCTI.GROUP_ID = p_wcti_group_id
AND WCTI.TRANSACTION_TYPE in (1, 2, 3)
UNION ALL
SELECT
G_CST_APPLICATION_ID,
l_ledger_id,
'WIP_ACCOUNTING_EVENTS',
WCTI.TRANSACTION_ID,
-1,
NVL(WCTI.BASIS_TYPE, -1),
WCTI.TRANSACTION_ID,
CXWEM.EVENT_CLASS_CODE,
CXWEM.EVENT_TYPE_CODE,
WCTI.TRANSACTION_DATE,
XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
WCTI.ORGANIZATION_ID,
l_operating_unit,
WCTI.TRANSACTION_DATE,
INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
WCTI.TRANSACTION_DATE,
l_operating_unit)
FROM
WIP_COST_TXN_INTERFACE WCTI,
CST_XLA_WIP_EVENT_MAP CXWEM
WHERE
WCTI.GROUP_ID = p_wcti_group_id
AND WCTI.TRANSACTION_TYPE = CXWEM.TRANSACTION_TYPE_ID
AND WCTI.TRANSACTION_TYPE in (5, 6, 17)
--{BUG#6916164
AND EXISTS (SELECT NULL
FROM WIP_TRANSACTION_ACCOUNTS WTA
WHERE wta.transaction_id = WCTI.TRANSACTION_ID);
PROCEDURE Create_CostUpdateXLAEvent (
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2,
p_commit IN VARCHAR2,
p_validation_level IN NUMBER,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_update_id IN NUMBER,
p_organization_id IN NUMBER ) IS
l_api_name CONSTANT VARCHAR2(30) := 'Create_CostUpdateXLAEvent';
SAVEPOINT Create_CostUpdateXLAEvent;
FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.begin' ,' Create_CostUpdateXLAEvent <<');
SELECT NVL(PA_POSTING_FLAG, 'N')
INTO l_pjm_blueprint
FROM PJM_ORG_PARAMETERS
WHERE ORGANIZATION_ID = p_organization_id;
FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_CostUpdateXLAEvent >>');
SELECT ledger_id,
operating_unit
INTO l_ledger_id,
l_operating_unit
FROM CST_ACCT_INFO_V
WHERE ORGANIZATION_ID = p_organization_id;
DELETE XLA_EVENTS_INT_GT;
INSERT INTO xla_events_int_gt
(
application_id,
ledger_id,
entity_code,
source_id_int_1,
source_id_int_2,
source_id_int_3,
transaction_number,
event_class_code,
event_type_code,
event_date,
event_status_code,
security_id_int_1,
security_id_int_2,
transaction_date,
reference_date_1
)
SELECT
G_CST_APPLICATION_ID,
l_ledger_id,
'MTL_ACCOUNTING_EVENTS',
mmt.TRANSACTION_ID, -- SOURCE_ID_INT_1
mmt.ORGANIZATION_id, -- SOURCE_ID_INT_2 (ORGANIZATION)
mmt.TRANSACTION_SOURCE_TYPE_ID,-- SOURCE_ID_INT_3 (TRANSACTION_SOURCE_TYPE_ID)
mmt.TRANSACTION_ID,
'MTL_COST_UPD',
'STD_COST_UPD',
mmt.TRANSACTION_DATE,
--{BUG#7505874
DECODE(mta.slid,NULL,XLA_EVENTS_PUB_PKG.C_EVENT_NOACTION, XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED),
--}
mmt.ORGANIZATION_ID,
l_operating_unit,
mmt.TRANSACTION_DATE,
INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
mmt.TRANSACTION_DATE,
l_operating_unit)
FROM
MTL_MATERIAL_TRANSACTIONS mmt
--{BUG#7505874
,(SELECT MAX(inv_sub_ledger_id) slid
,transaction_id trx_id
FROM mtl_transaction_accounts
GROUP BY transaction_id) mta
--}
WHERE
mmt.TRANSACTION_SOURCE_ID = p_update_id
AND mmt.TRANSACTION_TYPE_ID = 24
AND mmt.TRANSACTION_ACTION_ID = 24
AND mmt.TRANSACTION_SOURCE_TYPE_ID = 11
AND mmt.ORGANIZATION_ID = p_organization_id
AND mmt.transaction_id = mta.trx_id(+); --BUG#7505874
FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_CostUpdateXLAEvent >>');
ROLLBACK TO Create_CostUpdateXLAEvent;
ROLLBACK TO Create_CostUpdateXLAEvent;
ROLLBACK TO Create_CostUpdateXLAEvent;
FND_LOG.string(FND_LOG.LEVEL_UNEXPECTED, l_module||':'||l_stmt_num ,'Create_CostUpdateXLAEvent '||l_stmt_num||' : '||substr(SQLERRM,1,200));
END Create_CostUpdateXLAEvent;
PROCEDURE Create_WIPUpdateXLAEvent (
p_api_version IN NUMBER,
p_init_msg_list IN VARCHAR2,
p_commit IN VARCHAR2,
p_validation_level IN NUMBER,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2,
p_update_id IN NUMBER,
p_organization_id IN NUMBER ) IS
l_api_name CONSTANT VARCHAR2(30) := 'Create_WIPUpdateXLAEvent';
SAVEPOINT Create_WIPUpdateXLAEvent;
FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.begin' ,' Create_WIPUpdateXLAEvent <<');
SELECT NVL(PA_POSTING_FLAG, 'N')
INTO l_pjm_blueprint
FROM PJM_ORG_PARAMETERS
WHERE ORGANIZATION_ID = p_organization_id;
FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_WIPUpdateXLAEvent >>');
SELECT ledger_id,
operating_unit
INTO l_ledger_id,
l_operating_unit
FROM CST_ACCT_INFO_V
WHERE ORGANIZATION_ID = p_organization_id;
DELETE XLA_EVENTS_INT_GT;
INSERT INTO xla_events_int_gt
(
application_id,
ledger_id,
entity_code,
source_id_int_1,
source_id_int_2,
source_id_int_3,
transaction_number,
event_class_code,
event_type_code,
event_date,
event_status_code,
security_id_int_1,
security_id_int_2,
transaction_date,
reference_date_1
)
SELECT
G_CST_APPLICATION_ID,
l_ledger_id,
'WIP_ACCOUNTING_EVENTS',
TRANSACTION_ID, -- SOURCE_ID_INT_1
-1, -- SOURCE_ID_INT_2 (WIP_RESOURCE_ID)
-1, -- SOURCE_ID_INT_3 (WIP_BASIS_TYPE_ID)
TRANSACTION_ID,
'WIP_COST_UPD',
'WIP_COST_UPD',
TRANSACTION_DATE,
XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
organization_id,
l_operating_unit,
TRANSACTION_DATE,
INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
TRANSACTION_DATE,
l_operating_unit)
FROM
WIP_TRANSACTIONS
WHERE
COST_UPDATE_ID = p_update_id
AND ORGANIZATION_ID = p_organization_id;
FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_WIPUpdateXLAEvent >>');
ROLLBACK TO Create_WIPUpdateXLAEvent;
ROLLBACK TO Create_WIPUpdateXLAEvent;
ROLLBACK TO Create_WIPUpdateXLAEvent;
,'Create_WIPUpdateXLAEvent '||l_stmt_num||' : '||substr(SQLERRM,1,200));
END Create_WIPUpdateXLAEvent;
SELECT SUBSTRB(p.argument_text,
INSTRB(p.argument_text,',',1,32)+1,
INSTRB(p.argument_text,',',1,33)-INSTRB(p.argument_text,',',1,32)-1)
FROM fnd_concurrent_requests c,
fnd_concurrent_requests p
WHERE c.request_id = fnd_global.conc_request_id
AND c.parent_request_id = p.request_id;