1 PACKAGE MSC_WS_COMMON AUTHID CURRENT_USER AS
2 /* $Header: MSCWCOMS.pls 120.4 2008/03/12 01:21:00 bnaghi noship $ */
3
4 SYS_YES CONSTANT NUMBER := 1;
5 SYS_NO CONSTANT NUMBER := 2;
6 PROCEDURE VALIDATE_USER_RESP(
7 VRETURN OUT NOCOPY VARCHAR2,
8 USERID IN NUMBER,
9 RESPID IN NUMBER,
10 SECURITYID IN NUMBER DEFAULT 0) ;
11 PROCEDURE VALIDATE_USER_RESP_FUNC(
12 VRETURN OUT NOCOPY VARCHAR2,
13 USERID IN NUMBER,
14 RESPID IN NUMBER,
15 FUNC_NAME IN VARCHAR2,
16 SECURITYID IN NUMBER);
17 -- query user id, responsibility id and security group id.
18 PROCEDURE GET_PERMISSION_IDS(
19 Status OUT NOCOPY VARCHAR2,
20 UserId OUT NOCOPY NUMBER,
21 ResponsibilityId OUT NOCOPY NUMBER,
22 SecurityGroupId OUT NOCOPY NUMBER,
23 UserName IN VARCHAR2,
24 RespName IN VARCHAR2,
25 RespAppName IN VARCHAR2,
26 SecurityGroupName IN VARCHAR2,
27 Language IN VARCHAR2);
28
29 -- get plan name from Plan Id
30 FUNCTION GET_PLAN_NAME_BY_PLAN_ID(Status OUT NOCOPY VARCHAR2, PlanId IN NUMBER) RETURN BOOLEAN;
31
32 -- conversion of Y/N to SYS_YES/ SYS_NO
33 FUNCTION Bool_to_Number( flag IN varchar2) RETURN number;
34
35 FUNCTION get_cat_set_id(arg_plan_id number) RETURN NUMBER;
36
37 -- =============================================================
38 -- The following functions are declared here to make them as
39 -- public is because they are re-used by Set Plan Options for
40 -- DRP, SRP and IO plans.
41 -- =============================================================
42
43
44 -- =============================================================
45 -- Desc: Validate plan id, simulate the logic from Value
46 -- Set "MSC_SRS_NAME_COPY"
47 -- Input:
48 -- PlanId Plan Id.
49 --
50 -- Output: The possible return statuses are:
51 -- OK
52 -- INVALID_PLANID
53 -- =============================================================
54 FUNCTION VALIDATE_PLAN_ID(
55 OrgId OUT NOCOPY NUMBER,
56 InsId OUT NOCOPY NUMBER,
57 PlanName OUT NOCOPY VARCHAR2,
58 PlanId IN NUMBER
59 ) RETURN VARCHAR2;
60
61 -- =============================================================
62 -- Desc: Check if the plan contains this org organization.
63 -- for a pecified plan id
64 -- Input:
65 -- OrgId Organization Id.
66 -- PlanId Plan Id.
67 --
68 -- Output: The possible return statuses are:
69 -- OK
70 -- INVALID_ORGID
71 -- =============================================================
72 FUNCTION PLAN_CONTAINS_THIS_ORG(
73 InsId OUT NOCOPY NUMBER,
74 OrgId IN NUMBER,
75 PlanId IN NUMBER
76 ) RETURN VARCHAR2;
77
78 -- =============================================================
79 -- Desc: Validate item simulation set id.
80 -- Input:
81 -- SetId Simulation set Id.
82 --
83 -- Output: The possible return statuses are:
84 -- OK
85 -- INVALID_SIMULATION_SET_ID
86 -- =============================================================
87 FUNCTION VALIDATE_SIMULATION_SET_ID( SetId IN NUMBER ) RETURN VARCHAR2;
88
89 -- =============================================================
90 -- Desc: Purge all schedules, including global demand schediles,
91 -- local demand schedules and local supply schedules for this plan.
92 -- Input:
93 -- PlanId Plan Id.
94 --
95 -- Output: No output.
96 -- =============================================================
97 PROCEDURE PURGE_ALL_SCHEDULES(PlanId IN NUMBER);
98
99 -- =============================================================
100 -- Desc: Update item simulation set and overwrite.
101 -- Input:
102 -- PlanId Plan Id.
103 -- ItemSimulationSetId Item simulation set Id.
104 -- Overwrite overwrite.
105 --
106 -- Output: No output.
107 -- =============================================================
108 PROCEDURE UPDATE_PLAN_OPTIONS(
109 PlanId IN NUMBER,
110 ItemSimulationSetId IN NUMBER,
111 Overwrite IN NUMBER
112 );
113
114
115
116 -- =============================================================
117 -- Desc: Convert overwrite from string to number.
118 -- 'All' => 1
119 -- 'Outside PTF' => 2
120 -- 'None' => 3
121 -- Input:
122 -- Overwrite overwrite.
123 --
124 -- Output: The possible return statuses are:
125 -- =============================================================
126 FUNCTION CONVERT_OVERWRITE( Overwrite IN VARCHAR2 ) RETURN NUMBER;
127
128 -- =============================================================
129 -- Desc: If the PurgeAllSchsFlag is set, this function is called
130 -- to insert all schedules, including global demand schediles,
131 -- local demand schedules and local supply schedules.
132 -- Input:
133 -- PlanId Plan Id.
134 -- InsId Sr instance Id.
135 -- UserId User Id.
136 -- GlbDmdSchs global demand schedules.
137 -- LocDmdSchs local demand schedules.
138 -- LocSupSchs local supply schedules.
139 --
140 -- Output: The possible return statuses are:
141 -- =============================================================
142 FUNCTION INSERT_ALL_SCHEDULES(
143 PlanId IN NUMBER,
144 InsId IN NUMBER,
145 UserId IN NUMBER,
146 GlbDmdSchs IN MscIGlbDmdSchTbl,
147 LocDmdSchs IN MscILocDmdSchTbl,
148 LocSupSchs IN MscILocSupSchTbl
149 ) RETURN VARCHAR2;
150
151
152 -- =============================================================
153 -- Desc: If the PurgeAllSchsFlag is not set, this function is called
154 -- to insert or update all schedules, including global demand
155 -- schediles, local demand schedules and local supply schedules.
156 -- Input:
157 -- PlanId Plan Id.
158 -- InsId Sr instance Id.
159 -- UserId User Id.
160 -- GlbDmdSchs global demand schedules.
161 -- LocDmdSchs local demand schedules.
162 -- LocSupSchs local supply schedules.
163 --
164 -- Output: The possible return statuses are:
165 -- =============================================================
166 FUNCTION INSERT_OR_UPDATE_ALL_SCHS(
167 PlanId IN NUMBER,
168 InsId IN NUMBER,
169 UserId IN NUMBER,
170 GlbDmdSchs IN MscIGlbDmdSchTbl,
171 LocDmdSchs IN MscILocDmdSchTbl,
172 LocSupSchs IN MscILocSupSchTbl
173 ) RETURN VARCHAR2;
174
175
176 -- =============================================================
177 -- Desc: Validate the global demand schedule id. This function is
178 -- used by DRP and SRP. ASCP has its own function.
179 -- Input:
180 -- SchId Global demand schedule id.
181 -- PlanName Plan name.
182 --
183 -- Output: The possible return statuses are:
184 -- OK
185 -- INVALID_GLOBALDMDSCHS_DMD_SCH_ID
186 -- =============================================================
187 FUNCTION VALIDATE_G_DMD_SCH_ID(
188 SchId IN NUMBER,
189 PlanName IN VARCHAR2
190 ) RETURN VARCHAR2;
191
192
193 -- =============================================================
194 -- Desc: Validate the ship to consumption level. This function is
195 -- used by DRP and SRP. ASCP has its own function.
196 -- Input:
197 -- ShipTo Ship to consumption level.
198 -- SchId Demand schedule id.
199 --
200 -- Output: The possible return statuses are:
201 -- OK
202 -- INVALID_SHIP_TO_CONSUMPTION_LVL
203 -- =============================================================
204 FUNCTION VALIDATE_CONSUM_LVL(
205 ShipTo IN NUMBER,
206 SchId IN NUMBER
207 ) RETURN VARCHAR2;
208
209
210 -- =============================================================
211 -- Desc: validate local supply schedules
212 -- Input:
213 -- SchTable Local supply schedules.
214 -- PlanName Plan name.
215 --
216 -- Output: The possible return statuses are:
217 -- OK
218 -- INVALID_LOCALSUPSCHS_SUP_SCH_ID
219 -- =============================================================
220 FUNCTION VALIDATE_LOC_SUP_SCHS(
221 OutSchTable OUT NOCOPY MscILocSupSchTbl,
222 InSchTable IN MscLocSupSchTbl,
223 PlanId IN NUMBER,
224 PlanName IN VARCHAR2
225 ) RETURN VARCHAR2;
226
227
228 END MSC_WS_COMMON;
229