[Home] [Help]
PACKAGE BODY: APPS.FII_AR_REV_SOURCE_M_C
Source
1 Package Body FII_AR_REV_SOURCE_M_C AS
2 /* $Header: FIIAR03B.pls 115.12 2002/01/31 16:43:29 pkm ship $ */
3 G_PUSH_DATE_RANGE1 Date:=Null;
4 G_PUSH_DATE_RANGE2 Date:=Null;
5 g_row_count Number:=0;
6 g_exception_msg varchar2(2000):=Null;
7
8
9 Procedure Push(Errbuf in out Varchar2,
10 Retcode in out Varchar2,
11 p_from_date IN Varchar2,
12 p_to_date IN Varchar2) IS
13 l_dimension_name Varchar2(30) :='EDW_REV_SOURCE_M' ;
14 l_temp_date Date:=Null;
15 l_rows_inserted Number:=0;
16 l_duration Number:=0;
17 l_exception_msg Varchar2(2000):=Null;
18 l_from_date Date:=Null;
19 l_to_date Date:=Null;
20
21 -- -------------------------------------------
22 -- Put any additional developer variables here
23 -- -------------------------------------------
24 Begin
25 Errbuf :=NULL;
26 Retcode:=0;
27 l_from_date :=to_date(p_from_date,'YYYY/MM/DD HH24:MI:SS');
28 l_to_date :=to_date(p_to_date, 'YYYY/MM/DD HH24:MI:SS');
29 IF (Not EDW_COLLECTION_UTIL.setup(l_dimension_name)) THEN
30 errbuf := fnd_message.get;
31 RAISE_APPLICATION_ERROR(-20000,'Error in SETUP: ' || errbuf);
32 END IF;
33 FII_AR_REV_SOURCE_M_C.g_push_date_range1 := nvl(l_from_date,
34 EDW_COLLECTION_UTIL.G_local_last_push_start_date - EDW_COLLECTION_UTIL.g_offset);
35 FII_AR_REV_SOURCE_M_C.g_push_date_range2 := nvl(l_to_date,EDW_COLLECTION_UTIL.G_local_curr_push_start_date);
36 edw_log.put_line( 'The collection range is from '||
37 to_char(FII_AR_REV_SOURCE_M_C.g_push_date_range1,'MM/DD/YYYY HH24:MI:SS')||' to '||
38 to_char(FII_AR_REV_SOURCE_M_C.g_push_date_range2,'MM/DD/YYYY HH24:MI:SS'));
39 edw_log.put_line(' ');
40
41 -- -----------------------------------------------------------------------------
42 -- Start of Collection , Developer Customizable Section
43 -- -----------------------------------------------------------------------------
44
45 edw_log.put_line(' ');
46 edw_log.put_line('Pushing data');
47
48 l_temp_date := sysdate;
49
50
51 Push_EDW_RESR_REV_SRC_LSTG(FII_AR_REV_SOURCE_M_C.g_push_date_range1, FII_AR_REV_SOURCE_M_C.g_push_date_range2);
52
53
54 l_duration := sysdate - l_temp_date;
55
56 edw_log.put_line('Process Time: '||edw_log.duration(l_duration));
57 edw_log.put_line(' ');
58 -- ---------------------------------------------------------------------------
59 -- END OF Collection , Developer Customizable Section
60 -- ---------------------------------------------------------------------------
61 EDW_COLLECTION_UTIL.wrapup(TRUE, g_row_count,null,g_push_date_range1, g_push_date_range2);
62 commit;
63
64 Exception When others then
65 Errbuf:=sqlerrm;
66 Retcode:=sqlcode;
67 l_exception_msg := Retcode || ':' || Errbuf;
68 FII_AR_REV_SOURCE_M_C.g_exception_msg := l_exception_msg;
69 rollback;
70 EDW_COLLECTION_UTIL.wrapup(FALSE, 0, FII_AR_REV_SOURCE_M_C.g_exception_msg,g_push_date_range1, g_push_date_range2);
71
72 commit;
73 End;
74
75
76 Procedure Push_EDW_RESR_REV_SRC_LSTG(p_from_date IN date, p_to_date IN DATE) IS
77 l_date1 DATE;
78 l_date2 DATE;
79 l_rows_inserted NUMBER :=0;
80 BEGIN
81 edw_log.put_line('Starting Push_EDW_RESR_REV_SRC_LSTG');
82 l_date1 := p_from_date;
83 l_date2 := p_to_date;
84 Insert Into
85 EDW_RESR_REV_SRC_LSTG(
86 ALL_FK,
87 DESCRIPTION,
88 INSTANCE,
89 NAME,
90 REVENUE_SOURCE,
91 REV_SRC_DP,
92 REV_SRC_PK,
93 USER_ATTRIBUTE1,
94 USER_ATTRIBUTE2,
95 USER_ATTRIBUTE3,
96 USER_ATTRIBUTE4,
97 USER_ATTRIBUTE5,
98 OPERATION_CODE,
99 COLLECTION_STATUS)
100 select NVL(ALL_FK, 'NA_EDW'),
101 DESCRIPTION,
102 INSTANCE,
103 NAME,
104 REVENUE_SOURCE,
105 REV_SRC_DP,
106 REV_SRC_PK,
107 USER_ATTRIBUTE1,
108 USER_ATTRIBUTE2,
109 USER_ATTRIBUTE3,
110 USER_ATTRIBUTE4,
111 USER_ATTRIBUTE5,
112 NULL, -- OPERATION_CODE
113 'READY'
114 from FII_AR_RESR_REV_SRC_LCV;
115
116
117 l_rows_inserted := sql%rowcount;
118 g_row_count := g_row_count + l_rows_inserted ;
119 edw_log.put_line('Commiting records for EDW_RESR_REV_SRC_LSTG');
120 commit;
121
122 edw_log.put_line('Completed Push_EDW_RESR_REV_SRC_LSTG');
123 Exception When others then
124 raise;
125 commit;
126 END;
127 End FII_AR_REV_SOURCE_M_C;