DBA Data[Home] [Help]

PACKAGE BODY: APPS.GL_GLXRLSEG_XMLP_PKG

Source


1 PACKAGE BODY GL_GLXRLSEG_XMLP_PKG AS
2 /* $Header: GLXRLSEGB.pls 120.0 2007/12/27 15:18:44 vijranga noship $ */
3 
4 function BeforeReport return boolean is
5 errbuf  VARCHAR2(132);
6   colname VARCHAR2(30);
7   value_set_id number;
8   prompt  VARCHAR2(80);
9   p_value_set_id number;
10   p_prompt VARCHAR2(80);
11   seg_type VARCHAR2(1);
12   printswitch VARCHAR2(1);
13   account_position number default 1;
14   value_attribute_type VARCHAR2(30);
15 
16   CURSOR get_position (valset number) IS
17     SELECT value_attribute_type
18     FROM   FND_FLEX_VALIDATION_QUALIFIERS
19     WHERE  id_flex_code = 'GL#'
20     AND    id_flex_application_id = 101
21     AND    flex_value_set_id = valset
22     ORDER BY assignment_date, value_attribute_type;
23 
24 begin
25   /*srw.user_exit('FND SRWINIT');*/null;
26 
27 
28   begin
29     COA_NAME := gl_flexfields_pkg.get_coa_name(P_STRUCT_NUM);
30 
31   exception
32     when NO_DATA_FOUND then
33       errbuf := gl_message.get_message('GL_PLL_ROUTINE_ERROR', 'N',
34                    'ROUTINE','gl_flexfields_pkg.get_coa_name');
35       /*srw.message('00', errbuf);*/null;
36 
37       raise_application_error(-20101,null);/*srw.program_abort;*/null;
38 
39   end;
40 
41   SELECT fs.flex_value_set_id, fs.application_column_name,
42          fst.form_above_prompt
43   into  value_set_id, colname, prompt
44   from fnd_id_flex_segments fs, fnd_id_flex_segments_tl fst
45   where fs.id_flex_code = 'GL#'
46   and fs.enabled_flag = 'Y'
47   and fs.id_flex_num = P_STRUCT_NUM
48   and fs.segment_name = P_SEGMENT_NAME
49   and fs.application_id = 101
50   and fst.application_id = fs.application_id + 0
51   and fst.id_flex_code = fs.id_flex_code
52   and fst.id_flex_num = fs.id_flex_num
53   and fst.application_column_name = fs.application_column_name
54   and fst.language = userenv('LANG');
55 
56   select attribute_value
57   into printswitch
58   from fnd_segment_attribute_values
59   where application_id = 101
60   and  id_flex_code = 'GL#'
61   and  id_flex_num = P_STRUCT_NUM
62   and  segment_attribute_type = 'GL_ACCOUNT'
63   and  application_column_name = colname;
64 
65   APROMPT := prompt;
66   VSETID := value_set_id;
67   APRINTSWITCH := printswitch;
68 
69 
70 
71   OPEN get_position(value_set_id);
72   LOOP
73     fetch get_position into value_attribute_type;
74     exit when get_position%NOTFOUND;
75     IF (value_attribute_type='GL_ACCOUNT_TYPE') THEN
76       POSITION := account_position;
77     END IF;
78     IF (value_attribute_type = 'DETAIL_BUDGETING_ALLOWED') THEN
79       BUDGET_POSITION := account_position;
80     END IF;
81     IF (value_attribute_type = 'DETAIL_POSTING_ALLOWED') THEN
82       POST_POSITION := account_position;
83     END IF;
84     account_position := account_position + 1;
85   END LOOP;
86   CLOSE get_position;
87 
88   /*srw.message(100, 'HI'||value_set_id||'HI'||POSITION||'HI'||BUDGET_POSITION||'HI'||POST_POSITION);*/null;
89 
90 
91   SELECT ffvs.validation_type
92   INTO   seg_type
93   FROM   fnd_flex_value_sets ffvs
94   WHERE  ffvs.flex_value_set_id = value_set_id;
95 
96   if (seg_type = 'D') then
97        select vs.parent_flex_value_set_id
98        into  p_value_set_id
99        from fnd_flex_value_sets vs
100        where vs.flex_value_set_id = value_set_id;
101 
102        SELECT  distinct fst.form_above_prompt
103        into  p_prompt
104        from  fnd_id_flex_segments fs, fnd_id_flex_segments_tl fst
105        where fs.application_id = 101
106        and   fs.id_flex_code = 'GL#'
107        and   fs.enabled_flag = 'Y'
108        and   fs.id_flex_num = P_STRUCT_NUM
109        and   fs.flex_value_set_id = p_value_set_id
110        and   fst.application_id = fs.application_id + 0
111        and   fst.id_flex_code = fs.id_flex_code
112        and   fst.id_flex_num = fs.id_flex_num
113        and   fst.application_column_name = fs.application_column_name
114        and   fst.language = userenv('LANG');
115 
116        PAPROMPT := p_prompt;
117        PVSETID := p_value_set_id;
118     return (TRUE);
119   end if;
120 
121   SEGMENT_TYPE := seg_type;
122 
123   RETURN (TRUE);
124 EXCEPTION
125   when NO_DATA_FOUND then
126     /*srw.message('00',SQLERRM);*/null;
127 
128 end;
129 
130 function AfterReport return boolean is
131 begin
132   /*srw.user_exit('FND SRWEXIT');*/null;
133 
134   return (TRUE);
135 end;
136 
137 --Functions to refer Oracle report placeholders--
138 
139  Function COA_NAME_p return varchar2 is
140 	Begin
141 	 return COA_NAME;
142 	 END;
143  Function APROMPT_p return varchar2 is
144 	Begin
145 	 return APROMPT;
146 	 END;
147  Function APRINTSWITCH_p return varchar2 is
148 	Begin
149 	 return APRINTSWITCH;
150 	 END;
151  Function VSETID_p return number is
152 	Begin
153 	 return VSETID;
154 	 END;
155  Function PAPROMPT_p return varchar2 is
156 	Begin
157 	 return PAPROMPT;
158 	 END;
159  Function SEGMENT_TYPE_p return varchar2 is
160 	Begin
161 	 return SEGMENT_TYPE;
162 	 END;
163  Function PVSETID_p return number is
164 	Begin
165 	 return PVSETID;
166 	 END;
167  Function POSITION_p return number is
168 	Begin
169 	 return POSITION;
170 	 END;
171  Function POST_POSITION_p return number is
172 	Begin
173 	 return POST_POSITION;
174 	 END;
175  Function BUDGET_POSITION_p return number is
176 	Begin
177 	 return BUDGET_POSITION;
178 	 END;
179 END GL_GLXRLSEG_XMLP_PKG ;
180