56: end if;
57:
58: -- initialize message list
59: if fnd_api.to_boolean(p_init_msg_list) then
60: fnd_msg_pub.initialize;
61: end if;
62:
63: -- initialize return status to success
64: x_return_status := fnd_api.g_ret_sts_success;
66: -- start input parameter validation now
67: -- validate if order number is passed in (segment 1)
68: if ( p_segment1 is NULL ) then
69: fnd_message.set_name('INV', 'BAD_INPUT_ARGUMENTS');
70: fnd_msg_pub.add;
71: raise fnd_api.g_exc_error ;
72: else
73: -- convert this to varchar since the flexfield table stores as char(240)
74: l_segment1 := to_char(p_segment1);
76:
77: -- validate if order type is passed in (segment 2)
78: if ( p_segment2 is NULL ) then
79: fnd_message.set_name('INV', 'BAD_INPUT_ARGUMENTS');
80: fnd_msg_pub.add;
81: raise fnd_api.g_exc_error ;
82: elsif ( p_segment2 is NOT NULL) then
83: l_segment2 := p_segment2;
84: end if;
85:
86: -- validate if order source is passed in
87: if ( p_segment3 is NULL ) then
88: fnd_message.set_name('INV', 'BAD_INPUT_ARGUMENTS');
89: fnd_msg_pub.add;
90: raise fnd_api.g_exc_error ;
91: else
92: l_segment3 := p_segment3 ;
93: end if;
118: ,validation_date => l_validation_date
119: ,n_segments => 3
120: ,segments => l_segment_arr
121: ,combination_id => x_salesorder_id) ) then
122: fnd_msg_pub.add ;
123: raise fnd_api.g_exc_error ;
124: end if;
125: else
126: -- check if sales order already exists
155: EXCEPTION
156: when fnd_api.g_exc_error then
157: x_return_status := fnd_api.g_ret_sts_error ;
158:
159: fnd_msg_pub.count_and_get(
160: p_count => x_message_count
161: , p_data => x_message_data
162: , p_encoded => 'F');
163:
163:
164: when fnd_api.g_exc_unexpected_error then
165: x_return_status := fnd_api.g_ret_sts_unexp_error;
166:
167: fnd_msg_pub.count_and_get(
168: p_count => x_message_count
169: , p_data => x_message_data
170: , p_encoded => 'F');
171:
171:
172: when others then
173: x_return_status := fnd_api.g_ret_sts_unexp_error;
174:
175: if (fnd_msg_pub.check_msg_level
176: (fnd_msg_pub.g_msg_lvl_unexp_error))then
177: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
178: end if;
179:
172: when others then
173: x_return_status := fnd_api.g_ret_sts_unexp_error;
174:
175: if (fnd_msg_pub.check_msg_level
176: (fnd_msg_pub.g_msg_lvl_unexp_error))then
177: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
178: end if;
179:
180: fnd_msg_pub.count_and_get(
173: x_return_status := fnd_api.g_ret_sts_unexp_error;
174:
175: if (fnd_msg_pub.check_msg_level
176: (fnd_msg_pub.g_msg_lvl_unexp_error))then
177: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
178: end if;
179:
180: fnd_msg_pub.count_and_get(
181: p_count => x_message_count
176: (fnd_msg_pub.g_msg_lvl_unexp_error))then
177: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
178: end if;
179:
180: fnd_msg_pub.count_and_get(
181: p_count => x_message_count
182: , p_data => x_message_data
183: , p_encoded => 'F');
184:
247:
248: when others then
249: x_return_status := fnd_api.g_ret_sts_unexp_error;
250:
251: if (fnd_msg_pub.check_msg_level
252: (fnd_msg_pub.g_msg_lvl_unexp_error))then
253: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
254: end if;
255:
248: when others then
249: x_return_status := fnd_api.g_ret_sts_unexp_error;
250:
251: if (fnd_msg_pub.check_msg_level
252: (fnd_msg_pub.g_msg_lvl_unexp_error))then
253: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
254: end if;
255:
256: end get_oeheader_for_salesorder;
249: x_return_status := fnd_api.g_ret_sts_unexp_error;
250:
251: if (fnd_msg_pub.check_msg_level
252: (fnd_msg_pub.g_msg_lvl_unexp_error))then
253: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
254: end if;
255:
256: end get_oeheader_for_salesorder;
257:
433: end if;
434:
435: -- initialize message list
436: if fnd_api.to_boolean(p_init_msg_list) then
437: fnd_msg_pub.initialize;
438: end if;
439:
440: -- initialize return status to success
441: x_return_status := fnd_api.g_ret_sts_success;
470: EXCEPTION
471: when fnd_api.g_exc_unexpected_error then
472: x_return_status := fnd_api.g_ret_sts_unexp_error;
473:
474: fnd_msg_pub.count_and_get(
475: p_count => x_message_count
476: , p_data => x_message_data
477: , p_encoded => 'F');
478:
480:
481: when others then
482: x_return_status := fnd_api.g_ret_sts_unexp_error;
483:
484: if (fnd_msg_pub.check_msg_level
485: (fnd_msg_pub.g_msg_lvl_unexp_error))then
486: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
487: end if;
488:
481: when others then
482: x_return_status := fnd_api.g_ret_sts_unexp_error;
483:
484: if (fnd_msg_pub.check_msg_level
485: (fnd_msg_pub.g_msg_lvl_unexp_error))then
486: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
487: end if;
488:
489: fnd_msg_pub.count_and_get(
482: x_return_status := fnd_api.g_ret_sts_unexp_error;
483:
484: if (fnd_msg_pub.check_msg_level
485: (fnd_msg_pub.g_msg_lvl_unexp_error))then
486: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
487: end if;
488:
489: fnd_msg_pub.count_and_get(
490: p_count => x_message_count
485: (fnd_msg_pub.g_msg_lvl_unexp_error))then
486: fnd_msg_pub.add_exc_msg(g_package_name,c_api_name);
487: end if;
488:
489: fnd_msg_pub.count_and_get(
490: p_count => x_message_count
491: , p_data => x_message_data
492: , p_encoded => 'F');
493: OE_MSG_PUB.Add_Exc_Msg(g_package_name, c_api_name, x_message_data);
517: end if;
518:
519: -- initialize message list
520: if fnd_api.to_boolean(p_init_msg_list) then
521: fnd_msg_pub.initialize;
522: end if;
523:
524: -- initialize return status to success
525: x_return_status := fnd_api.g_ret_sts_success;
539:
540:
541: EXCEPTION
542: when others then
543: fnd_msg_pub.count_and_get(
544: p_count => x_message_count
545: , p_data => x_message_data
546: , p_encoded => 'F');
547: