31: p_pkg_name => G_PKG_NAME,
32: p_procedure_name => l_api_name
33: );
34:
35: RAISE Fnd_Api.G_Exc_Unexpected_Error;
36:
37: END Get_Status;
38:
39: ---------------------------------------------------------------------------
73: p_pkg_name => G_PKG_NAME,
74: p_procedure_name => l_api_name
75: );
76:
77: RAISE Fnd_Api.G_Exc_Unexpected_Error;
78:
79: END Get_Country_Code;
80:
81: ---------------------------------------------------------------------------
81: ---------------------------------------------------------------------------
82:
83: PROCEDURE Create_Organization
84: (
85: p_init_msg_list IN VARCHAR2 := Fnd_Api.G_False,
86: p_validate_only IN VARCHAR2 := Fnd_Api.G_False,
87: p_commit IN VARCHAR2 := Fnd_Api.G_False,
88: x_party_id OUT NOCOPY NUMBER,
89: p_organization_name IN VARCHAR2,
82:
83: PROCEDURE Create_Organization
84: (
85: p_init_msg_list IN VARCHAR2 := Fnd_Api.G_False,
86: p_validate_only IN VARCHAR2 := Fnd_Api.G_False,
87: p_commit IN VARCHAR2 := Fnd_Api.G_False,
88: x_party_id OUT NOCOPY NUMBER,
89: p_organization_name IN VARCHAR2,
90: p_address1 IN VARCHAR2,
83: PROCEDURE Create_Organization
84: (
85: p_init_msg_list IN VARCHAR2 := Fnd_Api.G_False,
86: p_validate_only IN VARCHAR2 := Fnd_Api.G_False,
87: p_commit IN VARCHAR2 := Fnd_Api.G_False,
88: x_party_id OUT NOCOPY NUMBER,
89: p_organization_name IN VARCHAR2,
90: p_address1 IN VARCHAR2,
91: p_address2 IN VARCHAR2,
127: /*
128: ** Initialize
129: */
130:
131: x_return_status := Fnd_Api.G_Ret_Sts_Success;
132:
133: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
134:
135: Fnd_Msg_Pub.Initialize;
129: */
130:
131: x_return_status := Fnd_Api.G_Ret_Sts_Success;
132:
133: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
134:
135: Fnd_Msg_Pub.Initialize;
136:
137: END IF;
140: l_country_code := Get_Country_Code(p_country_name);
141:
142: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
143:
144: RAISE Fnd_Api.G_Exc_Error;
145:
146: END IF;
147:
148:
149: /*
150: ** Discontinue processing if API invoked in validation mode
151: */
152:
153: IF Fnd_Api.To_Boolean(p_validate_only) THEN
154:
155: RETURN;
156:
157: END IF;
170: END IF;
171:
172: Hz_Party_V2pub.Create_Organization
173: (
174: p_init_msg_list => Fnd_Api.G_False,
175: p_organization_rec => l_organization_rec,
176: x_party_id => x_party_id,
177: x_party_number => l_party_number,
178: x_profile_id => l_profile_id,
182: );
183:
184: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
185:
186: RAISE Fnd_Api.G_Exc_Error;
187:
188: END IF;
189:
190: l_location_rec.address1 := p_address1;
198: l_location_rec.created_by_module := 'IGW';
199:
200: Hz_Location_V2pub.Create_Location
201: (
202: p_init_msg_list => Fnd_Api.G_False,
203: p_location_rec => l_location_rec,
204: x_location_id => l_location_id,
205: x_return_status => x_return_status,
206: x_msg_count => x_msg_count,
208: );
209:
210: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
211:
212: RAISE Fnd_Api.G_Exc_Error;
213:
214: END IF;
215:
216: l_party_site_rec.party_id := x_party_id;
227: END IF;
228:
229: Hz_Party_Site_V2pub.Create_Party_Site
230: (
231: p_init_msg_list => Fnd_Api.G_False,
232: p_party_site_rec => l_party_site_rec,
233: x_party_site_id => l_party_site_id,
234: x_party_site_number => l_party_site_number,
235: x_return_status => x_return_status,
238: );
239:
240: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
241:
242: RAISE Fnd_Api.G_Exc_Error;
243:
244: END IF;
245:
246:
247: /*
248: ** Commit data if API invoked in commit mode
249: */
250:
251: IF Fnd_Api.To_Boolean(p_commit) THEN
252:
253: COMMIT;
254:
255: END IF;
255: END IF;
256:
257: EXCEPTION
258:
259: WHEN Fnd_Api.G_Exc_Error THEN
260:
261: ROLLBACK TO Create_Organization_Pvt;
262:
263: x_return_status := Fnd_Api.G_Ret_Sts_Error;
259: WHEN Fnd_Api.G_Exc_Error THEN
260:
261: ROLLBACK TO Create_Organization_Pvt;
262:
263: x_return_status := Fnd_Api.G_Ret_Sts_Error;
264:
265: Fnd_Msg_Pub.Count_And_Get
266: (
267: p_count => x_msg_count,
267: p_count => x_msg_count,
268: p_data => x_msg_data
269: );
270:
271: WHEN Fnd_Api.G_Exc_Unexpected_Error THEN
272:
273: ROLLBACK TO Create_Organization_Pvt;
274:
275: x_return_status := Fnd_Api.G_Ret_Sts_Unexp_Error;
271: WHEN Fnd_Api.G_Exc_Unexpected_Error THEN
272:
273: ROLLBACK TO Create_Organization_Pvt;
274:
275: x_return_status := Fnd_Api.G_Ret_Sts_Unexp_Error;
276:
277: Fnd_Msg_Pub.Count_And_Get
278: (
279: p_count => x_msg_count,
283: WHEN others THEN
284:
285: ROLLBACK TO Create_Organization_Pvt;
286:
287: x_return_status := Fnd_Api.G_Ret_Sts_Unexp_Error;
288:
289: Fnd_Msg_Pub.Add_Exc_Msg
290: (
291: p_pkg_name => G_PKG_NAME,
303: ---------------------------------------------------------------------------
304:
305: PROCEDURE Update_Organization
306: (
307: p_init_msg_list IN VARCHAR2 := Fnd_Api.G_False,
308: p_validate_only IN VARCHAR2 := Fnd_Api.G_False,
309: p_commit IN VARCHAR2 := Fnd_Api.G_False,
310: p_party_id IN NUMBER,
311: p_party_version IN NUMBER,
304:
305: PROCEDURE Update_Organization
306: (
307: p_init_msg_list IN VARCHAR2 := Fnd_Api.G_False,
308: p_validate_only IN VARCHAR2 := Fnd_Api.G_False,
309: p_commit IN VARCHAR2 := Fnd_Api.G_False,
310: p_party_id IN NUMBER,
311: p_party_version IN NUMBER,
312: p_location_id IN NUMBER,
305: PROCEDURE Update_Organization
306: (
307: p_init_msg_list IN VARCHAR2 := Fnd_Api.G_False,
308: p_validate_only IN VARCHAR2 := Fnd_Api.G_False,
309: p_commit IN VARCHAR2 := Fnd_Api.G_False,
310: p_party_id IN NUMBER,
311: p_party_version IN NUMBER,
312: p_location_id IN NUMBER,
313: p_location_version IN NUMBER,
350: /*
351: ** Initialize
352: */
353:
354: x_return_status := Fnd_Api.G_Ret_Sts_Success;
355:
356: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
357:
358: Fnd_Msg_Pub.Initialize;
352: */
353:
354: x_return_status := Fnd_Api.G_Ret_Sts_Success;
355:
356: IF Fnd_Api.To_Boolean(p_init_msg_list) THEN
357:
358: Fnd_Msg_Pub.Initialize;
359:
360: END IF;
363: l_country_code := Get_Country_Code(p_country_name);
364:
365: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
366:
367: RAISE Fnd_Api.G_Exc_Error;
368:
369: END IF;
370:
371:
372: /*
373: ** Discontinue processing if API invoked in validation mode
374: */
375:
376: IF Fnd_Api.To_Boolean(p_validate_only) THEN
377:
378: RETURN;
379:
380: END IF;
386: l_organization_rec.party_rec.status := l_status;
387:
388: Hz_Party_V2pub.Update_Organization
389: (
390: p_init_msg_list => Fnd_Api.G_False,
391: p_organization_rec => l_organization_rec,
392: p_party_object_version_number => l_party_version,
393: x_profile_id => l_profile_id,
394: x_return_status => x_return_status,
397: );
398:
399: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
400:
401: RAISE Fnd_Api.G_Exc_Error;
402:
403: END IF;
404:
405: l_location_rec.location_id := p_location_id;
414: l_location_rec.created_by_module := 'IGW';
415:
416: Hz_Location_V2pub.Update_Location
417: (
418: p_init_msg_list => Fnd_Api.G_False,
419: p_location_rec => l_location_rec,
420: p_object_version_number => l_location_version,
421: x_return_status => x_return_status,
422: x_msg_count => x_msg_count,
424: );
425:
426: IF Fnd_Msg_Pub.Count_Msg > 0 THEN
427:
428: RAISE Fnd_Api.G_Exc_Error;
429:
430: END IF;
431:
432: /*
432: /*
433: ** Commit data if API invoked in commit mode
434: */
435:
436: IF Fnd_Api.To_Boolean(p_commit) THEN
437:
438: COMMIT;
439:
440: END IF;
440: END IF;
441:
442: EXCEPTION
443:
444: WHEN Fnd_Api.G_Exc_Error THEN
445:
446: ROLLBACK TO Update_Organization_Pvt;
447:
448: x_return_status := Fnd_Api.G_Ret_Sts_Error;
444: WHEN Fnd_Api.G_Exc_Error THEN
445:
446: ROLLBACK TO Update_Organization_Pvt;
447:
448: x_return_status := Fnd_Api.G_Ret_Sts_Error;
449:
450: Fnd_Msg_Pub.Count_And_Get
451: (
452: p_count => x_msg_count,
452: p_count => x_msg_count,
453: p_data => x_msg_data
454: );
455:
456: WHEN Fnd_Api.G_Exc_Unexpected_Error THEN
457:
458: ROLLBACK TO Update_Organization_Pvt;
459:
460: x_return_status := Fnd_Api.G_Ret_Sts_Unexp_Error;
456: WHEN Fnd_Api.G_Exc_Unexpected_Error THEN
457:
458: ROLLBACK TO Update_Organization_Pvt;
459:
460: x_return_status := Fnd_Api.G_Ret_Sts_Unexp_Error;
461:
462: Fnd_Msg_Pub.Count_And_Get
463: (
464: p_count => x_msg_count,
468: WHEN others THEN
469:
470: ROLLBACK TO Update_Organization_Pvt;
471:
472: x_return_status := Fnd_Api.G_Ret_Sts_Unexp_Error;
473:
474: Fnd_Msg_Pub.Add_Exc_Msg
475: (
476: p_pkg_name => G_PKG_NAME,