DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_POXPOABP_XMLP_PKG

Source


1 PACKAGE BODY PO_POXPOABP_XMLP_PKG AS
2 /* $Header: POXPOABPB.pls 120.1 2007/12/25 11:07:13 krreddy noship $ */
3 
4 USER_EXIT_FAILURE EXCEPTION;
5 
6 function BeforeReport return boolean is
7 begin
8 
9 DECLARE
10    l_sort       po_lookup_codes.displayed_field%type;
11 BEGIN
12   /*SRW.USER_EXIT('FND SRWINIT');*/null;
13 
14   IF P_ORDERBY is not NULL THEN
15      SELECT displayed_field
16      INTO l_sort
17      FROM po_lookup_codes
18      WHERE lookup_code = P_ORDERBY
19      AND lookup_type = 'SRS ORDER BY';
20 
21    P_ORDERBY_DISPLAYED := l_sort;
22 
23    ELSE
24 
25      P_ORDERBY_DISPLAYED := '';
26 
27    END IF;
28 FORMAT_MASK := PO_common_xmlp_pkg.GET_PRECISION(P_QTY_PRECISION);
29 EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
30    /*SRW.MESSAGE(1,'srw_init');*/null;
31 
32 END;
33 BEGIN
34   if (get_p_struct_num <> TRUE )
35     then /*SRW.MESSAGE('1','P Struct Num Init failed');*/null;
36 
37   end if;
38 END;
39 BEGIN
40 
41  null;
42   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
43             /*SRW.MESSAGE(1,'Before Item Flex');*/null;
44 
45 END;
46 BEGIN
47 
48  null;
49   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
50             /*SRW.MESSAGE(1,'Before Cat Flex');*/null;
51 
52 END;
53 BEGIN
54 
55  null;
56   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
57             /*SRW.MESSAGE(1,'Before Categroy Orderby');*/null;
58 
59 END;
60 BEGIN
61 
62  null;
63   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
64             /*SRW.MESSAGE(1,'Before Item Orderby');*/null;
65 
66 END;
67 BEGIN
68 
69  null;
70   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
71             /*SRW.MESSAGE(1,'Before Category Where');*/null;
72 
73 END;
74 BEGIN
75 
76  null;
77   EXCEPTION WHEN  USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
78             /*SRW.MESSAGE(1,'Before Item Where');*/null;
79 
80 END;
81 RETURN TRUE;  return (TRUE);
82 end;
83 
84 function orderby_clauseFormula return VARCHAR2 is
85 begin
86 
87 if P_ORDERBY = 'CATEGORY' then
88      return( ' 1 ');
89 else
90      return(' 2 ');
91 end if;
92 --RETURN NULL; end;
93 RETURN('msi.inventory_item_id'); end;
94 
95 function get_p_struct_num return boolean is
96 
97 l_p_struct_num number;
98 
99 begin
100         select structure_id
101         into l_p_struct_num
102         from mtl_default_sets_view
103         where functional_area_id = 2 ;
104 
105         P_STRUCT_NUM := l_p_struct_num ;
106 
107         return(TRUE) ;
108 
109         RETURN NULL; exception
110         when others then return(FALSE) ;
111 end;
112 
113 function AfterPForm return boolean is
114 l_manual_numbering varchar2(30);
115 
116 
117 
118 
119 begin
120 
121 
122      /*srw.user_exit('FND SRWINIT');*/null;
123 
124 
125 BEGIN
126      Select manual_po_num_type into l_manual_numbering
127      FROM po_system_parameters ;
128 EXCEPTION
129    when NO_DATA_FOUND then
130       l_manual_numbering := 'ALPHANUMERIC';
131 END;
132 
133 
134 if ( l_manual_numbering  = 'NUMERIC' ) then
135 
136  P_ITEMS_WHERE := ' decode(rtrim(poh1.segment1,''0123456789''),NULL,to_number(poh1.segment1),-1)
137                     BETWEEN decode(rtrim(nvl(:P_blanket_po_num_from,poh1.segment1),''0123456789''),NULL, to_number(nvl(:P_blanket_po_num_from,poh1.segment1)),-1)
138                     AND   decode(rtrim(nvl(:P_blanket_po_num_to,poh1.segment1),''0123456789''),NULL, to_number(nvl(:P_blanket_po_num_to,poh1.segment1)),-1) ' ;
139 
140 else
141 
142   if ( P_blanket_po_num_from is not null and P_blanket_po_num_to is not null ) then
143        P_ITEMS_WHERE := ' poh1.segment1 >= :P_blanket_po_num_from and poh1.segment1 <= :P_blanket_po_num_to ' ;
144   elsif ( P_blanket_po_num_from is not null and P_blanket_po_num_to is null ) then
145        P_ITEMS_WHERE := ' poh1.segment1 >= :P_blanket_po_num_from ' ;
146   elsif ( P_blanket_po_num_from is null and P_blanket_po_num_to is not null ) then
147        P_ITEMS_WHERE := ' poh1.segment1 <= :P_blanket_po_num_to ' ;
148   else
149        P_ITEMS_WHERE := ' 1 = 1 ' ;
150   end if;
151 
152 end if;
153  return (TRUE);
154 end;
155 
156 function AfterReport return boolean is
157 begin
158   /*SRW.USER_EXIT('FND SRWEXIT');*/null;
159 
160   return (TRUE);
161 end;
162 
163 --Functions to refer Oracle report placeholders--
164 
165 END PO_POXPOABP_XMLP_PKG ;
166