[Home] [Help]
PACKAGE BODY: APPS.INV_MGD_POS_ORGANIZATION_MDTR
Source
1 PACKAGE BODY INV_MGD_POS_ORGANIZATION_MDTR AS
2 /* $Header: INVMPORB.pls 115.4 2002/11/23 00:02:50 vma ship $ */
3 --+=======================================================================+
4 --| Copyright (c) 2000 Oracle Corporation |
5 --| Redwood Shores, CA, USA |
6 --| All rights reserved. |
7 --+=======================================================================+
8 --| FILENAME |
9 --| INVMPORS.pls |
10 --| |
11 --| DESCRIPTION |
12 --| Inventory Position View and Export: Organization Mediator |
13 --| HISTORY |
14 --| 09/05/2000 Paolo Juvara Created |
15 --| 09/16/2002 Veeresha Javli Bug#2563291 fix use the new api |
16 --| get_organization_list instead of |
17 --| org_hierarchy_list |
18 --| 09/17/2002 Veeresha Javli l_hierarchy_name removed |
19 --| 11/21/2002 Vivian Ma Performance: modify code to print to |
20 --| log only if debug profile option is |
21 --| enabled |
22 --+======================================================================*/
23
24 --===================
25 -- CONSTANTS
26 --===================
27 G_PKG_NAME CONSTANT VARCHAR2(30):= 'INV_MGD_POS_ORGANIZATION_MDTR';
28
29 --===================
30 -- GLOBAL VARIABLES
31 --===================
32 G_DEBUG VARCHAR2(1) := NVL(fnd_profile.value('AFLOG_ENABLED'), 'N');
33
34 --===================
35 -- PROCEDURES AND FUNCTIONS
36 --===================
37
38 --========================================================================
39 -- PROCEDURE : Build_Organization_List PUBLIC
40 -- PARAMETERS: p_hierarchy_id organization hierarchy
41 -- p_hierarchy_level_id organization ID identifying the level
42 -- x_organization_tbl list of organization
43 -- COMMENT : Builds the list of organizations that belong to a hierarchy level
44 -- POST-COND : x_organization_tbl is not empty
45 --========================================================================
46 PROCEDURE Build_Organization_List
47 ( p_hierarchy_id IN NUMBER
48 , p_hierarchy_level_id IN NUMBER
49 , x_organization_tbl IN OUT NOCOPY INV_MGD_POS_UTIL.organization_tbl_type
50 )
51 IS
52
53 l_api_name CONSTANT VARCHAR2(30):= 'Build_Organization_List';
54 l_org_id_tbl INV_ORGHIERARCHY_PVT.OrgID_tbl_type;
55
56 BEGIN
57
58 IF G_DEBUG = 'Y' THEN
59 INV_MGD_POS_UTIL.Log
60 ( p_priority => INV_MGD_POS_UTIL.G_LOG_PROCEDURE
61 , p_msg => '> '||G_PKG_NAME||'.'||l_api_name
62 );
63 END IF;
64
65 -- Initialize organization list
66 x_organization_tbl.DELETE;
67
68 -- bug#2563291 fix use the performance enhancement api
69 -- get organization list
70 INV_ORGHIERARCHY_PVT.get_organization_List
71 ( p_hierarchy_id => p_hierarchy_id
72 , p_origin_org_id => p_hierarchy_level_id
73 , x_org_id_tbl => l_org_id_tbl
74 , p_include_origin => 'Y'
75 );
76 IF G_DEBUG = 'Y' THEN
77 INV_MGD_POS_UTIL.Log
78 ( p_priority => INV_MGD_POS_UTIL.G_LOG_STATEMENT
79 , p_msg => 'organization list retrieved'
80 );
81 END IF;
82
83 -- complete the record information
84 FOR l_Idx IN l_org_id_tbl.FIRST..l_org_id_tbl.LAST
85 LOOP
86 SELECT
87 organization_id
88 , organization_code
89 INTO
90 x_organization_tbl(l_Idx).id
91 , x_organization_tbl(l_Idx).code
92 FROM mtl_parameters
93 WHERE organization_id = l_org_id_tbl(l_Idx);
94 END LOOP;
95 IF G_DEBUG = 'Y' THEN
96 INV_MGD_POS_UTIL.Log
97 ( p_priority => INV_MGD_POS_UTIL.G_LOG_STATEMENT
98 , p_msg => 'organization information retrieved'
99 );
100
101 INV_MGD_POS_UTIL.Log
102 ( p_priority => INV_MGD_POS_UTIL.G_LOG_PROCEDURE
103 , p_msg => '< '||G_PKG_NAME||'.'||l_api_name
104 );
105 END IF;
106
107 END Build_Organization_List;
108
109
110 END INV_MGD_POS_ORGANIZATION_MDTR;