18: --
19: -- End of comments
20:
21: PROCEDURE MARK_BATCH_SUBMITTED (p_api_version_number IN NUMBER,
22: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
23: p_batch_id IN NUMBER,
24: x_return_status OUT nocopy VARCHAR2,
25: x_msg_count OUT nocopy NUMBER,
26: x_msg_data OUT nocopy VARCHAR2
37: BEGIN
38:
39: -- Standard call to check for call compatibility.
40:
41: IF NOT FND_API.Compatible_API_Call ( l_api_version,
42: p_api_version_number,
43: l_api_name,
44: G_PKG_NAME)
45: THEN
42: p_api_version_number,
43: l_api_name,
44: G_PKG_NAME)
45: THEN
46: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
47: END IF;
48:
49: --Initialize message list if p_init_msg_list is TRUE.
50: IF FND_API.To_Boolean (p_init_msg_list) THEN
46: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
47: END IF;
48:
49: --Initialize message list if p_init_msg_list is TRUE.
50: IF FND_API.To_Boolean (p_init_msg_list) THEN
51: FND_MSG_PUB.initialize;
52: END IF;
53:
54: -- Initialize API return status to sucess
51: FND_MSG_PUB.initialize;
52: END IF;
53:
54: -- Initialize API return status to sucess
55: x_return_status := fnd_api.g_ret_sts_success;
56:
57: SELECT COUNT(1)
58: INTO l_cnt_hdr
59: FROM ozf_sd_batch_headers_all
59: FROM ozf_sd_batch_headers_all
60: WHERE batch_id = p_batch_id;
61:
62: IF l_cnt_hdr = 0 THEN
63: x_return_status := fnd_api.g_ret_sts_error;
64: x_msg_data := 'This Batch ID does not exist ' || p_batch_id ;
65: RETURN;
66: END IF;
67:
70: FROM ozf_sd_batch_headers_all
71: WHERE batch_id = p_batch_id;
72:
73: IF l_status NOT IN ('NEW','WIP') THEN
74: x_return_status := fnd_api.g_ret_sts_error;
75: x_msg_data := 'Batch is not in NEW or WIP status ' || p_batch_id ;
76: RETURN;
77: END IF;
78:
83: AND purge_flag <> 'Y'
84: AND transmit_flag = 'Y';
85:
86: IF l_cnt_line = 0 THEN
87: x_return_status := fnd_api.g_ret_sts_error;
88: x_msg_data := 'There are no Lines in this Batch which are ready for transmission ' || p_batch_id ;
89: RETURN;
90: END IF;
91:
128: AND purge_flag <> 'Y'
129: AND transmit_flag = 'Y';
130:
131: EXCEPTION
132: WHEN FND_API.g_exc_error THEN
133: x_return_status := FND_API.g_ret_sts_error;
134: FND_MSG_PUB.count_and_get (
135: p_encoded => FND_API.g_false
136: ,p_count => x_msg_count
129: AND transmit_flag = 'Y';
130:
131: EXCEPTION
132: WHEN FND_API.g_exc_error THEN
133: x_return_status := FND_API.g_ret_sts_error;
134: FND_MSG_PUB.count_and_get (
135: p_encoded => FND_API.g_false
136: ,p_count => x_msg_count
137: ,p_data => x_msg_data
131: EXCEPTION
132: WHEN FND_API.g_exc_error THEN
133: x_return_status := FND_API.g_ret_sts_error;
134: FND_MSG_PUB.count_and_get (
135: p_encoded => FND_API.g_false
136: ,p_count => x_msg_count
137: ,p_data => x_msg_data
138: );
139:
136: ,p_count => x_msg_count
137: ,p_data => x_msg_data
138: );
139:
140: WHEN FND_API.g_exc_unexpected_error THEN
141: x_return_status := FND_API.g_ret_sts_unexp_error ;
142: FND_MSG_PUB.count_and_get (
143: p_encoded => FND_API.g_false
144: ,p_count => x_msg_count
137: ,p_data => x_msg_data
138: );
139:
140: WHEN FND_API.g_exc_unexpected_error THEN
141: x_return_status := FND_API.g_ret_sts_unexp_error ;
142: FND_MSG_PUB.count_and_get (
143: p_encoded => FND_API.g_false
144: ,p_count => x_msg_count
145: ,p_data => x_msg_data
139:
140: WHEN FND_API.g_exc_unexpected_error THEN
141: x_return_status := FND_API.g_ret_sts_unexp_error ;
142: FND_MSG_PUB.count_and_get (
143: p_encoded => FND_API.g_false
144: ,p_count => x_msg_count
145: ,p_data => x_msg_data
146: );
147:
145: ,p_data => x_msg_data
146: );
147:
148: WHEN OTHERS THEN
149: x_return_status := FND_API.g_ret_sts_unexp_error ;
150: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
151: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
152: END IF;
153: FND_MSG_PUB.count_and_get(
150: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
151: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
152: END IF;
153: FND_MSG_PUB.count_and_get(
154: p_encoded => FND_API.g_false
155: ,p_count => x_msg_count
156: ,p_data => x_msg_data
157: );
158: