784: IF l_length <> l_expected_length
785: THEN
786: --Insert a row of account number, level, length, expected length,
787: -- account structure, and current request id into invalid account
788: -- table JA_CN_COA_NA_EXCEPTIONS
789: INSERT INTO JA_CN_COA_NA_EXCEPTIONS
790: ( ACCOUNT_SEGMENT
791: ,ACCOUNT_LEVEL
792: ,VALUE_LENGTH
785: THEN
786: --Insert a row of account number, level, length, expected length,
787: -- account structure, and current request id into invalid account
788: -- table JA_CN_COA_NA_EXCEPTIONS
789: INSERT INTO JA_CN_COA_NA_EXCEPTIONS
790: ( ACCOUNT_SEGMENT
791: ,ACCOUNT_LEVEL
792: ,VALUE_LENGTH
793: ,EXPECTED_LENGTH
815: END IF; --Account Level should not null and be a natural number and <16
816: END LOOP;
817: CLOSE c_na_info;
818:
819: -- 3. Checks if the invalid account table JA_CN_COA_NA_EXCEPTIONS has any row.
820: -- If YES then records error in output and submits a request to generate
821: -- exception report;
822: -- ELSE goes on to collect all natural accounts.
823: SELECT count(*)
821: -- exception report;
822: -- ELSE goes on to collect all natural accounts.
823: SELECT count(*)
824: INTO l_exceptions_count
825: FROM JA_CN_COA_NA_EXCEPTIONS
826: WHERE NA_REQUEST_ID = l_na_curr_req_id
827: ;
828:
829: IF l_exceptions_count > 0 --JA_CN_COA_NA_EXCEPTIONS has row
825: FROM JA_CN_COA_NA_EXCEPTIONS
826: WHERE NA_REQUEST_ID = l_na_curr_req_id
827: ;
828:
829: IF l_exceptions_count > 0 --JA_CN_COA_NA_EXCEPTIONS has row
830: THEN
831: l_xml_layout := FND_REQUEST.ADD_LAYOUT( template_appl_name => 'JA'
832: ,template_code => 'JACNNAER'
833: ,template_language => l_template_language --'zh' ('en')
872: /* ------------for test---------------------------------
873: FND_FILE.put_line(FND_FILE.output,l_na_req_phase ||'-----------Wait_For_Request');
874: ------------for test---------------------------------*/
875:
876: --DELETE rows with l_na_curr_req_id in TABLE JA_CN_COA_NA_EXCEPTIONS;
877: DELETE
878: FROM JA_CN_COA_NA_EXCEPTIONS
879: WHERE NA_REQUEST_ID = l_na_curr_req_id;
880: COMMIT;
874: ------------for test---------------------------------*/
875:
876: --DELETE rows with l_na_curr_req_id in TABLE JA_CN_COA_NA_EXCEPTIONS;
877: DELETE
878: FROM JA_CN_COA_NA_EXCEPTIONS
879: WHERE NA_REQUEST_ID = l_na_curr_req_id;
880: COMMIT;
881:
882: --Report that there have invalid accounts