DBA Data[Home] [Help]

PACKAGE BODY: APPS.FVFCATTB

Source


1 PAckage Body FVFCATTB as
2 -- $Header: FVFCATTB.pls 115.5 2002/03/06 14:12:04 pkm ship      $
3 Procedure Main 	(errbuf out varchar2,
4 		retcode out varchar2,
5 		p_yes_no in varchar2) is
6 v_count			number;
7 v_message		Varchar2(500);
8 v_errbuf		Varchar2(255);
9 v_retcode		Varchar2(255);
10 v_attr_inserted		number :=0;
11 v_codes_inserted	number :=0;
12 v_accts_inserted  	number :=0;
13 begin
14 
15 	FVFCATT1.MAIN(v_errbuf,v_retcode);
16 		IF v_retcode = -1 THEN
17 			v_message := v_errbuf;
18 			v_retcode := 1;
19 			retcode := v_retcode;
20 			errbuf := v_message;
21 			ROLLBACK;
22 			return;
23 		ELSE
24 		null;
25 		--	v_message := substr(v_errbuf,1,80);
26 		END IF;
27 	FVFCATT2.MAIN(v_errbuf,v_retcode);
28 		IF v_retcode = -1 THEN
29 			v_message := v_errbuf;
30 			v_retcode := 1;
31 			retcode := v_retcode;
32 			errbuf := v_message;
33 			ROLLBACK;
34 			return;
35 		ELSE
36 			select count(*)
37 			into v_attr_inserted
38 			from fv_facts_attributes;
39 
40 		END IF;
41 
42 	FVFCRT7B.MAIN(v_errbuf,v_retcode);
43 		IF v_retcode = -1 THEN
44 			v_message := v_errbuf;
45 			v_retcode := 1;
46 			retcode := v_retcode;
47 			errbuf := v_message;
48 			ROLLBACK;
49 			return;
50 		ELSE
51 			select count(*)
52 			into v_codes_inserted
53 			from fv_facts_rt7_codes;
54 
55 			select count(*)
56 			into v_accts_inserted
57 			from fv_facts_rt7_accounts;
58 
59 			v_message :='FACTS attributes  successfully created';
60 			if p_yes_no = 'N' then
61 				v_message := v_message||'-'||'FACTS II requires US SGL compliance if the
62 				natural account segment has been expanded to accomodate Agency specific
63 				requirements, designate a parent account that is 4-digit US SGL Account';
64 				retcode := 1;
65 			end if;
66 END IF;
67 errbuf := v_message;
68 
69 COMMIT;
70 Exception
71    When Others Then
72    errbuf := substr(SQLERRM,1,225);
73    retcode := 1;
74 END;
75 End;