The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT distinct fvbe.event_id,xlae.event_date
FROM fv_be_trx_dtls FVBE, xla_events XLAE
WHERE FVBE.doc_id = g_doc_id
AND FVBE.event_id = XLAE.event_id
AND FVBE.gl_date <> XLAE.event_date
AND FVBE.transaction_status <> 'AR'
AND fvbe.approval_date is null
UNION
SELECT distinct fvbe.event_id,xlae.event_date
FROM fv_be_rpr_transactions FVBE, xla_events XLAE
WHERE FVBE.transaction_id = g_doc_id
AND FVBE.event_id = XLAE.event_id
AND FVBE.gl_date <> XLAE.event_date
AND FVBE.transaction_status <> 'AR';
SELECT distinct fvbe.gl_date,fvbe.event_id
FROM fv_be_trx_dtls FVBE
WHERE FVBE.doc_id = g_doc_id
AND fvbe.approval_date is null
UNION
SELECT distinct fvbe.gl_date,fvbe.event_id
FROM fv_be_rpr_transactions FVBE
WHERE FVBE.transaction_id = g_doc_id;
l_entity_deleted INTEGER;
FV_UTILITY.DEBUG_MESG(G_LEVEL_PROCEDURE,l_module_name,'Call Delete_Event API');
'Check if event exists before deleteion for event:'||l_event_id);
FV_UTILITY.DEBUG_MESG(G_LEVEL_PROCEDURE,l_module_name,'Call Delete_Event API:'||l_event_id);
XLA_EVENTS_PUB_PKG.DELETE_EVENT
(p_event_source_info => l_event_source_info
,p_event_id => l_event_id
,p_valuation_method => NULL
,p_security_context => l_event_security_context);
FV_UTILITY.DEBUG_MESG(G_LEVEL_PROCEDURE,l_module_name,'Call Delete_Entity API:'||l_event_id);
l_entity_deleted := XLA_EVENTS_PUB_PKG.delete_entity
(p_source_info => l_event_source_info
,p_valuation_method => NULL
,p_security_context => l_event_security_context);
l_prepare_stmt := 'SELECT DOC_NUMBER FROM ';
| This procedure is used to insert event into psa_bc_xla_events_gt table
|
| PRAMETERS:
| NULL
|
|
| KNOWN ISSUES:
|
| NOTES:
*===========================================================================*/
PROCEDURE populate_bc_events_tab
IS
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,'Begin Populate_BC_Events_Tab');
INSERT INTO psa_bc_xla_events_gt(event_id,result_code)
SELECT distinct event_id,'XLA_ERROR' FROM FV_BE_TRX_DTLS WHERE doc_id = g_doc_id
AND approval_date IS NULL;
INSERT INTO psa_bc_xla_events_gt(event_id,result_code)
SELECT distinct event_id,'XLA_ERROR' FROM FV_BE_RPR_TRANSACTIONS WHERE transaction_id = g_doc_id;
UPDATE FV_BE_TRX_DTLS
SET EVENT_ID = p_event_id
WHERE doc_id = g_doc_id
AND gl_date = g_accounting_date
AND approval_date IS NULL;
UPDATE FV_BE_RPR_TRANSACTIONS
SET EVENT_ID = p_event_id
WHERE transaction_id = g_doc_id
AND gl_date = g_accounting_date;
FND_FILE.PUT_LINE(FND_FILE.LOG,'Rows ->'||SQL%ROWCOUNT||' updated with event_id ->'||p_event_id);
| This procedure resets the event_id to null for deleted events.
|
| Parameters:
| IN
| p_event_id: Event ID
| KNOWN ISSUES:
|
| NOTES:
*===========================================================================*/
PROCEDURE reset_event(p_event_id XLA_EVENTS.EVENT_ID%TYPE)
IS
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,'Begin Reset_Event');
UPDATE FV_BE_TRX_DTLS
SET EVENT_ID = null
WHERE doc_id = g_doc_id
AND event_id = p_event_id;
UPDATE FV_BE_RPR_TRANSACTIONS
SET EVENT_ID = null
WHERE transaction_id = g_doc_id
AND event_id = p_event_id;
FND_FILE.PUT_LINE(FND_FILE.LOG,'Rows ->'||SQL%ROWCOUNT||' updated with null event_id ');