DBA Data[Home] [Help]

PACKAGE BODY: APPS.GML_PROCESS_FLAGS

Source


1 PACKAGE BODY GML_PROCESS_FLAGS AS
2 /* $Header: GMLOPMFB.pls 115.3 2003/07/31 15:48:48 mchandak noship $ */
3 
4 FUNCTION CHECK_OPM_ITEM
5       ( p_inventory_item_id IN mtl_system_items_b.inventory_item_id%TYPE
6       ) RETURN NUMBER IS
7 
8    v_item_no	mtl_system_items_b.segment1%TYPE;
9    opmitem      NUMBER;
10 
11    CURSOR item_distinct_cur IS
12      SELECT distinct segment1
13      FROM   mtl_system_items_b
14      WHERE  inventory_item_id = nvl(p_inventory_item_id,-99);
15 
16    CURSOR opm_item IS
17 	SELECT count(*)
18                 FROM ic_item_mst
19                 WHERE item_no = v_item_no;
20 
21 BEGIN
22 
23    opmitem       := 0;
24    GML_PROCESS_FLAGS.opmitem_flag := 0;
25 
26    OPEN item_distinct_cur;
27    FETCH item_distinct_cur into v_item_no;
28    If item_distinct_cur%NOTFOUND THEN
29 	CLOSE item_distinct_cur;
30   	return 0;
31    END IF;
32 
33    IF item_distinct_cur%ISOPEN THEN
34         CLOSE item_distinct_cur;
35    END IF;
36 
37    OPEN  opm_item;
38    FETCH opm_item into opmitem;
39    CLOSE opm_item;
40 
41    IF opmitem >= 1 THEN
42      GML_PROCESS_FLAGS.opmitem_flag := 1;
43      return 1;
44    ELSE
45      return 0;
46    END IF;
47 
48 END CHECK_OPM_ITEM;
49 
50 FUNCTION CHECK_PROCESS_ORGN
51         (p_organization_id IN mtl_parameters.organization_id%TYPE)
52          RETURN NUMBER IS
53 
54    process_enabled mtl_parameters.process_enabled_flag%TYPE;
55    CURSOR process_org IS
56      SELECT process_enabled_flag
57      FROM   mtl_parameters
58      WHERE  organization_id = nvl(p_organization_id,-99);
59   BEGIN
60 	process_enabled := 'N';
61 	GML_PROCESS_FLAGS.process_orgn := 0;
62 	OPEN process_org;
63 	FETCH process_org into process_enabled;
64 	CLOSE process_org;
65 
66 	If process_enabled = 'Y'
67 	Then
68 		GML_PROCESS_FLAGS.process_orgn := 1;
69 		return 1;
70 	Else
71 		return 0;
72 	End If;
73 END CHECK_PROCESS_ORGN;
74 
75 END GML_PROCESS_FLAGS; /* of package */