CREATE OR REPLACE PACKAGE bolinf.xxeq_inbound_auth_pkg AUTHID CURRENT_USER
AS
PROCEDURE update_dd_status (
errbuf OUT VARCHAR2
,retcode OUT NUMBER
,p_file_name IN VARCHAR2
);
END xxeq_inbound_auth_pkg;
/
CREATE OR REPLACE PACKAGE BODY bolinf.xxeq_inbound_auth_pkg
AS
/*********************************************************************************************************
Version |Name |Date |Change Description
---------------------------------------------------------------------------------------------------------
1.0 |Madhu Dhare |15-Jun-2014 |Initial Version for Italy Inbound Authorization Package for SEPA
*********************************************************************************************************/
PROCEDURE update_dd_status (
errbuf OUT VARCHAR2
,retcode OUT NUMBER
,p_file_name IN VARCHAR2
)
AS
---Local Variables Declaration
v_proxy_number VARCHAR2 (30) := NULL;
v_iban_number VARCHAR2 (30) := NULL;
v_acpt_result VARCHAR2 (30) := NULL;
v_reason_code VARCHAR2 (30) := NULL;
v_add_rej_info VARCHAR2 (100) := NULL;
v_dir_path VARCHAR2 (250) := NULL;
f_handle UTL_FILE.file_type;
v_line VARCHAR2 (2000);
v_1st_comma NUMBER;
v_2nd_comma NUMBER;
v_3rd_comma NUMBER;
v_4th_comma NUMBER;
v_5th_comma NUMBER;
v_user_name VARCHAR2 (240) := fnd_global.user_name;
v_file_name VARCHAR2 (100) := p_file_name;
v_error_desc VARCHAR2 (2000);
v_sqlcode VARCHAR2 (200);
v_rec_cnt NUMBER := 0;
v_updt_cnt NUMBER := 0;
v_attribute14 VARCHAR2 (30) := NULL;
v_abi VARCHAR2 (5) := NULL;
v_cab VARCHAR2 (5) := NULL;
v_conto VARCHAR2 (12) := NULL;
err_generic EXCEPTION;
err_empty_file EXCEPTION;
err_empty_file1 EXCEPTION;
separatore VARCHAR2 (120) := RPAD ('*'
,120
,'*'
);
l_bank_acct_uses_rec apps.hz_cust_acct_info_pub.bank_acct_uses_rec_type;
l_last_update_date DATE;
l_new_req NUMBER;
x_return_status VARCHAR2 (50);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
v_bank_account_num ap_bank_accounts_all.bank_account_num%TYPE;
v_bank_number ap_bank_branches.bank_number%TYPE;
v_bank_num ap_bank_branches.bank_num%TYPE;
v_customer_number ra_customers.customer_number%TYPE;
v_site_num hz_cust_site_uses_all.LOCATION%TYPE;
v_arbor_ba hz_cust_site_uses_all.attribute5%TYPE;
v_gfp_dd_status ap_bank_account_uses_all.attribute14%TYPE;
v_mismatch_reason VARCHAR2 (100);
CURSOR bank_acc_uses_cur (
v_proxy_number VARCHAR2
)
IS
SELECT abau.bank_account_uses_id
,abau.customer_id
,abau.customer_site_use_id
,abau.vendor_id
,abau.vendor_site_id
,abau.external_bank_account_id
,abau.start_date
,abau.end_date
,abau.primary_flag
,abau.last_update_date
,abau.attribute_category
,abau.attribute1
,abau.attribute2
,abau.attribute3
,abau.attribute4
,abau.attribute5
,abau.attribute6
,abau.attribute7
,abau.attribute8
,abau.attribute9
,abau.attribute10
,abau.attribute11
,abau.attribute12
,abau.attribute13
,abau.attribute14
,aba.bank_account_num
,abb.bank_number
,abb.bank_num
,rc.customer_number
,hcsu.LOCATION
,hcsu.attribute5 arbor_ba
FROM ra_customers rc
,hz_cust_acct_sites_all hcas
,hz_cust_site_uses_all hcsu
,ap_bank_account_uses_all abau
,ap_bank_accounts_all aba
,ap_bank_branches abb
WHERE hcas.cust_account_id = rc.customer_id
AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND hcsu.site_use_code = 'BILL_TO'
AND hcsu.status = 'A'
AND abau.customer_site_use_id = hcsu.site_use_id
AND abau.customer_id = rc.customer_id
AND NVL (abau.end_date, SYSDATE + 1) >= SYSDATE
AND aba.bank_account_id = abau.external_bank_account_id
AND abb.bank_branch_id = aba.bank_branch_id
AND abau.attribute6 = v_proxy_number
AND EXISTS (
SELECT 1
FROM ar_cust_receipt_methods_v acrm
,fnd_lookup_values flv1
WHERE acrm.customer_id = rc.customer_id
AND acrm.site_use_id = abau.customer_site_use_id
AND flv1.lookup_type = 'XXEQ_DIRECT_DEBIT_PAYMENT_MTH'
AND flv1.LANGUAGE = USERENV ('LANG')
AND flv1.enabled_flag = 'Y'
AND NVL (flv1.end_date_active, SYSDATE + 1) >= SYSDATE
AND flv1.lookup_code = acrm.receipt_method_name);
CURSOR log_msg_cur
IS
SELECT *
FROM xxeq_inb_auth_log
ORDER BY log_type
,rec_num
,dds_status;
CURSOR mismatch_msg_cur
IS
SELECT *
FROM xxeq_inb_auth_mismatch
ORDER BY rec_num;
BEGIN
-- derive file name
IF UPPER (v_user_name) = 'BPEL_INTERFACE' THEN
v_file_name := p_file_name;
ELSE
v_file_name := fnd_global.user_id || '-' || p_file_name;
END IF;
-- derive file dir
BEGIN
SELECT fnd_profile.VALUE ('XXEQ_FILE_UPLOAD_INCOMING_DIR')
INTO v_dir_path
FROM DUAL;
EXCEPTION
WHEN OTHERS THEN
v_error_desc := 'Unable to retrieve incoming file location ' || SQLERRM;
RAISE;
END;
fnd_file.put_line (fnd_file.LOG, 'File name : ' || v_file_name);
fnd_file.put_line (fnd_file.LOG, 'Directory path : ' || v_dir_path);
-- open file
BEGIN
f_handle := UTL_FILE.fopen (v_dir_path
,v_file_name
,'r'
);
EXCEPTION
WHEN OTHERS THEN
v_error_desc := 'Error in FOPEN instruction of the input file (' || v_file_name || ')';
RAISE;
END;
-- fetch record in loop
/* ----------------------------------------------------------
Looping and reading line using GET_LINE which will
raise NO_DATA_FOUND when last line is read and exit the loop.
---------------------------------------------------------- */
DELETE FROM xxeq_inb_auth_log;
DELETE FROM xxeq_inb_auth_mismatch;
COMMIT;
LOOP
BEGIN
BEGIN
UTL_FILE.get_line (f_handle, v_line);
v_rec_cnt := v_rec_cnt + 1;
v_proxy_number := NULL;
v_iban_number := NULL;
v_acpt_result := NULL;
v_reason_code := NULL;
v_add_rej_info := NULL;
v_dir_path := NULL;
v_1st_comma := NULL;
v_2nd_comma := NULL;
v_3rd_comma := NULL;
v_4th_comma := NULL;
v_5th_comma := NULL;
v_attribute14 := NULL;
v_abi := NULL;
v_cab := NULL;
v_conto := NULL;
EXCEPTION
WHEN NO_DATA_FOUND THEN
IF v_rec_cnt = 0 THEN
v_sqlcode := SQLCODE;
v_error_desc := v_file_name || ' is an empty file.';
RAISE err_empty_file;
END IF;
EXIT;
END;
-- separate different fields
/* ----------------------------------------------------------
Fields in the input record are delimited by commas.
Separating the fields from v_line and storing in variables.
---------------------------------------------------------- */
v_1st_comma := INSTR (v_line
,','
,1
,1
);
v_2nd_comma := INSTR (v_line
,','
,1
,2
);
v_3rd_comma := INSTR (v_line
,','
,1
,3
);
v_4th_comma := INSTR (v_line
,','
,1
,4
);
v_5th_comma := INSTR (v_line
,','
,1
,5
);
-- proxy = mandate ID
v_proxy_number := SUBSTR (v_line
,1
, v_1st_comma - 1
);
v_iban_number := SUBSTR (v_line
, v_1st_comma + 1
, v_2nd_comma - v_1st_comma - 1
);
v_acpt_result := SUBSTR (v_line
, v_2nd_comma + 1
, v_3rd_comma - v_2nd_comma - 1
);
v_reason_code := SUBSTR (v_line
, v_3rd_comma + 1
, v_4th_comma - v_3rd_comma - 1
);
v_add_rej_info := SUBSTR (v_line
, v_4th_comma + 1
, v_5th_comma - v_4th_comma - 1
);
-- validate above fields if NULL
IF v_proxy_number = NULL
OR v_iban_number = NULL
OR v_acpt_result = NULL
OR v_reason_code = NULL THEN
v_sqlcode := '';
v_error_desc := 'For record number ' || v_rec_cnt || ' either Proxy, IBAN, Acceptance Result or Reason Code is NULL';
RAISE err_generic;
END IF;
-- derive bank account attribute14
BEGIN
SELECT meaning
,description
INTO v_add_rej_info
,v_attribute14
FROM fnd_lookup_values
WHERE lookup_type = 'XXEQ_REJECTION_REASONS_SEPA'
AND lookup_code = v_reason_code
AND TRUNC (SYSDATE) BETWEEN TRUNC (start_date_active) AND NVL (TRUNC (end_date_active), TO_DATE ('31-DEC-4712', 'DD-MON-RRRR'))
AND enabled_flag = 'Y'
AND LANGUAGE = 'US';
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_sqlcode := SQLCODE;
v_error_desc := 'For record number ' || v_rec_cnt || ' Reason code ' || v_reason_code || ' is not present in lookup XXEQ_REJECTION_REASONS_SEPA';
RAISE err_generic;
WHEN OTHERS THEN
v_sqlcode := SQLCODE;
v_error_desc := 'For record number ' || v_rec_cnt || ' Unexpected error while fetching reason code details from lookup XXEQ_REJECTION_REASONS_SEPA ';
RAISE err_generic;
END;
-- derive ABI, CAB and CONTO from IBAN
v_abi := SUBSTR (v_iban_number
,6
,5
);
v_cab := SUBSTR (v_iban_number
,11
,5
);
v_conto := SUBSTR (v_iban_number
,16
,12
);
FOR c_bank_acc_uses IN bank_acc_uses_cur (v_proxy_number)
LOOP
-- derive mandatory fields to be passed to the API
l_bank_acct_uses_rec := NULL;
l_bank_acct_uses_rec.bank_account_uses_id := c_bank_acc_uses.bank_account_uses_id;
l_bank_acct_uses_rec.customer_id := c_bank_acc_uses.customer_id;
l_bank_acct_uses_rec.customer_site_use_id := c_bank_acc_uses.customer_site_use_id;
l_bank_acct_uses_rec.vendor_id := c_bank_acc_uses.vendor_id;
l_bank_acct_uses_rec.vendor_site_id := c_bank_acc_uses.vendor_site_id;
l_bank_acct_uses_rec.external_bank_account_id := c_bank_acc_uses.external_bank_account_id;
l_bank_acct_uses_rec.start_date := c_bank_acc_uses.start_date;
l_bank_acct_uses_rec.end_date := c_bank_acc_uses.end_date;
l_bank_acct_uses_rec.primary_flag := c_bank_acc_uses.primary_flag;
l_last_update_date := c_bank_acc_uses.last_update_date;
l_bank_acct_uses_rec.attribute_category := c_bank_acc_uses.attribute_category;
l_bank_acct_uses_rec.attribute1 := c_bank_acc_uses.attribute1;
l_bank_acct_uses_rec.attribute2 := c_bank_acc_uses.attribute2;
l_bank_acct_uses_rec.attribute3 := c_bank_acc_uses.attribute3;
l_bank_acct_uses_rec.attribute4 := c_bank_acc_uses.attribute4;
l_bank_acct_uses_rec.attribute5 := c_bank_acc_uses.attribute5;
l_bank_acct_uses_rec.attribute6 := c_bank_acc_uses.attribute6;
l_bank_acct_uses_rec.attribute7 := c_bank_acc_uses.attribute7;
l_bank_acct_uses_rec.attribute8 := c_bank_acc_uses.attribute8;
l_bank_acct_uses_rec.attribute9 := c_bank_acc_uses.attribute9;
l_bank_acct_uses_rec.attribute10 := c_bank_acc_uses.attribute10;
l_bank_acct_uses_rec.attribute11 := c_bank_acc_uses.attribute11;
l_bank_acct_uses_rec.attribute12 := c_bank_acc_uses.attribute12;
l_bank_acct_uses_rec.attribute13 := c_bank_acc_uses.attribute13;
l_bank_acct_uses_rec.attribute14 := c_bank_acc_uses.attribute14;
v_bank_account_num := c_bank_acc_uses.bank_account_num;
v_bank_number := c_bank_acc_uses.bank_number;
v_bank_num := c_bank_acc_uses.bank_num;
v_customer_number := c_bank_acc_uses.customer_number;
v_site_num := c_bank_acc_uses.LOCATION;
v_arbor_ba := c_bank_acc_uses.arbor_ba;
v_gfp_dd_status := c_bank_acc_uses.attribute14;
IF ( LTRIM (v_bank_account_num, '0') = LTRIM (v_conto, '0')
AND v_bank_number = v_abi
AND v_bank_num = v_cab)
OR (v_reason_code IN ('MD09', 'MD16')) THEN
-- update the bank account's attributes using API
BEGIN
l_bank_acct_uses_rec.attribute14 := v_attribute14;
l_bank_acct_uses_rec.attribute15 := TO_CHAR (SYSDATE, 'DD-MON-YYYY');
apps.hz_cust_acct_info_pub.update_bank_acct_uses (p_api_version => 1.0
,p_init_msg_list => apps.fnd_api.g_true
,p_commit => fnd_api.g_false
,p_bank_account_uses_rec => l_bank_acct_uses_rec
,p_last_update_date => l_last_update_date
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,p_validation_level => fnd_api.g_valid_level_full
);
IF x_return_status = fnd_api.g_ret_sts_success THEN
v_updt_cnt := v_updt_cnt + 1;
INSERT INTO xxeq_inb_auth_log
VALUES (1
,v_rec_cnt
,v_attribute14
, 'Cliente: ' || v_proxy_number || ' Direct Debit status updated to ' || v_attribute14 || ' : ' || v_add_rej_info
);
COMMIT;
ELSE
IF x_msg_count > 0 THEN
fnd_file.put_line (fnd_file.LOG, 'Update API FAILED ERROR(1), x_msg_data : ' || x_msg_data);
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
v_sqlcode := SUBSTR (SQLERRM
,1
,200
);
v_error_desc := 'Error in Bank Account Uses UPDATE API';
RAISE err_generic;
END;
ELSE
IF LTRIM (v_bank_account_num, '0') <> LTRIM (v_conto, '0') THEN
v_mismatch_reason := 'Conto is not matching';
END IF;
IF v_bank_number <> v_abi THEN
v_mismatch_reason := v_mismatch_reason || 'ABI is not matching';
END IF;
IF v_bank_num <> v_cab THEN
v_mismatch_reason := v_mismatch_reason || 'CAB is not matching';
END IF;
-- print log for other IBANs against that customer proxy
INSERT INTO xxeq_inb_auth_mismatch
VALUES (v_rec_cnt
,v_customer_number
,v_site_num
,v_arbor_ba
,v_proxy_number
,v_bank_number
,v_bank_num
,v_bank_account_num
,v_gfp_dd_status
,v_reason_code
,v_add_rej_info
,v_abi
,v_cab
,v_conto
,v_mismatch_reason
);
COMMIT;
END IF;
END LOOP;
fnd_file.put_line (fnd_file.output, separatore);
fnd_file.put_line (fnd_file.output, 'Successfully updated records ');
fnd_file.put_line (fnd_file.output, separatore);
FOR c_log_msg IN log_msg_cur
LOOP
fnd_file.put_line (fnd_file.output, c_log_msg.MESSAGE);
END LOOP;
fnd_file.put_line (fnd_file.output, separatore);
fnd_file.put_line (fnd_file.output, 'Records not updated due to Abi-Cab-Conto mismatch');
fnd_file.put_line (fnd_file.output, separatore);
fnd_file.put_line
(fnd_file.output
,'Customer Number Site Number Arbor Billing Account Proxy Number GFP ABI GFP CAB GFP CONTO Direct Debit Status Causale Causale-Description Response ABI Response CAB Response Conto Reason For Not Updating DDS');
fnd_file.put_line
(fnd_file.output
,'------------- -------------- -------------- -------------- ------------ ---------- -------------- -------------- ---------- -------------- -------------- -------------- -------------- --------------');
FOR c_mismatch_msg IN mismatch_msg_cur
LOOP
fnd_file.put_line (fnd_file.output
, c_mismatch_msg.customer_number
|| ' '
|| c_mismatch_msg.site_number
|| ' '
|| c_mismatch_msg.arbor_ba
|| ' '
|| c_mismatch_msg.proxy
|| ' '
|| c_mismatch_msg.gfp_abi
|| ' '
|| c_mismatch_msg.gfp_cab
|| ' '
|| c_mismatch_msg.gfp_conto
|| ' '
|| c_mismatch_msg.gfp_dd_status
|| ' '
|| c_mismatch_msg.resp_rej_code
|| ' '
|| c_mismatch_msg.resp_rej_desc
|| ' '
|| c_mismatch_msg.resp_abi
|| ' '
|| c_mismatch_msg.resp_cab
|| ' '
|| c_mismatch_msg.resp_conto
|| ' '
|| c_mismatch_msg.reason);
END LOOP;
EXCEPTION
WHEN err_generic THEN
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'SQLCode : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN err_empty_file THEN
RAISE err_empty_file1;
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || SQLERRM);
fnd_file.put_line (fnd_file.LOG, 'SQLCode: ' || SQLCODE);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
END;
END LOOP;
-- close file
BEGIN
UTL_FILE.fclose (f_handle);
fnd_file.put_line (fnd_file.LOG, 'Records read : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, 'Records updated : ' || v_updt_cnt);
fnd_file.put_line (fnd_file.LOG, 'Calling File Archive program');
l_new_req :=
fnd_request.submit_request ('XXEQ'
,'XXEQDDAARCH'
,' '
, SYSDATE + (1 / 8640)
,FALSE
,v_file_name
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
);
IF (l_new_req <> 0) THEN
fnd_file.put_line (fnd_file.LOG, 'Request_id: ' || l_new_req || ' submitted for file archive');
ELSE
fnd_file.put_line (fnd_file.LOG, 'Request not submitted for file archive');
END IF;
EXCEPTION
WHEN OTHERS THEN
v_error_desc := 'Error in instruction of the input file fclose(' || v_file_name || ')';
RAISE;
END;
EXCEPTION
WHEN err_empty_file1 THEN
retcode := 1;
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
WHEN UTL_FILE.invalid_path THEN
v_sqlcode := 'UTL_FILE.INVALID_PATH';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.invalid_operation THEN
v_sqlcode := 'UTL_FILE.INVALID_OPERATION';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.invalid_mode THEN
v_sqlcode := 'UTL_FILE.INVALID_MODE';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Messagr: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.invalid_filehandle THEN
v_sqlcode := 'UTL_FILE.INVALID_FILEHANDLE';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.read_error THEN
v_sqlcode := 'UTL_FILE.READ_ERROR';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || SQLERRM);
fnd_file.put_line (fnd_file.LOG, 'SQLCode: ' || SQLCODE);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
END update_dd_status;
END xxeq_inbound_auth_pkg;
/
AS
PROCEDURE update_dd_status (
errbuf OUT VARCHAR2
,retcode OUT NUMBER
,p_file_name IN VARCHAR2
);
END xxeq_inbound_auth_pkg;
/
CREATE OR REPLACE PACKAGE BODY bolinf.xxeq_inbound_auth_pkg
AS
/*********************************************************************************************************
Version |Name |Date |Change Description
---------------------------------------------------------------------------------------------------------
1.0 |Madhu Dhare |15-Jun-2014 |Initial Version for Italy Inbound Authorization Package for SEPA
*********************************************************************************************************/
PROCEDURE update_dd_status (
errbuf OUT VARCHAR2
,retcode OUT NUMBER
,p_file_name IN VARCHAR2
)
AS
---Local Variables Declaration
v_proxy_number VARCHAR2 (30) := NULL;
v_iban_number VARCHAR2 (30) := NULL;
v_acpt_result VARCHAR2 (30) := NULL;
v_reason_code VARCHAR2 (30) := NULL;
v_add_rej_info VARCHAR2 (100) := NULL;
v_dir_path VARCHAR2 (250) := NULL;
f_handle UTL_FILE.file_type;
v_line VARCHAR2 (2000);
v_1st_comma NUMBER;
v_2nd_comma NUMBER;
v_3rd_comma NUMBER;
v_4th_comma NUMBER;
v_5th_comma NUMBER;
v_user_name VARCHAR2 (240) := fnd_global.user_name;
v_file_name VARCHAR2 (100) := p_file_name;
v_error_desc VARCHAR2 (2000);
v_sqlcode VARCHAR2 (200);
v_rec_cnt NUMBER := 0;
v_updt_cnt NUMBER := 0;
v_attribute14 VARCHAR2 (30) := NULL;
v_abi VARCHAR2 (5) := NULL;
v_cab VARCHAR2 (5) := NULL;
v_conto VARCHAR2 (12) := NULL;
err_generic EXCEPTION;
err_empty_file EXCEPTION;
err_empty_file1 EXCEPTION;
separatore VARCHAR2 (120) := RPAD ('*'
,120
,'*'
);
l_bank_acct_uses_rec apps.hz_cust_acct_info_pub.bank_acct_uses_rec_type;
l_last_update_date DATE;
l_new_req NUMBER;
x_return_status VARCHAR2 (50);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
v_bank_account_num ap_bank_accounts_all.bank_account_num%TYPE;
v_bank_number ap_bank_branches.bank_number%TYPE;
v_bank_num ap_bank_branches.bank_num%TYPE;
v_customer_number ra_customers.customer_number%TYPE;
v_site_num hz_cust_site_uses_all.LOCATION%TYPE;
v_arbor_ba hz_cust_site_uses_all.attribute5%TYPE;
v_gfp_dd_status ap_bank_account_uses_all.attribute14%TYPE;
v_mismatch_reason VARCHAR2 (100);
CURSOR bank_acc_uses_cur (
v_proxy_number VARCHAR2
)
IS
SELECT abau.bank_account_uses_id
,abau.customer_id
,abau.customer_site_use_id
,abau.vendor_id
,abau.vendor_site_id
,abau.external_bank_account_id
,abau.start_date
,abau.end_date
,abau.primary_flag
,abau.last_update_date
,abau.attribute_category
,abau.attribute1
,abau.attribute2
,abau.attribute3
,abau.attribute4
,abau.attribute5
,abau.attribute6
,abau.attribute7
,abau.attribute8
,abau.attribute9
,abau.attribute10
,abau.attribute11
,abau.attribute12
,abau.attribute13
,abau.attribute14
,aba.bank_account_num
,abb.bank_number
,abb.bank_num
,rc.customer_number
,hcsu.LOCATION
,hcsu.attribute5 arbor_ba
FROM ra_customers rc
,hz_cust_acct_sites_all hcas
,hz_cust_site_uses_all hcsu
,ap_bank_account_uses_all abau
,ap_bank_accounts_all aba
,ap_bank_branches abb
WHERE hcas.cust_account_id = rc.customer_id
AND hcsu.cust_acct_site_id = hcas.cust_acct_site_id
AND hcsu.site_use_code = 'BILL_TO'
AND hcsu.status = 'A'
AND abau.customer_site_use_id = hcsu.site_use_id
AND abau.customer_id = rc.customer_id
AND NVL (abau.end_date, SYSDATE + 1) >= SYSDATE
AND aba.bank_account_id = abau.external_bank_account_id
AND abb.bank_branch_id = aba.bank_branch_id
AND abau.attribute6 = v_proxy_number
AND EXISTS (
SELECT 1
FROM ar_cust_receipt_methods_v acrm
,fnd_lookup_values flv1
WHERE acrm.customer_id = rc.customer_id
AND acrm.site_use_id = abau.customer_site_use_id
AND flv1.lookup_type = 'XXEQ_DIRECT_DEBIT_PAYMENT_MTH'
AND flv1.LANGUAGE = USERENV ('LANG')
AND flv1.enabled_flag = 'Y'
AND NVL (flv1.end_date_active, SYSDATE + 1) >= SYSDATE
AND flv1.lookup_code = acrm.receipt_method_name);
CURSOR log_msg_cur
IS
SELECT *
FROM xxeq_inb_auth_log
ORDER BY log_type
,rec_num
,dds_status;
CURSOR mismatch_msg_cur
IS
SELECT *
FROM xxeq_inb_auth_mismatch
ORDER BY rec_num;
BEGIN
-- derive file name
IF UPPER (v_user_name) = 'BPEL_INTERFACE' THEN
v_file_name := p_file_name;
ELSE
v_file_name := fnd_global.user_id || '-' || p_file_name;
END IF;
-- derive file dir
BEGIN
SELECT fnd_profile.VALUE ('XXEQ_FILE_UPLOAD_INCOMING_DIR')
INTO v_dir_path
FROM DUAL;
EXCEPTION
WHEN OTHERS THEN
v_error_desc := 'Unable to retrieve incoming file location ' || SQLERRM;
RAISE;
END;
fnd_file.put_line (fnd_file.LOG, 'File name : ' || v_file_name);
fnd_file.put_line (fnd_file.LOG, 'Directory path : ' || v_dir_path);
-- open file
BEGIN
f_handle := UTL_FILE.fopen (v_dir_path
,v_file_name
,'r'
);
EXCEPTION
WHEN OTHERS THEN
v_error_desc := 'Error in FOPEN instruction of the input file (' || v_file_name || ')';
RAISE;
END;
-- fetch record in loop
/* ----------------------------------------------------------
Looping and reading line using GET_LINE which will
raise NO_DATA_FOUND when last line is read and exit the loop.
---------------------------------------------------------- */
DELETE FROM xxeq_inb_auth_log;
DELETE FROM xxeq_inb_auth_mismatch;
COMMIT;
LOOP
BEGIN
BEGIN
UTL_FILE.get_line (f_handle, v_line);
v_rec_cnt := v_rec_cnt + 1;
v_proxy_number := NULL;
v_iban_number := NULL;
v_acpt_result := NULL;
v_reason_code := NULL;
v_add_rej_info := NULL;
v_dir_path := NULL;
v_1st_comma := NULL;
v_2nd_comma := NULL;
v_3rd_comma := NULL;
v_4th_comma := NULL;
v_5th_comma := NULL;
v_attribute14 := NULL;
v_abi := NULL;
v_cab := NULL;
v_conto := NULL;
EXCEPTION
WHEN NO_DATA_FOUND THEN
IF v_rec_cnt = 0 THEN
v_sqlcode := SQLCODE;
v_error_desc := v_file_name || ' is an empty file.';
RAISE err_empty_file;
END IF;
EXIT;
END;
-- separate different fields
/* ----------------------------------------------------------
Fields in the input record are delimited by commas.
Separating the fields from v_line and storing in variables.
---------------------------------------------------------- */
v_1st_comma := INSTR (v_line
,','
,1
,1
);
v_2nd_comma := INSTR (v_line
,','
,1
,2
);
v_3rd_comma := INSTR (v_line
,','
,1
,3
);
v_4th_comma := INSTR (v_line
,','
,1
,4
);
v_5th_comma := INSTR (v_line
,','
,1
,5
);
-- proxy = mandate ID
v_proxy_number := SUBSTR (v_line
,1
, v_1st_comma - 1
);
v_iban_number := SUBSTR (v_line
, v_1st_comma + 1
, v_2nd_comma - v_1st_comma - 1
);
v_acpt_result := SUBSTR (v_line
, v_2nd_comma + 1
, v_3rd_comma - v_2nd_comma - 1
);
v_reason_code := SUBSTR (v_line
, v_3rd_comma + 1
, v_4th_comma - v_3rd_comma - 1
);
v_add_rej_info := SUBSTR (v_line
, v_4th_comma + 1
, v_5th_comma - v_4th_comma - 1
);
-- validate above fields if NULL
IF v_proxy_number = NULL
OR v_iban_number = NULL
OR v_acpt_result = NULL
OR v_reason_code = NULL THEN
v_sqlcode := '';
v_error_desc := 'For record number ' || v_rec_cnt || ' either Proxy, IBAN, Acceptance Result or Reason Code is NULL';
RAISE err_generic;
END IF;
-- derive bank account attribute14
BEGIN
SELECT meaning
,description
INTO v_add_rej_info
,v_attribute14
FROM fnd_lookup_values
WHERE lookup_type = 'XXEQ_REJECTION_REASONS_SEPA'
AND lookup_code = v_reason_code
AND TRUNC (SYSDATE) BETWEEN TRUNC (start_date_active) AND NVL (TRUNC (end_date_active), TO_DATE ('31-DEC-4712', 'DD-MON-RRRR'))
AND enabled_flag = 'Y'
AND LANGUAGE = 'US';
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_sqlcode := SQLCODE;
v_error_desc := 'For record number ' || v_rec_cnt || ' Reason code ' || v_reason_code || ' is not present in lookup XXEQ_REJECTION_REASONS_SEPA';
RAISE err_generic;
WHEN OTHERS THEN
v_sqlcode := SQLCODE;
v_error_desc := 'For record number ' || v_rec_cnt || ' Unexpected error while fetching reason code details from lookup XXEQ_REJECTION_REASONS_SEPA ';
RAISE err_generic;
END;
-- derive ABI, CAB and CONTO from IBAN
v_abi := SUBSTR (v_iban_number
,6
,5
);
v_cab := SUBSTR (v_iban_number
,11
,5
);
v_conto := SUBSTR (v_iban_number
,16
,12
);
FOR c_bank_acc_uses IN bank_acc_uses_cur (v_proxy_number)
LOOP
-- derive mandatory fields to be passed to the API
l_bank_acct_uses_rec := NULL;
l_bank_acct_uses_rec.bank_account_uses_id := c_bank_acc_uses.bank_account_uses_id;
l_bank_acct_uses_rec.customer_id := c_bank_acc_uses.customer_id;
l_bank_acct_uses_rec.customer_site_use_id := c_bank_acc_uses.customer_site_use_id;
l_bank_acct_uses_rec.vendor_id := c_bank_acc_uses.vendor_id;
l_bank_acct_uses_rec.vendor_site_id := c_bank_acc_uses.vendor_site_id;
l_bank_acct_uses_rec.external_bank_account_id := c_bank_acc_uses.external_bank_account_id;
l_bank_acct_uses_rec.start_date := c_bank_acc_uses.start_date;
l_bank_acct_uses_rec.end_date := c_bank_acc_uses.end_date;
l_bank_acct_uses_rec.primary_flag := c_bank_acc_uses.primary_flag;
l_last_update_date := c_bank_acc_uses.last_update_date;
l_bank_acct_uses_rec.attribute_category := c_bank_acc_uses.attribute_category;
l_bank_acct_uses_rec.attribute1 := c_bank_acc_uses.attribute1;
l_bank_acct_uses_rec.attribute2 := c_bank_acc_uses.attribute2;
l_bank_acct_uses_rec.attribute3 := c_bank_acc_uses.attribute3;
l_bank_acct_uses_rec.attribute4 := c_bank_acc_uses.attribute4;
l_bank_acct_uses_rec.attribute5 := c_bank_acc_uses.attribute5;
l_bank_acct_uses_rec.attribute6 := c_bank_acc_uses.attribute6;
l_bank_acct_uses_rec.attribute7 := c_bank_acc_uses.attribute7;
l_bank_acct_uses_rec.attribute8 := c_bank_acc_uses.attribute8;
l_bank_acct_uses_rec.attribute9 := c_bank_acc_uses.attribute9;
l_bank_acct_uses_rec.attribute10 := c_bank_acc_uses.attribute10;
l_bank_acct_uses_rec.attribute11 := c_bank_acc_uses.attribute11;
l_bank_acct_uses_rec.attribute12 := c_bank_acc_uses.attribute12;
l_bank_acct_uses_rec.attribute13 := c_bank_acc_uses.attribute13;
l_bank_acct_uses_rec.attribute14 := c_bank_acc_uses.attribute14;
v_bank_account_num := c_bank_acc_uses.bank_account_num;
v_bank_number := c_bank_acc_uses.bank_number;
v_bank_num := c_bank_acc_uses.bank_num;
v_customer_number := c_bank_acc_uses.customer_number;
v_site_num := c_bank_acc_uses.LOCATION;
v_arbor_ba := c_bank_acc_uses.arbor_ba;
v_gfp_dd_status := c_bank_acc_uses.attribute14;
IF ( LTRIM (v_bank_account_num, '0') = LTRIM (v_conto, '0')
AND v_bank_number = v_abi
AND v_bank_num = v_cab)
OR (v_reason_code IN ('MD09', 'MD16')) THEN
-- update the bank account's attributes using API
BEGIN
l_bank_acct_uses_rec.attribute14 := v_attribute14;
l_bank_acct_uses_rec.attribute15 := TO_CHAR (SYSDATE, 'DD-MON-YYYY');
apps.hz_cust_acct_info_pub.update_bank_acct_uses (p_api_version => 1.0
,p_init_msg_list => apps.fnd_api.g_true
,p_commit => fnd_api.g_false
,p_bank_account_uses_rec => l_bank_acct_uses_rec
,p_last_update_date => l_last_update_date
,x_return_status => x_return_status
,x_msg_count => x_msg_count
,x_msg_data => x_msg_data
,p_validation_level => fnd_api.g_valid_level_full
);
IF x_return_status = fnd_api.g_ret_sts_success THEN
v_updt_cnt := v_updt_cnt + 1;
INSERT INTO xxeq_inb_auth_log
VALUES (1
,v_rec_cnt
,v_attribute14
, 'Cliente: ' || v_proxy_number || ' Direct Debit status updated to ' || v_attribute14 || ' : ' || v_add_rej_info
);
COMMIT;
ELSE
IF x_msg_count > 0 THEN
fnd_file.put_line (fnd_file.LOG, 'Update API FAILED ERROR(1), x_msg_data : ' || x_msg_data);
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
v_sqlcode := SUBSTR (SQLERRM
,1
,200
);
v_error_desc := 'Error in Bank Account Uses UPDATE API';
RAISE err_generic;
END;
ELSE
IF LTRIM (v_bank_account_num, '0') <> LTRIM (v_conto, '0') THEN
v_mismatch_reason := 'Conto is not matching';
END IF;
IF v_bank_number <> v_abi THEN
v_mismatch_reason := v_mismatch_reason || 'ABI is not matching';
END IF;
IF v_bank_num <> v_cab THEN
v_mismatch_reason := v_mismatch_reason || 'CAB is not matching';
END IF;
-- print log for other IBANs against that customer proxy
INSERT INTO xxeq_inb_auth_mismatch
VALUES (v_rec_cnt
,v_customer_number
,v_site_num
,v_arbor_ba
,v_proxy_number
,v_bank_number
,v_bank_num
,v_bank_account_num
,v_gfp_dd_status
,v_reason_code
,v_add_rej_info
,v_abi
,v_cab
,v_conto
,v_mismatch_reason
);
COMMIT;
END IF;
END LOOP;
fnd_file.put_line (fnd_file.output, separatore);
fnd_file.put_line (fnd_file.output, 'Successfully updated records ');
fnd_file.put_line (fnd_file.output, separatore);
FOR c_log_msg IN log_msg_cur
LOOP
fnd_file.put_line (fnd_file.output, c_log_msg.MESSAGE);
END LOOP;
fnd_file.put_line (fnd_file.output, separatore);
fnd_file.put_line (fnd_file.output, 'Records not updated due to Abi-Cab-Conto mismatch');
fnd_file.put_line (fnd_file.output, separatore);
fnd_file.put_line
(fnd_file.output
,'Customer Number Site Number Arbor Billing Account Proxy Number GFP ABI GFP CAB GFP CONTO Direct Debit Status Causale Causale-Description Response ABI Response CAB Response Conto Reason For Not Updating DDS');
fnd_file.put_line
(fnd_file.output
,'------------- -------------- -------------- -------------- ------------ ---------- -------------- -------------- ---------- -------------- -------------- -------------- -------------- --------------');
FOR c_mismatch_msg IN mismatch_msg_cur
LOOP
fnd_file.put_line (fnd_file.output
, c_mismatch_msg.customer_number
|| ' '
|| c_mismatch_msg.site_number
|| ' '
|| c_mismatch_msg.arbor_ba
|| ' '
|| c_mismatch_msg.proxy
|| ' '
|| c_mismatch_msg.gfp_abi
|| ' '
|| c_mismatch_msg.gfp_cab
|| ' '
|| c_mismatch_msg.gfp_conto
|| ' '
|| c_mismatch_msg.gfp_dd_status
|| ' '
|| c_mismatch_msg.resp_rej_code
|| ' '
|| c_mismatch_msg.resp_rej_desc
|| ' '
|| c_mismatch_msg.resp_abi
|| ' '
|| c_mismatch_msg.resp_cab
|| ' '
|| c_mismatch_msg.resp_conto
|| ' '
|| c_mismatch_msg.reason);
END LOOP;
EXCEPTION
WHEN err_generic THEN
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'SQLCode : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN err_empty_file THEN
RAISE err_empty_file1;
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || SQLERRM);
fnd_file.put_line (fnd_file.LOG, 'SQLCode: ' || SQLCODE);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
END;
END LOOP;
-- close file
BEGIN
UTL_FILE.fclose (f_handle);
fnd_file.put_line (fnd_file.LOG, 'Records read : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, 'Records updated : ' || v_updt_cnt);
fnd_file.put_line (fnd_file.LOG, 'Calling File Archive program');
l_new_req :=
fnd_request.submit_request ('XXEQ'
,'XXEQDDAARCH'
,' '
, SYSDATE + (1 / 8640)
,FALSE
,v_file_name
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
,''
);
IF (l_new_req <> 0) THEN
fnd_file.put_line (fnd_file.LOG, 'Request_id: ' || l_new_req || ' submitted for file archive');
ELSE
fnd_file.put_line (fnd_file.LOG, 'Request not submitted for file archive');
END IF;
EXCEPTION
WHEN OTHERS THEN
v_error_desc := 'Error in instruction of the input file fclose(' || v_file_name || ')';
RAISE;
END;
EXCEPTION
WHEN err_empty_file1 THEN
retcode := 1;
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
WHEN UTL_FILE.invalid_path THEN
v_sqlcode := 'UTL_FILE.INVALID_PATH';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.invalid_operation THEN
v_sqlcode := 'UTL_FILE.INVALID_OPERATION';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.invalid_mode THEN
v_sqlcode := 'UTL_FILE.INVALID_MODE';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Messagr: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.invalid_filehandle THEN
v_sqlcode := 'UTL_FILE.INVALID_FILEHANDLE';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN UTL_FILE.read_error THEN
v_sqlcode := 'UTL_FILE.READ_ERROR';
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || v_error_desc);
fnd_file.put_line (fnd_file.LOG, 'Error : ' || v_sqlcode);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
WHEN OTHERS THEN
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, separatore);
fnd_file.put_line (fnd_file.LOG, 'Message: ' || SQLERRM);
fnd_file.put_line (fnd_file.LOG, 'SQLCode: ' || SQLCODE);
fnd_file.put_line (fnd_file.LOG, 'Record : ' || v_rec_cnt);
fnd_file.put_line (fnd_file.LOG, separatore);
retcode := 1;
fnd_file.put_line (fnd_file.LOG, ' ');
fnd_file.put_line (fnd_file.LOG, ' ');
END update_dd_status;
END xxeq_inbound_auth_pkg;
/
No comments :
Post a Comment