3:
4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'IBE_PARTY_V2PVT';
5: G_CREATED_BY_MODULE VARCHAR2(30) := 'USER REGISTRATION';
6: G_APPLICATION_ID NUMBER := 671;
7: l_true VARCHAR2(1) := FND_API.G_TRUE;
8:
9: -----------------------public procedures -------------------------------------
10: /*=======================================================================
11: | Copyright (c) 1999 Oracle Corporation, Redwood Shores, CA, USA
64: FND_MSG_PUB.initialize;
65:
66:
67: -- Initialize API return status to success
68: x_return_status := FND_API.G_RET_STS_SUCCESS;
69:
70: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
71: IBE_UTIL.debug('Call Create_Person() API');
72: END IF;
90: IBE_UTIL.debug('After call to Create_Person - x_return_status : '|| x_return_status);
91: IBE_UTIL.debug('After call to Create_Person - x_msg_count: '|| x_msg_count);
92: IBE_UTIL.debug('After call to Create_Person - x_msg_data : '|| x_msg_data);
93: END IF;
94: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
95: RAISE FND_API.G_EXC_ERROR;
96: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
97: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
98: END IF;
91: IBE_UTIL.debug('After call to Create_Person - x_msg_count: '|| x_msg_count);
92: IBE_UTIL.debug('After call to Create_Person - x_msg_data : '|| x_msg_data);
93: END IF;
94: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
95: RAISE FND_API.G_EXC_ERROR;
96: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
97: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
98: END IF;
99:
92: IBE_UTIL.debug('After call to Create_Person - x_msg_data : '|| x_msg_data);
93: END IF;
94: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
95: RAISE FND_API.G_EXC_ERROR;
96: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
97: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
98: END IF;
99:
100: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
93: END IF;
94: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
95: RAISE FND_API.G_EXC_ERROR;
96: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
97: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
98: END IF;
99:
100: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
101: IBE_UTIL.debug('After call to Create_Person - party_id : ' || x_person_party_id);
128: IBE_UTIL.debug('After call to Update_Contact_Preference - x_msg_count : '|| x_msg_count);
129: IBE_UTIL.debug('After call to Update_Contact_Preference - x_msg_data : '|| x_msg_data);
130: END IF;
131:
132: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
133: RAISE FND_API.G_EXC_ERROR;
134: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
135: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
136: END IF;
129: IBE_UTIL.debug('After call to Update_Contact_Preference - x_msg_data : '|| x_msg_data);
130: END IF;
131:
132: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
133: RAISE FND_API.G_EXC_ERROR;
134: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
135: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
136: END IF;
137:
130: END IF;
131:
132: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
133: RAISE FND_API.G_EXC_ERROR;
134: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
135: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
136: END IF;
137:
138: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
131:
132: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
133: RAISE FND_API.G_EXC_ERROR;
134: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
135: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
136: END IF;
137:
138: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
139: IBE_UTIL.debug('After call to Update_Contact_Preference - x_contact_preference_id : ' || l_contact_preference_id);
142:
143: -- Call Create_User to create user in FND by setting
144: -- by setting the customer_id column from fnd_user table
145: -- to person_party_id
146: IF (p_username <> FND_API.G_MISS_CHAR and p_username is not null) then
147: IBE_USER_PVT.Create_User(p_user_name => p_username,
148: p_password => p_password,
149: p_start_date => sysdate,
150: p_end_date => null,
157: IBE_UTIL.debug('After call to Create_User - x_user_id : '|| to_char(x_user_id));
158: END IF;
159:
160: if (x_user_id is null) then
161: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
162: end if;
163: END IF;
164:
165:
165:
166:
167: -- standard call to get message count and if count is 1, get message info
168: FND_MSG_PUB.count_and_get(
169: p_encoded => FND_API.G_FALSE,
170: p_count => x_msg_count,
171: p_data => x_msg_data
172: );
173:
177:
178:
179: EXCEPTION
180:
181: WHEN FND_API.G_EXC_ERROR THEN
182:
183:
184:
185: x_return_status := FND_API.G_RET_STS_ERROR;
181: WHEN FND_API.G_EXC_ERROR THEN
182:
183:
184:
185: x_return_status := FND_API.G_RET_STS_ERROR;
186: FND_MSG_PUB.ADD;
187: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
188: p_data => x_msg_data,
189: p_encoded => 'F');
195: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
196: IBE_UTIL.debug('error text : '|| SQLERRM);
197: END IF;
198:
199: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
200:
201:
202: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
203: FND_MSG_PUB.ADD;
198:
199: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
200:
201:
202: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
203: FND_MSG_PUB.ADD;
204: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
205: p_data => x_msg_data,
206: p_encoded => 'F');
219: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
220: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
221: FND_MESSAGE.Set_Token('REASON', SQLERRM);
222: FND_MSG_PUB.Add;
223: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
224: FND_MSG_PUB.Add;
225: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
226: p_data => x_msg_data,
227: p_encoded => 'F');
308: FND_MSG_PUB.initialize;
309:
310:
311: -- Initialize API return status to success
312: x_return_status := FND_API.G_RET_STS_SUCCESS;
313: -- Check whether Organization exists
314:
315: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
316: IBE_UTIL.debug('Party_number : '||p_organization_rec.party_rec.party_number);
315: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
316: IBE_UTIL.debug('Party_number : '||p_organization_rec.party_rec.party_number);
317: END IF;
318: if (( p_organization_rec.party_rec.party_number is not null) AND
319: ( p_organization_rec.party_rec.party_number <> FND_API.G_MISS_CHAR)) then
320: p_org_num := p_organization_rec.party_rec.party_number;
321: end if;
322: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
323: IBE_UTIL.debug('Party_name : '||p_organization_rec.organization_name);
322: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
323: IBE_UTIL.debug('Party_name : '||p_organization_rec.organization_name);
324: END IF;
325: if ((p_organization_rec.organization_name is not null) AND
326: (p_organization_rec.organization_name <> FND_API.G_MISS_CHAR)) then
327: p_org_name := p_organization_rec.organization_name;
328: end if;
329: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
330: IBE_UTIL.debug('p_org_num : '||p_org_num);
348: END IF;
349:
350: FND_MESSAGE.SET_NAME('IBE','IBE_ERR_UM_ORG_EXISTS');
351: FND_MSG_PUB.ADD;
352: RAISE FND_API.G_EXC_ERROR;
353: end if;
354: else
355: */
356: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
365: p_party_site_rec => null,
366: p_org_workphone_rec =>p_org_phone_rec,
367: /*p_org_homephone_rec => null,*/
368: p_org_fax_rec => p_org_fax_rec,
369: p_primary_billto => FND_API.G_TRUE,
370: p_primary_shipto => FND_API.G_TRUE,
371: p_billto => FND_API.G_TRUE,
372: p_shipto => FND_API.G_TRUE,
373: p_default_primary => FND_API.G_TRUE,
366: p_org_workphone_rec =>p_org_phone_rec,
367: /*p_org_homephone_rec => null,*/
368: p_org_fax_rec => p_org_fax_rec,
369: p_primary_billto => FND_API.G_TRUE,
370: p_primary_shipto => FND_API.G_TRUE,
371: p_billto => FND_API.G_TRUE,
372: p_shipto => FND_API.G_TRUE,
373: p_default_primary => FND_API.G_TRUE,
374: p_created_by_module =>G_CREATED_BY_MODULE,
367: /*p_org_homephone_rec => null,*/
368: p_org_fax_rec => p_org_fax_rec,
369: p_primary_billto => FND_API.G_TRUE,
370: p_primary_shipto => FND_API.G_TRUE,
371: p_billto => FND_API.G_TRUE,
372: p_shipto => FND_API.G_TRUE,
373: p_default_primary => FND_API.G_TRUE,
374: p_created_by_module =>G_CREATED_BY_MODULE,
375: p_account =>'false',
368: p_org_fax_rec => p_org_fax_rec,
369: p_primary_billto => FND_API.G_TRUE,
370: p_primary_shipto => FND_API.G_TRUE,
371: p_billto => FND_API.G_TRUE,
372: p_shipto => FND_API.G_TRUE,
373: p_default_primary => FND_API.G_TRUE,
374: p_created_by_module =>G_CREATED_BY_MODULE,
375: p_account =>'false',
376: x_account_id => l_account_id,
369: p_primary_billto => FND_API.G_TRUE,
370: p_primary_shipto => FND_API.G_TRUE,
371: p_billto => FND_API.G_TRUE,
372: p_shipto => FND_API.G_TRUE,
373: p_default_primary => FND_API.G_TRUE,
374: p_created_by_module =>G_CREATED_BY_MODULE,
375: p_account =>'false',
376: x_account_id => l_account_id,
377: x_party_site_id => l_party_site_id,
379: x_return_status =>x_return_status,
380: x_msg_count =>x_msg_count,
381: x_msg_data =>x_msg_data);
382:
383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
384: RAISE FND_API.G_EXC_ERROR;
385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
387: END IF;
380: x_msg_count =>x_msg_count,
381: x_msg_data =>x_msg_data);
382:
383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
384: RAISE FND_API.G_EXC_ERROR;
385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
387: END IF;
388: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
381: x_msg_data =>x_msg_data);
382:
383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
384: RAISE FND_API.G_EXC_ERROR;
385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
387: END IF;
388: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
389: IBE_UTIL.debug('After call to Create_Organization - x_return_status : '|| x_return_status);
382:
383: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
384: RAISE FND_API.G_EXC_ERROR;
385: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
387: END IF;
388: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
389: IBE_UTIL.debug('After call to Create_Organization - x_return_status : '|| x_return_status);
390: IBE_UTIL.debug('After call to Create_Organization - x_msg_count : '|| x_msg_count);
406: END IF;
407: /* If organization does not exist then raise error */
408: FND_MESSAGE.SET_NAME('IBE','IBE_ERR_UM_ORG_NOT_FOUND');
409: FND_MSG_PUB.ADD;
410: RAISE FND_API.G_EXC_ERROR;
411: end if;
412:
413:
414: end if;
434: x_rel_party_id => l_rel_party_id,
435: x_return_status => x_return_status,
436: x_msg_count => x_msg_count,
437: x_msg_data => x_msg_data);
438: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
439: RAISE FND_API.G_EXC_ERROR;
440: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
441: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
442: END IF;
435: x_return_status => x_return_status,
436: x_msg_count => x_msg_count,
437: x_msg_data => x_msg_data);
438: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
439: RAISE FND_API.G_EXC_ERROR;
440: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
441: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
442: END IF;
443:
436: x_msg_count => x_msg_count,
437: x_msg_data => x_msg_data);
438: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
439: RAISE FND_API.G_EXC_ERROR;
440: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
441: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
442: END IF;
443:
444: x_rel_party_id := l_rel_party_id;
437: x_msg_data => x_msg_data);
438: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
439: RAISE FND_API.G_EXC_ERROR;
440: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
441: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
442: END IF;
443:
444: x_rel_party_id := l_rel_party_id;
445:
469: x_return_status => x_return_status,
470: x_msg_count => x_msg_count,
471: x_msg_data => x_msg_data) ;
472:
473: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
474: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
475: end if;
476:
477: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
470: x_msg_count => x_msg_count,
471: x_msg_data => x_msg_data) ;
472:
473: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
474: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
475: end if;
476:
477: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
478: IBE_UTIL.debug('After call to Update_Contact_Preference - x_return_status : '|| x_return_status);
483:
484: -- Call Create_User to create user in FND by setting
485: -- by setting the customer_id column from fnd_user table
486: -- to x_rel_party_id
487: IF (p_username <> FND_API.G_MISS_CHAR and p_username is not null) then
488: IBE_USER_PVT.Create_User(p_user_name => p_username,
489: p_password => p_password,
490: p_start_date => sysdate,
491: p_end_date => null,
498: IBE_UTIL.debug('After call to Create_User - x_user_id : '|| to_char(x_user_id));
499: END IF;
500:
501: if (x_user_id is null) then
502: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
503: end if;
504:
505:
506: END IF;
506: END IF;
507:
508: -- standard call to get message count and if count is 1, get message info
509: FND_MSG_PUB.count_and_get(
510: p_encoded => FND_API.G_FALSE,
511: p_count => x_msg_count,
512: p_data => x_msg_data
513: );
514:
518:
519:
520: EXCEPTION
521:
522: WHEN FND_API.G_EXC_ERROR THEN
523:
524:
525:
526: x_return_status := FND_API.G_RET_STS_ERROR;
522: WHEN FND_API.G_EXC_ERROR THEN
523:
524:
525:
526: x_return_status := FND_API.G_RET_STS_ERROR;
527: FND_MSG_PUB.ADD;
528: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
529: p_data => x_msg_data,
530: p_encoded => 'F');
536: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
537: IBE_UTIL.debug('error text : '|| SQLERRM);
538: END IF;
539:
540: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
541:
542:
543: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
544: FND_MSG_PUB.ADD;
539:
540: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
541:
542:
543: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
544: FND_MSG_PUB.ADD;
545: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
546: p_data => x_msg_data,
547: p_encoded => 'F');
560: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
561: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
562: FND_MESSAGE.Set_Token('REASON', SQLERRM);
563: FND_MSG_PUB.Add;
564: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
565: FND_MSG_PUB.Add;
566: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
567: p_data => x_msg_data,
568: p_encoded => 'F');
636: FND_MSG_PUB.initialize;
637:
638:
639: -- Initialize API return status to success
640: x_return_status := FND_API.G_RET_STS_SUCCESS;
641: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
642: IBE_UTIL.debug('Call Create_Person() API');
643: END IF;
644:
663: IBE_UTIL.debug('After call to Create_Person - x_return_status : '|| x_return_status);
664: IBE_UTIL.debug('After call to Create_Person - x_msg_count : '|| x_msg_count);
665: IBE_UTIL.debug('After call to Create_Person - x_msg_data :' || x_msg_data);
666: END IF;
667: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
668: RAISE FND_API.G_EXC_ERROR;
669: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
670: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
671: END IF;
664: IBE_UTIL.debug('After call to Create_Person - x_msg_count : '|| x_msg_count);
665: IBE_UTIL.debug('After call to Create_Person - x_msg_data :' || x_msg_data);
666: END IF;
667: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
668: RAISE FND_API.G_EXC_ERROR;
669: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
670: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
671: END IF;
672:
665: IBE_UTIL.debug('After call to Create_Person - x_msg_data :' || x_msg_data);
666: END IF;
667: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
668: RAISE FND_API.G_EXC_ERROR;
669: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
670: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
671: END IF;
672:
673: -- Create ORG Contact which internally creates party_relationship
666: END IF;
667: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
668: RAISE FND_API.G_EXC_ERROR;
669: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
670: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
671: END IF;
672:
673: -- Create ORG Contact which internally creates party_relationship
674: -- Pass person_party_id as subject_id
736: IBE_UTIL.debug('After call to HZ_PARTY_CONTACT_V2PUB.create_org_contact - x_msg_data :' || x_msg_data);
737: END IF;
738:
739:
740: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
741: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
742: end if;
743:
744: x_rel_party_id := l_rel_party_id;
737: END IF;
738:
739:
740: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
741: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
742: end if;
743:
744: x_rel_party_id := l_rel_party_id;
745: -- Create Relationship contact_points, pass rel_party_id from the
765: IBE_UTIL.debug('After call to Create_Contact_Points() - x_return_status : '|| x_return_status);
766: IBE_UTIL.debug('After call to Create_Contact_Points() - x_msg_count : '|| x_msg_count);
767: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
768: END IF;
769: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
770: RAISE FND_API.G_EXC_ERROR;
771: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
766: IBE_UTIL.debug('After call to Create_Contact_Points() - x_msg_count : '|| x_msg_count);
767: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
768: END IF;
769: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
770: RAISE FND_API.G_EXC_ERROR;
771: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
767: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
768: END IF;
769: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
770: RAISE FND_API.G_EXC_ERROR;
771: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
775:
768: END IF;
769: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
770: RAISE FND_API.G_EXC_ERROR;
771: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
775:
776:
776:
777:
778: -- standard call to get message count and if count is 1, get message info
779: FND_MSG_PUB.count_and_get(
780: p_encoded => FND_API.G_FALSE,
781: p_count => x_msg_count,
782: p_data => x_msg_data
783: );
784:
788:
789:
790: EXCEPTION
791:
792: WHEN FND_API.G_EXC_ERROR THEN
793:
794:
795:
796: x_return_status := FND_API.G_RET_STS_ERROR;
792: WHEN FND_API.G_EXC_ERROR THEN
793:
794:
795:
796: x_return_status := FND_API.G_RET_STS_ERROR;
797: FND_MSG_PUB.ADD;
798: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
799: p_data => x_msg_data,
800: p_encoded => 'F');
806: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
807: IBE_UTIL.debug('error text : '|| SQLERRM);
808: END IF;
809:
810: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
811:
812:
813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
814: FND_MSG_PUB.ADD;
809:
810: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
811:
812:
813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
814: FND_MSG_PUB.ADD;
815: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
816: p_data => x_msg_data,
817: p_encoded => 'F');
830: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
831: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
832: FND_MESSAGE.Set_Token('REASON', SQLERRM);
833: FND_MSG_PUB.Add;
834: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
835: FND_MSG_PUB.Add;
836: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
837: p_data => x_msg_data,
838: p_encoded => 'F');
907: FND_MSG_PUB.initialize;
908:
909:
910: -- Initialize API return status to success
911: x_return_status := FND_API.G_RET_STS_SUCCESS;
912:
913: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
914: IBE_UTIL.debug('Call Create_Person() API');
915: END IF;
938: x_return_status => x_return_status,
939: x_msg_count => x_msg_count,
940: x_msg_data => x_msg_data);
941:
942: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
943: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
944: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
945: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
946: END IF;
939: x_msg_count => x_msg_count,
940: x_msg_data => x_msg_data);
941:
942: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
943: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
944: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
945: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
946: END IF;
947:
940: x_msg_data => x_msg_data);
941:
942: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
943: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
944: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
945: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
946: END IF;
947:
948: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
941:
942: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
943: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
944: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
945: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
946: END IF;
947:
948: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
949: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create_person - l_party_id : '|| l_party_id);
975: IBE_UTIL.debug('After call to Create_Contact_Points() - x_return_status : '|| x_return_status);
976: IBE_UTIL.debug('After call to Create_Contact_Points() - x_msg_count : '|| x_msg_count);
977: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
978: END IF;
979: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
980: RAISE FND_API.G_EXC_ERROR;
981: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
983: END IF;
976: IBE_UTIL.debug('After call to Create_Contact_Points() - x_msg_count : '|| x_msg_count);
977: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
978: END IF;
979: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
980: RAISE FND_API.G_EXC_ERROR;
981: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
983: END IF;
984:
977: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
978: END IF;
979: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
980: RAISE FND_API.G_EXC_ERROR;
981: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
983: END IF;
984:
985: --if p_account - true then call create_account
978: END IF;
979: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
980: RAISE FND_API.G_EXC_ERROR;
981: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
983: END IF;
984:
985: --if p_account - true then call create_account
986:
1006: IBE_UTIL.debug('After call to Create_Account() - x_return_status : '|| x_return_status);
1007: IBE_UTIL.debug('After call to Create_Account() - x_msg_count : '|| x_msg_count);
1008: IBE_UTIL.debug('After call to Create_Account()- x_msg_data : '|| x_msg_data);
1009: END IF;
1010: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1011: RAISE FND_API.G_EXC_ERROR;
1012: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1013: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1014: END IF;
1007: IBE_UTIL.debug('After call to Create_Account() - x_msg_count : '|| x_msg_count);
1008: IBE_UTIL.debug('After call to Create_Account()- x_msg_data : '|| x_msg_data);
1009: END IF;
1010: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1011: RAISE FND_API.G_EXC_ERROR;
1012: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1013: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1014: END IF;
1015:
1008: IBE_UTIL.debug('After call to Create_Account()- x_msg_data : '|| x_msg_data);
1009: END IF;
1010: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1011: RAISE FND_API.G_EXC_ERROR;
1012: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1013: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1014: END IF;
1015:
1016: End if;
1009: END IF;
1010: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1011: RAISE FND_API.G_EXC_ERROR;
1012: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1013: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1014: END IF;
1015:
1016: End if;
1017: -- standard call to get message count and if count is 1, get message info
1015:
1016: End if;
1017: -- standard call to get message count and if count is 1, get message info
1018: FND_MSG_PUB.count_and_get(
1019: p_encoded => FND_API.G_FALSE,
1020: p_count => x_msg_count,
1021: p_data => x_msg_data
1022: );
1023:
1027:
1028:
1029: EXCEPTION
1030:
1031: WHEN FND_API.G_EXC_ERROR THEN
1032:
1033:
1034:
1035: x_return_status := FND_API.G_RET_STS_ERROR;
1031: WHEN FND_API.G_EXC_ERROR THEN
1032:
1033:
1034:
1035: x_return_status := FND_API.G_RET_STS_ERROR;
1036: FND_MSG_PUB.ADD;
1037: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1038: p_data => x_msg_data,
1039: p_encoded => 'F');
1045: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
1046: IBE_UTIL.debug('error text : '|| SQLERRM);
1047: END IF;
1048:
1049: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1050:
1051:
1052: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1053: FND_MSG_PUB.ADD;
1048:
1049: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1050:
1051:
1052: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1053: FND_MSG_PUB.ADD;
1054: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1055: p_data => x_msg_data,
1056: p_encoded => 'F');
1069: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1070: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1071: FND_MESSAGE.Set_Token('REASON', SQLERRM);
1072: FND_MSG_PUB.Add;
1073: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1074: FND_MSG_PUB.Add;
1075: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1076: p_data => x_msg_data,
1077: p_encoded => 'F');
1113: */
1114: p_org_fax_rec IN HZ_CONTACT_POINT_V2PUB.phone_rec_type,
1115: p_location_rec IN HZ_LOCATION_V2PUB.location_rec_type,
1116: p_party_site_rec IN HZ_PARTY_SITE_V2PUB.party_site_rec_type,
1117: p_primary_billto IN VARCHAR2 := FND_API.G_FALSE,
1118: p_primary_shipto IN VARCHAR2 := FND_API.G_FALSE,
1119: p_billto IN VARCHAR2 := FND_API.G_FALSE,
1120: p_shipto IN VARCHAR2 := FND_API.G_FALSE,
1121: p_default_primary IN VARCHAR2 := FND_API.G_FALSE,
1114: p_org_fax_rec IN HZ_CONTACT_POINT_V2PUB.phone_rec_type,
1115: p_location_rec IN HZ_LOCATION_V2PUB.location_rec_type,
1116: p_party_site_rec IN HZ_PARTY_SITE_V2PUB.party_site_rec_type,
1117: p_primary_billto IN VARCHAR2 := FND_API.G_FALSE,
1118: p_primary_shipto IN VARCHAR2 := FND_API.G_FALSE,
1119: p_billto IN VARCHAR2 := FND_API.G_FALSE,
1120: p_shipto IN VARCHAR2 := FND_API.G_FALSE,
1121: p_default_primary IN VARCHAR2 := FND_API.G_FALSE,
1122: p_created_by_module IN VARCHAR2,
1115: p_location_rec IN HZ_LOCATION_V2PUB.location_rec_type,
1116: p_party_site_rec IN HZ_PARTY_SITE_V2PUB.party_site_rec_type,
1117: p_primary_billto IN VARCHAR2 := FND_API.G_FALSE,
1118: p_primary_shipto IN VARCHAR2 := FND_API.G_FALSE,
1119: p_billto IN VARCHAR2 := FND_API.G_FALSE,
1120: p_shipto IN VARCHAR2 := FND_API.G_FALSE,
1121: p_default_primary IN VARCHAR2 := FND_API.G_FALSE,
1122: p_created_by_module IN VARCHAR2,
1123: p_account IN VARCHAR2 ,
1116: p_party_site_rec IN HZ_PARTY_SITE_V2PUB.party_site_rec_type,
1117: p_primary_billto IN VARCHAR2 := FND_API.G_FALSE,
1118: p_primary_shipto IN VARCHAR2 := FND_API.G_FALSE,
1119: p_billto IN VARCHAR2 := FND_API.G_FALSE,
1120: p_shipto IN VARCHAR2 := FND_API.G_FALSE,
1121: p_default_primary IN VARCHAR2 := FND_API.G_FALSE,
1122: p_created_by_module IN VARCHAR2,
1123: p_account IN VARCHAR2 ,
1124: x_org_party_id OUT NOCOPY NUMBER,
1117: p_primary_billto IN VARCHAR2 := FND_API.G_FALSE,
1118: p_primary_shipto IN VARCHAR2 := FND_API.G_FALSE,
1119: p_billto IN VARCHAR2 := FND_API.G_FALSE,
1120: p_shipto IN VARCHAR2 := FND_API.G_FALSE,
1121: p_default_primary IN VARCHAR2 := FND_API.G_FALSE,
1122: p_created_by_module IN VARCHAR2,
1123: p_account IN VARCHAR2 ,
1124: x_org_party_id OUT NOCOPY NUMBER,
1125: x_account_id OUT NOCOPY NUMBER,
1161: FND_MSG_PUB.initialize;
1162:
1163:
1164: -- Initialize API return status to success
1165: x_return_status := FND_API.G_RET_STS_SUCCESS;
1166:
1167: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1168: IBE_UTIL.debug('Call Create_Organization() API');
1169: END IF;
1196: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create_organization - x_return_status : '|| x_return_status);
1197: IBE_UTIL.debug('After call HZ_PARTY_V2PUB.create_organization - x_msg_count : '|| x_msg_count);
1198: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create_organization - x_msg_data : '|| x_msg_data);
1199: END IF;
1200: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1201: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1202: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1204: END IF;
1197: IBE_UTIL.debug('After call HZ_PARTY_V2PUB.create_organization - x_msg_count : '|| x_msg_count);
1198: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create_organization - x_msg_data : '|| x_msg_data);
1199: END IF;
1200: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1201: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1202: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1204: END IF;
1205:
1198: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create_organization - x_msg_data : '|| x_msg_data);
1199: END IF;
1200: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1201: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1202: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1204: END IF;
1205:
1206:
1199: END IF;
1200: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1201: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1202: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1204: END IF;
1205:
1206:
1207: x_org_party_id := l_party_id;
1235: x_return_status => x_return_status,
1236: x_msg_count => x_msg_count,
1237: x_msg_data => x_msg_data);
1238:
1239: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1240: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1241: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1242: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1243: END IF;
1236: x_msg_count => x_msg_count,
1237: x_msg_data => x_msg_data);
1238:
1239: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1240: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1241: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1242: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1243: END IF;
1244: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1237: x_msg_data => x_msg_data);
1238:
1239: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1240: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1241: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1242: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1243: END IF;
1244: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1245: IBE_UTIL.debug('After call to IBE_ADDRESS_V2PVT.create_address - l_location_id : '|| l_location_id);
1238:
1239: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1240: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1241: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1242: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1243: END IF;
1244: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1245: IBE_UTIL.debug('After call to IBE_ADDRESS_V2PVT.create_address - l_location_id : '|| l_location_id);
1246: IBE_UTIL.debug('After call to IBE_ADDRESS_V2PVT.create_address - x_party_site_id : '|| x_party_site_id);
1273: IBE_UTIL.debug('After call to Create_Contact_Points() - x_return_status : '|| x_return_status);
1274: IBE_UTIL.debug('After call to Create_Contact_Points() - x_msg_count : '|| x_msg_count);
1275: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
1276: END IF;
1277: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1278: RAISE FND_API.G_EXC_ERROR;
1279: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1280: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1281: END IF;
1274: IBE_UTIL.debug('After call to Create_Contact_Points() - x_msg_count : '|| x_msg_count);
1275: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
1276: END IF;
1277: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1278: RAISE FND_API.G_EXC_ERROR;
1279: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1280: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1281: END IF;
1282:
1275: IBE_UTIL.debug('After call to Create_Contact_Points()- x_msg_data : '|| x_msg_data);
1276: END IF;
1277: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1278: RAISE FND_API.G_EXC_ERROR;
1279: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1280: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1281: END IF;
1282:
1283:
1276: END IF;
1277: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1278: RAISE FND_API.G_EXC_ERROR;
1279: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1280: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1281: END IF;
1282:
1283:
1284:
1308: IBE_UTIL.debug('After call to Create_Account() - x_account_id : '|| x_account_id);
1309: IBE_UTIL.debug('After call to Create_Account() - x_msg_count : '|| x_msg_count);
1310: IBE_UTIL.debug('After call to Create_Account()- x_msg_data : '|| x_msg_data);
1311: END IF;
1312: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1313: RAISE FND_API.G_EXC_ERROR;
1314: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1315: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1316: END IF;
1309: IBE_UTIL.debug('After call to Create_Account() - x_msg_count : '|| x_msg_count);
1310: IBE_UTIL.debug('After call to Create_Account()- x_msg_data : '|| x_msg_data);
1311: END IF;
1312: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1313: RAISE FND_API.G_EXC_ERROR;
1314: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1315: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1316: END IF;
1317:
1310: IBE_UTIL.debug('After call to Create_Account()- x_msg_data : '|| x_msg_data);
1311: END IF;
1312: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1313: RAISE FND_API.G_EXC_ERROR;
1314: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1315: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1316: END IF;
1317:
1318: End if;
1311: END IF;
1312: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
1313: RAISE FND_API.G_EXC_ERROR;
1314: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1315: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1316: END IF;
1317:
1318: End if;
1319: -- standard call to get message count and if count is 1, get message info
1317:
1318: End if;
1319: -- standard call to get message count and if count is 1, get message info
1320: FND_MSG_PUB.count_and_get(
1321: p_encoded => FND_API.G_FALSE,
1322: p_count => x_msg_count,
1323: p_data => x_msg_data
1324: );
1325:
1329:
1330:
1331: EXCEPTION
1332:
1333: WHEN FND_API.G_EXC_ERROR THEN
1334:
1335:
1336:
1337: x_return_status := FND_API.G_RET_STS_ERROR;
1333: WHEN FND_API.G_EXC_ERROR THEN
1334:
1335:
1336:
1337: x_return_status := FND_API.G_RET_STS_ERROR;
1338: FND_MSG_PUB.ADD;
1339: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1340: p_data => x_msg_data,
1341: p_encoded => 'F');
1347: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
1348: IBE_UTIL.debug('error text : '|| SQLERRM);
1349: END IF;
1350:
1351: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1352:
1353:
1354: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1355: FND_MSG_PUB.ADD;
1350:
1351: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1352:
1353:
1354: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1355: FND_MSG_PUB.ADD;
1356: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1357: p_data => x_msg_data,
1358: p_encoded => 'F');
1371: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1372: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1373: FND_MESSAGE.Set_Token('REASON', SQLERRM);
1374: FND_MSG_PUB.Add;
1375: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1376: FND_MSG_PUB.Add;
1377: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1378: p_data => x_msg_data,
1379: p_encoded => 'F');
1442: IBE_UTIL.debug('Enter Create_Contact_Points()');
1443: END IF;
1444:
1445: -- Initialize API return status to success
1446: x_return_status := FND_API.G_RET_STS_SUCCESS;
1447: l_contact_point_rec.contact_point_type := null;
1448: if (p_email_rec.email_address is not NULL) then
1449:
1450: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1463: x_msg_data => x_msg_data);
1464: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1465: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_email_contact_point l_contact_point_id : '|| l_contact_point_id);
1466: END IF;
1467: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1468: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1469: end if;
1470:
1471: end if;
1464: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1465: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_email_contact_point l_contact_point_id : '|| l_contact_point_id);
1466: END IF;
1467: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1468: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1469: end if;
1470:
1471: end if;
1472:
1495: x_msg_data => x_msg_data );
1496: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1497: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_phone_contact_point(work) - l_contact_point_id : '|| l_contact_point_id);
1498: END IF;
1499: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1500: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1501: end if;
1502: end if;
1503:
1496: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1497: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_phone_contact_point(work) - l_contact_point_id : '|| l_contact_point_id);
1498: END IF;
1499: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1500: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1501: end if;
1502: end if;
1503:
1504: l_contact_point_rec.contact_point_type := null;
1528: x_msg_data => x_msg_data );
1529: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1530: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (home)- l_contact_point_id : '|| l_contact_point_id);
1531: END IF;
1532: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1533: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1534: end if;
1535: end if;
1536: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1529: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1530: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (home)- l_contact_point_id : '|| l_contact_point_id);
1531: END IF;
1532: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1533: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1534: end if;
1535: end if;
1536: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1537: IBE_UTIL.debug('Fax_phone_Number : '|| p_fax_rec.phone_number);
1559: x_msg_data => x_msg_data );
1560: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1561: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (fax)- l_contact_point_id : '|| l_contact_point_id);
1562: END IF;
1563: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1564: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1565: end if;
1566: end if;
1567: -- standard call to get message count and if count is 1, get message info
1560: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1561: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (fax)- l_contact_point_id : '|| l_contact_point_id);
1562: END IF;
1563: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1564: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1565: end if;
1566: end if;
1567: -- standard call to get message count and if count is 1, get message info
1568: FND_MSG_PUB.count_and_get(
1565: end if;
1566: end if;
1567: -- standard call to get message count and if count is 1, get message info
1568: FND_MSG_PUB.count_and_get(
1569: p_encoded => FND_API.G_FALSE,
1570: p_count => x_msg_count,
1571: p_data => x_msg_data
1572: );
1573:
1577:
1578:
1579: EXCEPTION
1580:
1581: WHEN FND_API.G_EXC_ERROR THEN
1582:
1583:
1584:
1585: x_return_status := FND_API.G_RET_STS_ERROR;
1581: WHEN FND_API.G_EXC_ERROR THEN
1582:
1583:
1584:
1585: x_return_status := FND_API.G_RET_STS_ERROR;
1586: FND_MSG_PUB.ADD;
1587: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1588: p_data => x_msg_data,
1589: p_encoded => 'F');
1595: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
1596: IBE_UTIL.debug('error text : '|| SQLERRM);
1597: END IF;
1598:
1599: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1600:
1601:
1602: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1603: FND_MSG_PUB.ADD;
1598:
1599: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1600:
1601:
1602: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1603: FND_MSG_PUB.ADD;
1604: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1605: p_data => x_msg_data,
1606: p_encoded => 'F');
1619: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
1620: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
1621: FND_MESSAGE.Set_Token('REASON', SQLERRM);
1622: FND_MSG_PUB.Add;
1623: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1624: FND_MSG_PUB.Add;
1625: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1626: p_data => x_msg_data,
1627: p_encoded => 'F');
1699: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1700: IBE_UTIL.debug('Call HZ_CONTACT_PREFERENCE_V2PUB.update_contact_preference API');
1701: END IF;
1702: HZ_CONTACT_PREFERENCE_V2PUB.update_contact_preference(
1703: FND_API.G_FALSE,
1704: l_contact_preference_rec,
1705: l_object_version_number,
1706: x_return_status,
1707: x_msg_count,
1727: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1728: IBE_UTIL.debug('Call HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference API');
1729: END IF;
1730: HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference(
1731: FND_API.G_FALSE,
1732: l_contact_preference_rec2,
1733: l_contact_preference_id,
1734: x_return_status,
1735: x_msg_count,
1747: IBE_UTIL.debug('Before FND_MSG_API.count_and_get');
1748: END IF;
1749:
1750: FND_MSG_PUB.count_and_get(
1751: p_encoded => FND_API.G_FALSE,
1752: p_count => x_msg_count,
1753: p_data => x_msg_data
1754: );
1755:
1758: END IF;
1759:
1760: --standard exception catching for main body
1761: EXCEPTION
1762: WHEN FND_API.G_EXC_ERROR THEN
1763: --IBE_UTIL.enable_debug();
1764:
1765: x_return_status := FND_API.G_RET_STS_ERROR;
1766:
1761: EXCEPTION
1762: WHEN FND_API.G_EXC_ERROR THEN
1763: --IBE_UTIL.enable_debug();
1764:
1765: x_return_status := FND_API.G_RET_STS_ERROR;
1766:
1767: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1768: IBE_UTIL.debug('Before FND_MSG_API.count_and_get in Exception');
1769: END IF;
1767: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1768: IBE_UTIL.debug('Before FND_MSG_API.count_and_get in Exception');
1769: END IF;
1770: FND_MSG_PUB.count_and_get(
1771: p_encoded => FND_API.G_FALSE,
1772: p_count => x_msg_count,
1773: p_data => x_msg_data
1774: );
1775: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1781: END IF;
1782:
1783: --IBE_UTIL.disable_debug();
1784:
1785: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1786: --IBE_UTIL.enable_debug();
1787:
1788: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1789: FND_MSG_PUB.count_and_get(
1784:
1785: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1786: --IBE_UTIL.enable_debug();
1787:
1788: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1789: FND_MSG_PUB.count_and_get(
1790: p_encoded => FND_API.G_FALSE,
1791: p_count => x_msg_count,
1792: p_data => x_msg_data
1786: --IBE_UTIL.enable_debug();
1787:
1788: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1789: FND_MSG_PUB.count_and_get(
1790: p_encoded => FND_API.G_FALSE,
1791: p_count => x_msg_count,
1792: p_data => x_msg_data
1793: );
1794: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1803: WHEN OTHERS THEN
1804:
1805:
1806:
1807: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1808: FND_MSG_PUB.count_and_get(
1809: p_encoded => FND_API.G_FALSE,
1810: p_count => x_msg_count,
1811: p_data => x_msg_data
1805:
1806:
1807: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1808: FND_MSG_PUB.count_and_get(
1809: p_encoded => FND_API.G_FALSE,
1810: p_count => x_msg_count,
1811: p_data => x_msg_data
1812: );
1813: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1944:
1945:
1946: -- standard call to get message count and if count is 1, get message info
1947: FND_MSG_PUB.count_and_get(
1948: p_encoded => FND_API.G_FALSE,
1949: p_count => x_msg_count,
1950: p_data => x_msg_data
1951: );
1952: --IBE_UTIL.disable_debug();
1952: --IBE_UTIL.disable_debug();
1953:
1954: --standard exception catching for main body
1955: EXCEPTION
1956: WHEN FND_API.G_EXC_ERROR THEN
1957:
1958: x_return_status := FND_API.G_RET_STS_ERROR;
1959: FND_MSG_PUB.count_and_get(
1960: p_encoded => FND_API.G_FALSE,
1954: --standard exception catching for main body
1955: EXCEPTION
1956: WHEN FND_API.G_EXC_ERROR THEN
1957:
1958: x_return_status := FND_API.G_RET_STS_ERROR;
1959: FND_MSG_PUB.count_and_get(
1960: p_encoded => FND_API.G_FALSE,
1961: p_count => x_msg_count,
1962: p_data => x_msg_data
1956: WHEN FND_API.G_EXC_ERROR THEN
1957:
1958: x_return_status := FND_API.G_RET_STS_ERROR;
1959: FND_MSG_PUB.count_and_get(
1960: p_encoded => FND_API.G_FALSE,
1961: p_count => x_msg_count,
1962: p_data => x_msg_data
1963: );
1964: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1969: IBE_UTIL.debug('error text : '|| SQLERRM);
1970: END IF;
1971:
1972:
1973: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1974:
1975: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1976: FND_MSG_PUB.count_and_get(
1977: p_encoded => FND_API.G_FALSE,
1971:
1972:
1973: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1974:
1975: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1976: FND_MSG_PUB.count_and_get(
1977: p_encoded => FND_API.G_FALSE,
1978: p_count => x_msg_count,
1979: p_data => x_msg_data
1973: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1974:
1975: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1976: FND_MSG_PUB.count_and_get(
1977: p_encoded => FND_API.G_FALSE,
1978: p_count => x_msg_count,
1979: p_data => x_msg_data
1980: );
1981: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1990: WHEN OTHERS THEN
1991:
1992:
1993: ROLLBACK TO person_language;
1994: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1995: FND_MSG_PUB.count_and_get(
1996: p_encoded => FND_API.G_FALSE,
1997: p_count => x_msg_count,
1998: p_data => x_msg_data
1992:
1993: ROLLBACK TO person_language;
1994: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1995: FND_MSG_PUB.count_and_get(
1996: p_encoded => FND_API.G_FALSE,
1997: p_count => x_msg_count,
1998: p_data => x_msg_data
1999: );
2000: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2060: -- initialize message list if p_init_msg_list is set to TRUE.
2061: FND_MSG_PUB.initialize;
2062:
2063: -- Initialize API return status to success
2064: x_return_status := FND_API.G_RET_STS_SUCCESS;
2065: BEGIN
2066: -- pass the account_number if auto generation is off
2067: l_gen_cust_num := HZ_MO_GLOBAL_CACHE.get_generate_customer_number();
2068: exception when no_data_found then
2107: HZ_CUST_ACCOUNT_V2PUB.create_cust_account(
2108: p_cust_account_rec =>ddp_account_rec,
2109: p_person_rec =>ddp_person_rec,
2110: p_customer_profile_rec=>ddp_cust_profile_rec,
2111: p_create_profile_amt => FND_API.G_FALSE,
2112: x_return_status =>x_return_status,
2113: x_msg_count =>x_msg_count,
2114: x_msg_data =>x_msg_data,
2115: x_cust_account_id => x_account_id,
2126: HZ_CUST_ACCOUNT_V2PUB.create_cust_account(
2127: p_cust_account_rec =>ddp_account_rec,
2128: p_organization_rec =>ddp_organization_rec,
2129: p_customer_profile_rec=>ddp_cust_profile_rec,
2130: p_create_profile_amt => FND_API.G_FALSE,
2131: x_return_status =>x_return_status,
2132: x_msg_count =>x_msg_count,
2133: x_msg_data =>x_msg_data,
2134: x_cust_account_id => x_account_id,
2137: x_party_number =>l_party_number,
2138: x_profile_id => l_profile_id);
2139: End if;
2140:
2141: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2142: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2143: end if;
2144:
2145: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2138: x_profile_id => l_profile_id);
2139: End if;
2140:
2141: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2142: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2143: end if;
2144:
2145: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2146: IBE_UTIL.debug('exit ibe_party_v2.create_account');
2148:
2149:
2150: EXCEPTION
2151:
2152: WHEN FND_API.G_EXC_ERROR THEN
2153:
2154: x_return_status := FND_API.G_RET_STS_ERROR;
2155: FND_MSG_PUB.ADD;
2156: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2150: EXCEPTION
2151:
2152: WHEN FND_API.G_EXC_ERROR THEN
2153:
2154: x_return_status := FND_API.G_RET_STS_ERROR;
2155: FND_MSG_PUB.ADD;
2156: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2157: p_data => x_msg_data,
2158: p_encoded => 'F');
2164: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
2165: IBE_UTIL.debug('error text : '|| SQLERRM);
2166: END IF;
2167:
2168: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2169:
2170:
2171: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2172: FND_MSG_PUB.ADD;
2167:
2168: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2169:
2170:
2171: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2172: FND_MSG_PUB.ADD;
2173: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2174: p_data => x_msg_data,
2175: p_encoded => 'F');
2188: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
2189: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
2190: FND_MESSAGE.Set_Token('REASON', SQLERRM);
2191: FND_MSG_PUB.Add;
2192: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2193: FND_MSG_PUB.Add;
2194: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2195: p_data => x_msg_data,
2196: p_encoded => 'F');
2227: +======================================================================*/
2228: Procedure Update_Party_Status(
2229: p_party_id IN NUMBER,
2230: p_party_status IN VARCHAR2,
2231: p_change_org_status IN VARCHAR2 := FND_API.G_FALSE,
2232: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2233: x_return_status OUT NOCOPY VARCHAR2,
2234: x_msg_count OUT NOCOPY NUMBER,
2235: x_msg_data OUT NOCOPY VARCHAR2) is
2228: Procedure Update_Party_Status(
2229: p_party_id IN NUMBER,
2230: p_party_status IN VARCHAR2,
2231: p_change_org_status IN VARCHAR2 := FND_API.G_FALSE,
2232: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2233: x_return_status OUT NOCOPY VARCHAR2,
2234: x_msg_count OUT NOCOPY NUMBER,
2235: x_msg_data OUT NOCOPY VARCHAR2) is
2236:
2299: END IF;
2300: -- initialize message list if p_init_msg_list is set to TRUE.
2301: FND_MSG_PUB.initialize;
2302: -- Initialize API return status to success
2303: x_return_status := FND_API.G_RET_STS_SUCCESS;
2304:
2305: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2306: IBE_UTIL.debug('Input party_Id is '||p_party_id);
2307: END IF;
2372: EXIT WHEN c_getPersonOrgPartyId%notfound;
2373: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2374: IBE_UTIL.debug('update person_party_id'||l_person_party_id);
2375: END IF;
2376: update_party_status(l_person_party_id,p_party_status,FND_API.G_FALSE,FND_API.G_FALSE,x_return_status,x_msg_count,x_msg_data);
2377: IF (FND_API.To_Boolean(p_change_org_status))THEN
2378: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2379: IBE_UTIL.debug('change_org_status = True, update org_id'||l_org_id);
2380: END IF;
2373: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2374: IBE_UTIL.debug('update person_party_id'||l_person_party_id);
2375: END IF;
2376: update_party_status(l_person_party_id,p_party_status,FND_API.G_FALSE,FND_API.G_FALSE,x_return_status,x_msg_count,x_msg_data);
2377: IF (FND_API.To_Boolean(p_change_org_status))THEN
2378: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2379: IBE_UTIL.debug('change_org_status = True, update org_id'||l_org_id);
2380: END IF;
2381: update_party_status(l_org_id,p_party_status,FND_API.G_FALSE,FND_API.G_FALSE,x_return_status,x_msg_count,x_msg_data);
2377: IF (FND_API.To_Boolean(p_change_org_status))THEN
2378: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2379: IBE_UTIL.debug('change_org_status = True, update org_id'||l_org_id);
2380: END IF;
2381: update_party_status(l_org_id,p_party_status,FND_API.G_FALSE,FND_API.G_FALSE,x_return_status,x_msg_count,x_msg_data);
2382: END IF;
2383: END LOOP;
2384: CLOSE c_getPersonOrgPartyId;
2385: ELSIF(l_party_type = 'ORGANIZATION') THEN
2502: END IF;
2503: exit when c_getContactPref%notfound;
2504: end loop;
2505: END IF;
2506: IF FND_API.To_Boolean( p_commit ) THEN
2507: COMMIT WORK;
2508: END IF;
2509: EXCEPTION
2510: WHEN FND_API.G_EXC_ERROR THEN
2506: IF FND_API.To_Boolean( p_commit ) THEN
2507: COMMIT WORK;
2508: END IF;
2509: EXCEPTION
2510: WHEN FND_API.G_EXC_ERROR THEN
2511: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2512: IBE_UTIL.debug('Expected Error');
2513: END IF;
2514: x_return_status := FND_API.G_RET_STS_ERROR;
2510: WHEN FND_API.G_EXC_ERROR THEN
2511: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2512: IBE_UTIL.debug('Expected Error');
2513: END IF;
2514: x_return_status := FND_API.G_RET_STS_ERROR;
2515: FND_MSG_PUB.ADD;
2516: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2517: p_data => x_msg_data,
2518: p_encoded => 'F');
2524: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
2525: IBE_UTIL.debug('error text : '|| SQLERRM);
2526: END IF;
2527:
2528: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2529:
2530: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2531: IBE_UTIL.debug('UnExpected Error');
2532: END IF;
2529:
2530: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2531: IBE_UTIL.debug('UnExpected Error');
2532: END IF;
2533: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2534: FND_MSG_PUB.ADD;
2535: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2536: p_data => x_msg_data,
2537: p_encoded => 'F');
2551: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
2552: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
2553: FND_MESSAGE.Set_Token('REASON', SQLERRM);
2554: FND_MSG_PUB.Add;
2555: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2556: FND_MSG_PUB.Add;
2557: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
2558: p_data => x_msg_data,
2559: p_encoded => 'F');
2808:
2809: l_org_name HZ_PARTIES.PARTY_NAME%TYPE := null;
2810:
2811: l_person_party_id NUMBER := l_person_rec.party_rec.party_id;
2812: l_rel_party_id NUMBER := FND_API.G_MISS_NUM;
2813: l_org_party_id NUMBER := l_organization_rec.party_rec.party_id;
2814:
2815: BEGIN
2816: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2820: -- initialize message list
2821: FND_MSG_PUB.initialize;
2822:
2823: -- Initialize API return status to success
2824: x_return_status := FND_API.G_RET_STS_SUCCESS;
2825:
2826: -- Create or Update Person
2827: IF ( l_person_rec.party_rec.party_id = FND_API.G_MISS_NUM or l_person_rec.party_rec.party_id is NULL) THEN
2828: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2823: -- Initialize API return status to success
2824: x_return_status := FND_API.G_RET_STS_SUCCESS;
2825:
2826: -- Create or Update Person
2827: IF ( l_person_rec.party_rec.party_id = FND_API.G_MISS_NUM or l_person_rec.party_rec.party_id is NULL) THEN
2828: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2829: IBE_UTIL.debug('Call HZ_PARTY_V2PUB.create_person () API');
2830: END IF;
2831: l_person_rec.created_by_module := p_created_by_module;
2839: x_msg_data => x_msg_data);
2840: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2841: IBE_UTIL.debug('Completed Call HZ_PARTY_V2PUB.create_person () API');
2842: END IF;
2843: ELSIF ( l_person_object_version_number <> FND_API.G_MISS_NUM ) THEN
2844: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2845: IBE_UTIL.debug('Call HZ_PARTY_V2PUB.update_person () API');
2846: END IF;
2847:
2870: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create/update person - x_msg_count : '|| x_msg_count);
2871: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create/update person - x_msg_data :' || x_msg_data);
2872: END IF;
2873:
2874: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2875: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2876: END IF;
2877:
2878: -- Create or Update Organization
2871: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create/update person - x_msg_data :' || x_msg_data);
2872: END IF;
2873:
2874: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2875: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2876: END IF;
2877:
2878: -- Create or Update Organization
2879: IF ( l_organization_rec.party_rec.party_id = FND_API.G_MISS_NUM Or l_organization_rec.party_rec.party_id is NULL) THEN
2875: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2876: END IF;
2877:
2878: -- Create or Update Organization
2879: IF ( l_organization_rec.party_rec.party_id = FND_API.G_MISS_NUM Or l_organization_rec.party_rec.party_id is NULL) THEN
2880: IF( l_organization_rec.organization_name is not null AND l_organization_rec.organization_name <> FND_API.G_MISS_CHAR) THEN
2881: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2882: IBE_UTIL.debug('Call HZ_PARTY_V2PUB.create_organization () API');
2883: END IF;
2876: END IF;
2877:
2878: -- Create or Update Organization
2879: IF ( l_organization_rec.party_rec.party_id = FND_API.G_MISS_NUM Or l_organization_rec.party_rec.party_id is NULL) THEN
2880: IF( l_organization_rec.organization_name is not null AND l_organization_rec.organization_name <> FND_API.G_MISS_CHAR) THEN
2881: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2882: IBE_UTIL.debug('Call HZ_PARTY_V2PUB.create_organization () API');
2883: END IF;
2884:
2903: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create/update organization - x_msg_count : '|| x_msg_count);
2904: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create/update organization - x_msg_data :' || x_msg_data);
2905: END IF;
2906: END IF;
2907: ELSIF ( l_org_object_version_number <> FND_API.G_MISS_NUM ) THEN
2908: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2909: IBE_UTIL.debug('Call HZ_PARTY_V2PUB.update_organization () API');
2910: END IF;
2911:
2932: IBE_UTIL.debug('After call to HZ_PARTY_V2PUB.create/update organization - x_msg_data :' || x_msg_data);
2933: END IF;
2934: END IF;
2935:
2936: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2937: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2938: END IF;
2939: IF ( (l_org_party_id is null OR l_org_party_id=FND_API.G_MISS_NUM)
2940: AND l_organization_rec.party_rec.party_number is not null AND l_organization_rec.party_rec.party_number <> FND_API.G_MISS_CHAR) THEN
2933: END IF;
2934: END IF;
2935:
2936: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2937: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2938: END IF;
2939: IF ( (l_org_party_id is null OR l_org_party_id=FND_API.G_MISS_NUM)
2940: AND l_organization_rec.party_rec.party_number is not null AND l_organization_rec.party_rec.party_number <> FND_API.G_MISS_CHAR) THEN
2941:
2935:
2936: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2937: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2938: END IF;
2939: IF ( (l_org_party_id is null OR l_org_party_id=FND_API.G_MISS_NUM)
2940: AND l_organization_rec.party_rec.party_number is not null AND l_organization_rec.party_rec.party_number <> FND_API.G_MISS_CHAR) THEN
2941:
2942: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2943: IBE_UTIL.debug('Getting the org_id for the party_number: '|| l_organization_rec.party_rec.party_number );
2936: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
2937: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2938: END IF;
2939: IF ( (l_org_party_id is null OR l_org_party_id=FND_API.G_MISS_NUM)
2940: AND l_organization_rec.party_rec.party_number is not null AND l_organization_rec.party_rec.party_number <> FND_API.G_MISS_CHAR) THEN
2941:
2942: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2943: IBE_UTIL.debug('Getting the org_id for the party_number: '|| l_organization_rec.party_rec.party_number );
2944: END IF;
2958: END IF;
2959: END IF;
2960:
2961: -- Create Location and Party Site
2962: IF(l_organization_rec.party_rec.party_id is not null AND l_organization_rec.party_rec.party_id <> FND_API.G_MISS_NUM
2963: AND l_location_rec.Address1 is not null AND l_location_rec.Address1 <> FND_API.G_MISS_CHAR
2964: AND l_location_rec.Country is not null AND l_location_rec.Country <> FND_API.G_MISS_CHAR
2965: ) THEN -- Creating Location only for Organization in B2B flow.
2966: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2959: END IF;
2960:
2961: -- Create Location and Party Site
2962: IF(l_organization_rec.party_rec.party_id is not null AND l_organization_rec.party_rec.party_id <> FND_API.G_MISS_NUM
2963: AND l_location_rec.Address1 is not null AND l_location_rec.Address1 <> FND_API.G_MISS_CHAR
2964: AND l_location_rec.Country is not null AND l_location_rec.Country <> FND_API.G_MISS_CHAR
2965: ) THEN -- Creating Location only for Organization in B2B flow.
2966: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2967: IBE_UTIL.debug('Before Saving the Location - country: ' || l_location_rec.country);
2960:
2961: -- Create Location and Party Site
2962: IF(l_organization_rec.party_rec.party_id is not null AND l_organization_rec.party_rec.party_id <> FND_API.G_MISS_NUM
2963: AND l_location_rec.Address1 is not null AND l_location_rec.Address1 <> FND_API.G_MISS_CHAR
2964: AND l_location_rec.Country is not null AND l_location_rec.Country <> FND_API.G_MISS_CHAR
2965: ) THEN -- Creating Location only for Organization in B2B flow.
2966: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2967: IBE_UTIL.debug('Before Saving the Location - country: ' || l_location_rec.country);
2968: IBE_UTIL.debug('Before Saving the Location - address1: ' || l_location_rec.address1);
2966: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2967: IBE_UTIL.debug('Before Saving the Location - country: ' || l_location_rec.country);
2968: IBE_UTIL.debug('Before Saving the Location - address1: ' || l_location_rec.address1);
2969: END IF;
2970: IF ( l_location_rec.location_id = FND_API.G_MISS_NUM OR l_location_rec.location_id is NULL) THEN
2971: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2972: IBE_UTIL.debug('Call IBE_ADDRESS_V2PVT.create_address API');
2973: END IF;
2974:
2984: p_init_msg_list => null,
2985: p_commit => null,
2986: p_location => l_location_rec,
2987: p_party_site => l_party_site_rec,
2988: p_primary_billto => FND_API.G_TRUE,
2989: p_primary_shipto => FND_API.G_TRUE,
2990: p_billto => FND_API.G_TRUE,
2991: p_shipto => FND_API.G_TRUE,
2992: p_default_primary => FND_API.G_TRUE,
2985: p_commit => null,
2986: p_location => l_location_rec,
2987: p_party_site => l_party_site_rec,
2988: p_primary_billto => FND_API.G_TRUE,
2989: p_primary_shipto => FND_API.G_TRUE,
2990: p_billto => FND_API.G_TRUE,
2991: p_shipto => FND_API.G_TRUE,
2992: p_default_primary => FND_API.G_TRUE,
2993: x_location_id => l_location_id,
2986: p_location => l_location_rec,
2987: p_party_site => l_party_site_rec,
2988: p_primary_billto => FND_API.G_TRUE,
2989: p_primary_shipto => FND_API.G_TRUE,
2990: p_billto => FND_API.G_TRUE,
2991: p_shipto => FND_API.G_TRUE,
2992: p_default_primary => FND_API.G_TRUE,
2993: x_location_id => l_location_id,
2994: x_party_site_id => l_party_site_id,
2987: p_party_site => l_party_site_rec,
2988: p_primary_billto => FND_API.G_TRUE,
2989: p_primary_shipto => FND_API.G_TRUE,
2990: p_billto => FND_API.G_TRUE,
2991: p_shipto => FND_API.G_TRUE,
2992: p_default_primary => FND_API.G_TRUE,
2993: x_location_id => l_location_id,
2994: x_party_site_id => l_party_site_id,
2995: x_return_status => x_return_status,
2988: p_primary_billto => FND_API.G_TRUE,
2989: p_primary_shipto => FND_API.G_TRUE,
2990: p_billto => FND_API.G_TRUE,
2991: p_shipto => FND_API.G_TRUE,
2992: p_default_primary => FND_API.G_TRUE,
2993: x_location_id => l_location_id,
2994: x_party_site_id => l_party_site_id,
2995: x_return_status => x_return_status,
2996: x_msg_count => x_msg_count,
3007: IBE_UTIL.debug('After call to IBE_ADDRESS_V2PVT.create_address - l_location_id : '|| l_location_id);
3008: IBE_UTIL.debug('After call to IBE_ADDRESS_V2PVT.create_address - l_party_site_id : '|| l_party_site_id);
3009: END IF;
3010:
3011: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3012: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3013: END IF;
3014:
3015: ELSIF ( l_loc_object_version_number <> FND_API.G_MISS_NUM ) THEN
3008: IBE_UTIL.debug('After call to IBE_ADDRESS_V2PVT.create_address - l_party_site_id : '|| l_party_site_id);
3009: END IF;
3010:
3011: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3012: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3013: END IF;
3014:
3015: ELSIF ( l_loc_object_version_number <> FND_API.G_MISS_NUM ) THEN
3016: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3011: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3012: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3013: END IF;
3014:
3015: ELSIF ( l_loc_object_version_number <> FND_API.G_MISS_NUM ) THEN
3016: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3017: IBE_UTIL.debug('Call HZ_LOCATION_V2PUB.update_location () API');
3018: END IF;
3019:
3033: IBE_UTIL.debug('After call to HZ_LOCATION_V2PUB.update_location - x_msg_count : '|| x_msg_count);
3034: IBE_UTIL.debug('After call to HZ_LOCATION_V2PUB.update_location - x_msg_data :' || x_msg_data);
3035: END IF;
3036:
3037: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3038: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3039: END IF;
3040: END IF;
3041: END IF; -- if(Organization Name is not NULL)
3034: IBE_UTIL.debug('After call to HZ_LOCATION_V2PUB.update_location - x_msg_data :' || x_msg_data);
3035: END IF;
3036:
3037: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3038: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3039: END IF;
3040: END IF;
3041: END IF; -- if(Organization Name is not NULL)
3042:
3042:
3043: IF (p_create_party_rel = 'Y') THEN
3044: OPEN c_get_party_relationship(l_person_party_id, l_org_party_id);
3045: FETCH c_get_party_relationship into l_rel_party_id;
3046: IF c_get_party_relationship%NOTFOUND or l_rel_party_id is null or l_rel_party_id=FND_API.G_MISS_NUM THEN
3047: l_party_rel_rec.subject_id := l_person_party_id;
3048: l_party_rel_rec.subject_type := 'PERSON';
3049: l_party_rel_rec.subject_table_name := 'HZ_PARTIES';
3050:
3086: IBE_UTIL.debug('After call to HZ_PARTY_CONTACT_V2PUB.create_org_contact - x_msg_count : '|| x_msg_count);
3087: IBE_UTIL.debug('After call to HZ_PARTY_CONTACT_V2PUB.create_org_contact - x_msg_data :' || x_msg_data);
3088: END IF;
3089:
3090: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3091: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3092: END IF;
3093: ELSE
3094: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3087: IBE_UTIL.debug('After call to HZ_PARTY_CONTACT_V2PUB.create_org_contact - x_msg_data :' || x_msg_data);
3088: END IF;
3089:
3090: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3091: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3092: END IF;
3093: ELSE
3094: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3095: IBE_UTIL.debug('Party relationship already exists with party_id: ' || l_rel_party_id);
3098: END IF;
3099: CLOSE c_get_party_relationship;
3100: ELSE
3101: --Find Party_Rel if org_party_id is available
3102: IF (l_person_party_id <> FND_API.G_MISS_NUM and l_person_party_id is not null and l_org_party_id <> FND_API.G_MISS_NUM and l_org_party_id is not null) THEN
3103: OPEN c_get_party_relationship(l_person_party_id, l_org_party_id);
3104: FETCH c_get_party_relationship into l_rel_party_id;
3105: CLOSE c_get_party_relationship;
3106: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3106: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3107: IBE_UTIL.debug('New Find Party Relationship output '||l_rel_party_id);
3108: END IF;
3109: END IF;
3110: IF (l_rel_party_id is not null and l_rel_party_id <> FND_API.G_MISS_NUM) then
3111: l_party_id := l_rel_party_id;
3112: ELSE
3113: l_party_id := l_person_party_id;
3114: END IF;
3117: IBE_UTIL.debug('Going to use this l_party_id for contact_point/contact pref creation'||l_party_id);
3118: END IF;
3119:
3120: -- Find existing contact preferences
3121: IF ( l_contact_pref_rec.contact_preference_id = FND_API.G_MISS_NUM or l_contact_pref_rec.contact_preference_id is NULL AND
3122: (l_contact_pref_rec.preference_code is not null AND l_contact_pref_rec.preference_code <> FND_API.G_MISS_CHAR)) THEN
3123:
3124: IF ( l_contact_pref_rec.contact_level_table is NULL or l_contact_pref_rec.contact_level_table = FND_API.G_MISS_CHAR ) THEN
3125: l_contact_pref_rec.contact_level_table := 'HZ_PARTIES';
3118: END IF;
3119:
3120: -- Find existing contact preferences
3121: IF ( l_contact_pref_rec.contact_preference_id = FND_API.G_MISS_NUM or l_contact_pref_rec.contact_preference_id is NULL AND
3122: (l_contact_pref_rec.preference_code is not null AND l_contact_pref_rec.preference_code <> FND_API.G_MISS_CHAR)) THEN
3123:
3124: IF ( l_contact_pref_rec.contact_level_table is NULL or l_contact_pref_rec.contact_level_table = FND_API.G_MISS_CHAR ) THEN
3125: l_contact_pref_rec.contact_level_table := 'HZ_PARTIES';
3126: END IF;
3120: -- Find existing contact preferences
3121: IF ( l_contact_pref_rec.contact_preference_id = FND_API.G_MISS_NUM or l_contact_pref_rec.contact_preference_id is NULL AND
3122: (l_contact_pref_rec.preference_code is not null AND l_contact_pref_rec.preference_code <> FND_API.G_MISS_CHAR)) THEN
3123:
3124: IF ( l_contact_pref_rec.contact_level_table is NULL or l_contact_pref_rec.contact_level_table = FND_API.G_MISS_CHAR ) THEN
3125: l_contact_pref_rec.contact_level_table := 'HZ_PARTIES';
3126: END IF;
3127:
3128: IF ( l_contact_pref_rec.contact_level_table_id is NULL or l_contact_pref_rec.contact_level_table_id = FND_API.G_MISS_NUM ) THEN
3124: IF ( l_contact_pref_rec.contact_level_table is NULL or l_contact_pref_rec.contact_level_table = FND_API.G_MISS_CHAR ) THEN
3125: l_contact_pref_rec.contact_level_table := 'HZ_PARTIES';
3126: END IF;
3127:
3128: IF ( l_contact_pref_rec.contact_level_table_id is NULL or l_contact_pref_rec.contact_level_table_id = FND_API.G_MISS_NUM ) THEN
3129: l_contact_pref_rec.contact_level_table_id := l_party_id;
3130: END IF;
3131:
3132: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3143: END IF;
3144: END IF;
3145:
3146: -- Create contact preference
3147: IF ( l_contact_pref_rec.contact_preference_id = FND_API.G_MISS_NUM or l_contact_pref_rec.contact_preference_id is NULL AND
3148: (l_contact_pref_rec.preference_code is not null AND l_contact_pref_rec.preference_code <> FND_API.G_MISS_CHAR)) THEN
3149: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3150: IBE_UTIL.debug('Call HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference API');
3151: END IF;
3144: END IF;
3145:
3146: -- Create contact preference
3147: IF ( l_contact_pref_rec.contact_preference_id = FND_API.G_MISS_NUM or l_contact_pref_rec.contact_preference_id is NULL AND
3148: (l_contact_pref_rec.preference_code is not null AND l_contact_pref_rec.preference_code <> FND_API.G_MISS_CHAR)) THEN
3149: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3150: IBE_UTIL.debug('Call HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference API');
3151: END IF;
3152: l_contact_pref_rec.contact_type := 'ALL';
3169: IBE_UTIL.debug('After call to HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference - x_return_status : '|| x_return_status);
3170: IBE_UTIL.debug('After call to HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference - x_msg_count : '|| x_msg_count);
3171: IBE_UTIL.debug('After call to HZ_CONTACT_PREFERENCE_V2PUB.create_contact_preference - x_msg_data :' || x_msg_data);
3172: END IF;
3173: ELSIF ( l_cntct_pref_object_ver_num <> FND_API.G_MISS_NUM ) THEN
3174: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3175: IBE_UTIL.debug('Call HZ_CONTACT_PREFERENCE_V2PUB.update_contact_preference API');
3176: END IF;
3177:
3190: IBE_UTIL.debug('After call to HZ_CONTACT_PREFERENCE_V2PUB.update_contact_preference - x_msg_data :' || x_msg_data);
3191: END IF;
3192: END IF;
3193:
3194: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3196: END IF;
3197: -- Create Party/Relationship Contact Points
3198: if (p_email_rec.email_address is not NULL and p_email_rec.email_address <> FND_API.G_MISS_CHAR) then
3191: END IF;
3192: END IF;
3193:
3194: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3196: END IF;
3197: -- Create Party/Relationship Contact Points
3198: if (p_email_rec.email_address is not NULL and p_email_rec.email_address <> FND_API.G_MISS_CHAR) then
3199: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3194: IF x_return_status <> FND_API.G_RET_STS_SUCCESS then
3195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3196: END IF;
3197: -- Create Party/Relationship Contact Points
3198: if (p_email_rec.email_address is not NULL and p_email_rec.email_address <> FND_API.G_MISS_CHAR) then
3199: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3200: IBE_UTIL.debug('Email address is not null, Email Address: ' || p_email_rec.email_address);
3201: END IF;
3202: -- calling TCA API to create_email_contact_points
3199: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3200: IBE_UTIL.debug('Email address is not null, Email Address: ' || p_email_rec.email_address);
3201: END IF;
3202: -- calling TCA API to create_email_contact_points
3203: IF (l_email_contact_point_rec.contact_point_id = FND_API.G_MISS_NUM or l_email_contact_point_rec.contact_point_id is NULL) THEN
3204: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3205: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.create_email_contact_point API');
3206: END IF;
3207:
3211: l_email_contact_point_rec.application_id := G_APPLICATION_ID;
3212: l_email_contact_point_rec.contact_point_type := 'EMAIL';
3213: l_email_contact_point_rec.contact_point_purpose := null;
3214:
3215: IF ( l_email_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_email_contact_point_rec.owner_table_id is null) THEN
3216: l_email_contact_point_rec.owner_table_id := l_party_id;
3217: END IF;
3218:
3219: HZ_CONTACT_POINT_V2PUB.create_email_contact_point (
3232: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_email_contact_point - x_return_status : '|| x_return_status);
3233: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_email_contact_point - x_msg_count : '|| x_msg_count);
3234: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_email_contact_point - x_msg_data :' || x_msg_data);
3235: END IF;
3236: ELSIF ( l_email_object_version_number <> FND_API.G_MISS_NUM ) THEN
3237: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3238: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_email_contact_point API');
3239: END IF;
3240: IBE_UTIL.debug('Email Object Version Number' || l_email_object_version_number);
3256: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.update_email_contact_point - x_msg_data :' || x_msg_data);
3257: END IF;
3258: END IF;
3259:
3260: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3261: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3262: end if;
3263: end if;
3264:
3257: END IF;
3258: END IF;
3259:
3260: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3261: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3262: end if;
3263: end if;
3264:
3265:
3267: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3268: IBE_UTIL.debug(' Workphone_Number : '|| Length(p_work_phone_rec.phone_number));
3269: END IF;
3270:
3271: if ( (p_work_phone_rec.phone_number is not NULL) and ( Length(p_work_phone_rec.phone_number) > 0 ) and (p_work_phone_rec.phone_number <> FND_API.G_MISS_CHAR) ) then
3272: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3273: IBE_UTIL.debug('Work Phone num is not null phone_Number : '|| p_work_phone_rec.phone_number);
3274: END IF;
3275:
3272: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3273: IBE_UTIL.debug('Work Phone num is not null phone_Number : '|| p_work_phone_rec.phone_number);
3274: END IF;
3275:
3276: IF (l_workph_contact_point_rec.contact_point_id = FND_API.G_MISS_NUM or l_workph_contact_point_rec.contact_point_id is NULL) THEN
3277: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3278: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.create_workph_contact_point API');
3279: END IF;
3280:
3284: l_workph_contact_point_rec.application_id := G_APPLICATION_ID;
3285: l_workph_contact_point_rec.contact_point_type := 'PHONE';
3286: l_workph_contact_point_rec.contact_point_purpose := 'BUSINESS';
3287:
3288: IF ( l_workph_contact_point_rec.owner_table_id= FND_API.G_MISS_NUM or l_workph_contact_point_rec.owner_table_id is null) THEN
3289: l_workph_contact_point_rec.owner_table_id := l_party_id;
3290: END IF;
3291:
3292: HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (
3305: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_workph_contact_point - x_return_status : '|| x_return_status);
3306: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_workph_contact_point - x_msg_count : '|| x_msg_count);
3307: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_workph_contact_point - x_msg_data :' || x_msg_data);
3308: END IF;
3309: ELSIF ( l_workph_object_version_number <> FND_API.G_MISS_NUM ) THEN
3310: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3311: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_workph_contact_point API');
3312: END IF;
3313:
3329: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.update_workph_contact_point - x_msg_data :' || x_msg_data);
3330: END IF;
3331: END IF;
3332:
3333: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3334: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3335: end if;
3336: end if;
3337:
3330: END IF;
3331: END IF;
3332:
3333: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3334: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3335: end if;
3336: end if;
3337:
3338:
3340: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3341: IBE_UTIL.debug(' Homephone_Number : '|| Length(p_home_phone_rec.phone_number));
3342: END IF;
3343:
3344: if ( (p_home_phone_rec.phone_number is not NULL) and ( Length(p_home_phone_rec.phone_number) > 0 ) and (p_home_phone_rec.phone_number <> FND_API.G_MISS_CHAR) ) then
3345: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3346: IBE_UTIL.debug('Home Phone num is not null phone_Number : '|| p_home_phone_rec.phone_number);
3347: END IF;
3348:
3345: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3346: IBE_UTIL.debug('Home Phone num is not null phone_Number : '|| p_home_phone_rec.phone_number);
3347: END IF;
3348:
3349: IF (l_homeph_contact_point_rec.contact_point_id = FND_API.G_MISS_NUM or l_homeph_contact_point_rec.contact_point_id is NULL) THEN
3350: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3351: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.create_homeph_contact_point API');
3352: END IF;
3353:
3357: l_homeph_contact_point_rec.application_id := G_APPLICATION_ID;
3358: l_homeph_contact_point_rec.contact_point_type := 'PHONE';
3359: l_homeph_contact_point_rec.contact_point_purpose := 'PERSONAL';
3360:
3361: IF ( l_homeph_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_homeph_contact_point_rec.owner_table_id is null) THEN
3362: l_homeph_contact_point_rec.owner_table_id := l_party_id;
3363: END IF;
3364:
3365: HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (
3378: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_homeph_contact_point - x_return_status : '|| x_return_status);
3379: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_homeph_contact_point - x_msg_count : '|| x_msg_count);
3380: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_homeph_contact_point - x_msg_data :' || x_msg_data);
3381: END IF;
3382: ELSIF ( l_homeph_object_version_number <> FND_API.G_MISS_NUM ) THEN
3383: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3384: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_homeph_contact_point API');
3385: END IF;
3386:
3402: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.update_homeph_contact_point - x_msg_data :' || x_msg_data);
3403: END IF;
3404: END IF;
3405:
3406: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3407: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3408: end if;
3409: end if;
3410:
3403: END IF;
3404: END IF;
3405:
3406: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3407: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3408: end if;
3409: end if;
3410:
3411: -- Create Person/Contact Fax Number
3412: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3413: IBE_UTIL.debug(' Fax Number : '|| Length(p_fax_rec.phone_number));
3414: END IF;
3415:
3416: if ( (p_fax_rec.phone_number is not NULL) and ( Length(p_fax_rec.phone_number) > 0 ) and (p_fax_rec.phone_number <> FND_API.G_MISS_CHAR) ) then
3417: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3418: IBE_UTIL.debug('Fax num is not null phone_Number : '|| p_fax_rec.phone_number);
3419: END IF;
3420:
3417: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3418: IBE_UTIL.debug('Fax num is not null phone_Number : '|| p_fax_rec.phone_number);
3419: END IF;
3420:
3421: IF (l_fax_contact_point_rec.contact_point_id = FND_API.G_MISS_NUM or l_fax_contact_point_rec.contact_point_id is NULL) THEN
3422: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3423: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.create_fax_contact_point API');
3424: END IF;
3425:
3429: l_fax_contact_point_rec.application_id := G_APPLICATION_ID;
3430: l_fax_contact_point_rec.contact_point_type := 'PHONE';
3431: l_fax_contact_point_rec.contact_point_purpose := null;
3432:
3433: IF ( l_fax_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_fax_contact_point_rec.owner_table_id is null) THEN
3434: l_fax_contact_point_rec.owner_table_id := l_party_id;
3435: END IF;
3436:
3437: HZ_CONTACT_POINT_V2PUB.create_phone_contact_point (
3450: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_fax_contact_point - x_return_status : '|| x_return_status);
3451: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_fax_contact_point - x_msg_count : '|| x_msg_count);
3452: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_fax_contact_point - x_msg_data :' || x_msg_data);
3453: END IF;
3454: ELSIF ( l_fax_object_version_number <> FND_API.G_MISS_NUM ) THEN
3455: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3456: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_fax_contact_point API');
3457: END IF;
3458:
3474: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.update_fax_contact_point - x_msg_data :' || x_msg_data);
3475: END IF;
3476: END IF;
3477:
3478: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3479: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3480: end if;
3481: end if;
3482:
3475: END IF;
3476: END IF;
3477:
3478: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3479: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3480: end if;
3481: end if;
3482:
3483: -- Create Organization Phone Number
3485: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3486: IBE_UTIL.debug(' org_phone_Number : '|| Length(p_org_phone_rec.phone_number));
3487: END IF;
3488:
3489: if ( (p_org_phone_rec.phone_number is not NULL) and ( Length(p_org_phone_rec.phone_number) > 0 ) and (p_org_phone_rec.phone_number <> FND_API.G_MISS_CHAR) ) then
3490: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3491: IBE_UTIL.debug('Org Phone num is not null phone_Number : '|| p_org_phone_rec.phone_number);
3492: END IF;
3493:
3491: IBE_UTIL.debug('Org Phone num is not null phone_Number : '|| p_org_phone_rec.phone_number);
3492: END IF;
3493:
3494:
3495: IF ( l_orgph_contact_point_rec.contact_point_id = FND_API.G_MISS_NUM or l_orgph_contact_point_rec.contact_point_id is NULL) THEN
3496:
3497: l_orgph_contact_point_rec.status := 'A';
3498: l_orgph_contact_point_rec.owner_table_name := 'HZ_PARTIES';
3499: l_orgph_contact_point_rec.created_by_module := p_created_by_module;
3500: l_orgph_contact_point_rec.application_id := G_APPLICATION_ID;
3501: l_orgph_contact_point_rec.contact_point_type := 'PHONE';
3502: l_orgph_contact_point_rec.contact_point_purpose := 'BUSINESS';
3503:
3504: IF ( l_org_party_id is not NULL AND l_org_party_id <> FND_API.G_MISS_NUM ) THEN
3505:
3506: IF( l_orgph_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_orgph_contact_point_rec.owner_table_id is null) THEN
3507: l_orgph_contact_point_rec.owner_table_id := l_org_party_id;
3508: END IF;
3502: l_orgph_contact_point_rec.contact_point_purpose := 'BUSINESS';
3503:
3504: IF ( l_org_party_id is not NULL AND l_org_party_id <> FND_API.G_MISS_NUM ) THEN
3505:
3506: IF( l_orgph_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_orgph_contact_point_rec.owner_table_id is null) THEN
3507: l_orgph_contact_point_rec.owner_table_id := l_org_party_id;
3508: END IF;
3509:
3510: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3528: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_orgPh_contact_point - x_msg_count : '|| x_msg_count);
3529: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_orgPh_contact_point - x_msg_data :' || x_msg_data);
3530: END IF;
3531: END IF;
3532: ELSIF ( l_orgph_contact_point_rec.contact_point_id <> FND_API.G_MISS_NUM or l_orgph_contact_point_rec.contact_point_id is not NULL
3533: AND l_orgph_object_version_number <> FND_API.G_MISS_NUM ) THEN
3534: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3535: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_orgPh_contact_point API');
3536: END IF;
3529: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_orgPh_contact_point - x_msg_data :' || x_msg_data);
3530: END IF;
3531: END IF;
3532: ELSIF ( l_orgph_contact_point_rec.contact_point_id <> FND_API.G_MISS_NUM or l_orgph_contact_point_rec.contact_point_id is not NULL
3533: AND l_orgph_object_version_number <> FND_API.G_MISS_NUM ) THEN
3534: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3535: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_orgPh_contact_point API');
3536: END IF;
3537:
3553: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.update_orgPh_contact_point - x_msg_data :' || x_msg_data);
3554: END IF;
3555: END IF;
3556:
3557: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3558: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3559: end if;
3560: end if;
3561:
3554: END IF;
3555: END IF;
3556:
3557: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3558: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3559: end if;
3560: end if;
3561:
3562: -- Create Organization Fax Number
3565: IBE_UTIL.debug(' Org_fax_Number : '|| Length(p_org_fax_rec.phone_number));
3566: END IF;
3567:
3568:
3569: if ( (p_org_fax_rec.phone_number is not NULL) and ( Length(p_org_fax_rec.phone_number) > 0 ) and (p_org_fax_rec.phone_number <> FND_API.G_MISS_CHAR)) then
3570: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3571: IBE_UTIL.debug('Fax num is not null phone_Number : '|| p_org_fax_rec.phone_number);
3572: END IF;
3573:
3570: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3571: IBE_UTIL.debug('Fax num is not null phone_Number : '|| p_org_fax_rec.phone_number);
3572: END IF;
3573:
3574: IF (l_orgfax_contact_point_rec.contact_point_id = FND_API.G_MISS_NUM or l_orgfax_contact_point_rec.contact_point_id is NULL) THEN
3575:
3576: l_orgfax_contact_point_rec.status := 'A';
3577: l_orgfax_contact_point_rec.owner_table_name := 'HZ_PARTIES';
3578: l_orgfax_contact_point_rec.created_by_module := p_created_by_module;
3579: l_orgfax_contact_point_rec.application_id := G_APPLICATION_ID;
3580: l_orgfax_contact_point_rec.contact_point_type := 'PHONE';
3581: l_orgfax_contact_point_rec.contact_point_purpose := null;
3582:
3583: IF ( l_org_party_id is not NULL AND l_org_party_id <> FND_API.G_MISS_NUM ) THEN
3584: IF (l_orgfax_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_orgfax_contact_point_rec.owner_table_id is null) THEN
3585: l_orgfax_contact_point_rec.owner_table_id := l_org_party_id;
3586: END IF;
3587:
3580: l_orgfax_contact_point_rec.contact_point_type := 'PHONE';
3581: l_orgfax_contact_point_rec.contact_point_purpose := null;
3582:
3583: IF ( l_org_party_id is not NULL AND l_org_party_id <> FND_API.G_MISS_NUM ) THEN
3584: IF (l_orgfax_contact_point_rec.owner_table_id = FND_API.G_MISS_NUM or l_orgfax_contact_point_rec.owner_table_id is null) THEN
3585: l_orgfax_contact_point_rec.owner_table_id := l_org_party_id;
3586: END IF;
3587:
3588: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3606: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_orgFax_contact_point - x_msg_count : '|| x_msg_count);
3607: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_orgFax_contact_point - x_msg_data :' || x_msg_data);
3608: END IF;
3609: END IF;
3610: ELSIF ( l_orgfax_contact_point_rec.owner_table_id <> FND_API.G_MISS_NUM AND l_orgfax_contact_point_rec.owner_table_id is not null
3611: AND l_orgfax_object_version_number <> FND_API.G_MISS_NUM ) THEN
3612: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3613: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_orgFax_contact_point API');
3614: END IF;
3607: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.create_orgFax_contact_point - x_msg_data :' || x_msg_data);
3608: END IF;
3609: END IF;
3610: ELSIF ( l_orgfax_contact_point_rec.owner_table_id <> FND_API.G_MISS_NUM AND l_orgfax_contact_point_rec.owner_table_id is not null
3611: AND l_orgfax_object_version_number <> FND_API.G_MISS_NUM ) THEN
3612: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3613: IBE_UTIL.debug('Call HZ_CONTACT_POINT_V2PUB.update_orgFax_contact_point API');
3614: END IF;
3615:
3631: IBE_UTIL.debug('After call to HZ_CONTACT_POINT_V2PUB.update_orgFax_contact_point - x_msg_data :' || x_msg_data);
3632: END IF;
3633: END IF;
3634:
3635: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3636: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3637: end if;
3638: end if;
3639:
3632: END IF;
3633: END IF;
3634:
3635: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
3636: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3637: end if;
3638: end if;
3639:
3640: x_person_party_id := l_person_party_id;
3649: END IF;
3650:
3651: EXCEPTION
3652:
3653: WHEN FND_API.G_EXC_ERROR THEN
3654:
3655:
3656:
3657: x_return_status := FND_API.G_RET_STS_ERROR;
3653: WHEN FND_API.G_EXC_ERROR THEN
3654:
3655:
3656:
3657: x_return_status := FND_API.G_RET_STS_ERROR;
3658: FND_MSG_PUB.ADD;
3659: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
3660: p_data => x_msg_data,
3661: p_encoded => 'F');
3667: IBE_UTIL.debug('error code : '|| to_char(SQLCODE));
3668: IBE_UTIL.debug('error text : '|| SQLERRM);
3669: END IF;
3670:
3671: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3672:
3673:
3674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3675: FND_MSG_PUB.ADD;
3670:
3671: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3672:
3673:
3674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3675: FND_MSG_PUB.ADD;
3676: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
3677: p_data => x_msg_data,
3678: p_encoded => 'F');
3691: FND_MESSAGE.Set_Name('FND', 'SQL_PLSQL_ERROR');
3692: FND_MESSAGE.Set_Token('ERRNO', SQLCODE);
3693: FND_MESSAGE.Set_Token('REASON', SQLERRM);
3694: FND_MSG_PUB.Add;
3695: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3696: FND_MSG_PUB.Add;
3697: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
3698: p_data => x_msg_data,
3699: p_encoded => 'F');