4: G_PKG_NAME CONSTANT VARCHAR2(30) := 'XDP_DRC_UTIL_PUB';
5:
6: PROCEDURE Process_DRC_Order(
7: p_api_version IN NUMBER,
8: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9: p_commit IN VARCHAR2 := FND_API.G_FALSE,
10: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
11: x_RETURN_STATUS OUT NOCOPY VARCHAR2,
12: x_msg_count OUT NOCOPY NUMBER,
5:
6: PROCEDURE Process_DRC_Order(
7: p_api_version IN NUMBER,
8: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9: p_commit IN VARCHAR2 := FND_API.G_FALSE,
10: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
11: x_RETURN_STATUS OUT NOCOPY VARCHAR2,
12: x_msg_count OUT NOCOPY NUMBER,
13: x_msg_data OUT NOCOPY VARCHAR2,
6: PROCEDURE Process_DRC_Order(
7: p_api_version IN NUMBER,
8: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9: p_commit IN VARCHAR2 := FND_API.G_FALSE,
10: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
11: x_RETURN_STATUS OUT NOCOPY VARCHAR2,
12: x_msg_count OUT NOCOPY NUMBER,
13: x_msg_data OUT NOCOPY VARCHAR2,
14: P_WORKITEM_ID IN NUMBER,
39: -- Standard Start of API savepoint
40: -- SAVEPOINT l_order_tag;
41:
42: -- Standard call to check for call compatibility.
43: IF NOT FND_API.Compatible_API_Call (
44: l_api_version,
45: p_api_version,
46: l_api_name,
47: G_PKG_NAME )
45: p_api_version,
46: l_api_name,
47: G_PKG_NAME )
48: THEN
49: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
50: END IF;
51:
52: -- Initialize message list if p_init_msg_list is set to TRUE.
53: IF FND_API.to_Boolean( p_init_msg_list ) THEN
49: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
50: END IF;
51:
52: -- Initialize message list if p_init_msg_list is set to TRUE.
53: IF FND_API.to_Boolean( p_init_msg_list ) THEN
54: FND_MSG_PUB.initialize;
55: END IF;
56:
57:
73: p_sdp_order_id => l_sdp_order_id,
74: x_data => l_data,
75: x_count => l_count,
76: x_return_code => l_return_code );
77: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
78: RAISE FND_API.G_EXC_ERROR;
79: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
80: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
81: end if;
74: x_data => l_data,
75: x_count => l_count,
76: x_return_code => l_return_code );
77: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
78: RAISE FND_API.G_EXC_ERROR;
79: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
80: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
81: end if;
82: end if;
75: x_count => l_count,
76: x_return_code => l_return_code );
77: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
78: RAISE FND_API.G_EXC_ERROR;
79: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
80: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
81: end if;
82: end if;
83:
76: x_return_code => l_return_code );
77: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
78: RAISE FND_API.G_EXC_ERROR;
79: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
80: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
81: end if;
82: end if;
83:
84: if JTF_USR_HKS.Ok_to_Execute(
93: p_sdp_order_id => l_sdp_order_id,
94: x_data => l_data,
95: x_count => l_count,
96: x_return_code => l_return_code );
97: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
98: RAISE FND_API.G_EXC_ERROR;
99: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
100: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
101: end if;
94: x_data => l_data,
95: x_count => l_count,
96: x_return_code => l_return_code );
97: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
98: RAISE FND_API.G_EXC_ERROR;
99: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
100: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
101: end if;
102: end if;
95: x_count => l_count,
96: x_return_code => l_return_code );
97: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
98: RAISE FND_API.G_EXC_ERROR;
99: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
100: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
101: end if;
102: end if;
103:
96: x_return_code => l_return_code );
97: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
98: RAISE FND_API.G_EXC_ERROR;
99: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
100: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
101: end if;
102: end if;
103:
104:
112: x_error_description => lv_str);
113:
114: if lv_ret <> 0 then
115: dbms_output.put_line('Error ' ||lv_str);
116: x_return_status := FND_API.G_RET_STS_ERROR ;
117: FND_MESSAGE.SET_NAME('XDP', 'XDP_DRC_ORDER_FAILURE');
118: FND_MESSAGE.SET_TOKEN('ERROR_MSG',lv_str);
119: FND_MSG_PUB.Add;
120: FND_MSG_PUB.COUNT_AND_GET
145: p_sdp_order_id => l_sdp_order_id,
146: x_data => l_data,
147: x_count => l_count,
148: x_return_code => l_return_code );
149: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
150: RAISE FND_API.G_EXC_ERROR;
151: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
152: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
153: end if;
146: x_data => l_data,
147: x_count => l_count,
148: x_return_code => l_return_code );
149: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
150: RAISE FND_API.G_EXC_ERROR;
151: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
152: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
153: end if;
154: end if;
147: x_count => l_count,
148: x_return_code => l_return_code );
149: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
150: RAISE FND_API.G_EXC_ERROR;
151: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
152: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
153: end if;
154: end if;
155: if JTF_USR_HKS.Ok_to_Execute(
148: x_return_code => l_return_code );
149: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
150: RAISE FND_API.G_EXC_ERROR;
151: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
152: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
153: end if;
154: end if;
155: if JTF_USR_HKS.Ok_to_Execute(
156: 'XDP_DRC_UTIL_CUHK',
164: p_sdp_order_id => l_sdp_order_id,
165: x_data => l_data,
166: x_count => l_count,
167: x_return_code => l_return_code );
168: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
169: RAISE FND_API.G_EXC_ERROR;
170: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
171: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
172: end if;
165: x_data => l_data,
166: x_count => l_count,
167: x_return_code => l_return_code );
168: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
169: RAISE FND_API.G_EXC_ERROR;
170: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
171: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
172: end if;
173: end if;
166: x_count => l_count,
167: x_return_code => l_return_code );
168: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
169: RAISE FND_API.G_EXC_ERROR;
170: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
171: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
172: end if;
173: end if;
174:
167: x_return_code => l_return_code );
168: if ( l_return_code = FND_API.G_RET_STS_ERROR ) then
169: RAISE FND_API.G_EXC_ERROR;
170: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR ) then
171: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
172: end if;
173: end if;
174:
175:
206: p_bind_data_id => l_bind_data_id,
207: x_return_code => l_return_code
208: );
209:
210: if (l_return_code = FND_API.G_RET_STS_ERROR) then
211: RAISE FND_API.G_EXC_ERROR;
212: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR) then
213: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
214: end if;
207: x_return_code => l_return_code
208: );
209:
210: if (l_return_code = FND_API.G_RET_STS_ERROR) then
211: RAISE FND_API.G_EXC_ERROR;
212: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR) then
213: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
214: end if;
215: end if;
208: );
209:
210: if (l_return_code = FND_API.G_RET_STS_ERROR) then
211: RAISE FND_API.G_EXC_ERROR;
212: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR) then
213: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
214: end if;
215: end if;
216: end if;
209:
210: if (l_return_code = FND_API.G_RET_STS_ERROR) then
211: RAISE FND_API.G_EXC_ERROR;
212: elsif (l_return_code = FND_API.G_RET_STS_UNEXP_ERROR) then
213: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
214: end if;
215: end if;
216: end if;
217:
216: end if;
217:
218: /******* End of Message Generation Section ********/
219:
220: x_return_status := FND_API.G_RET_STS_SUCCESS;
221:
222: -- Standard check of p_commit.
223: IF FND_API.To_Boolean( p_commit ) THEN
224: COMMIT WORK;
219:
220: x_return_status := FND_API.G_RET_STS_SUCCESS;
221:
222: -- Standard check of p_commit.
223: IF FND_API.To_Boolean( p_commit ) THEN
224: COMMIT WORK;
225: END IF;
226:
227: -- Standard call to get message count and if count is 1, get message info.
229: p_count => x_msg_count,
230: p_data => x_msg_data );
231:
232: EXCEPTION
233: WHEN FND_API.G_EXC_ERROR THEN
234: -- ROLLBACK TO l_order_tag;
235: x_return_status := FND_API.G_RET_STS_ERROR ;
236: FND_MSG_PUB.Count_And_Get
237: ( p_count => x_msg_count ,
231:
232: EXCEPTION
233: WHEN FND_API.G_EXC_ERROR THEN
234: -- ROLLBACK TO l_order_tag;
235: x_return_status := FND_API.G_RET_STS_ERROR ;
236: FND_MSG_PUB.Count_And_Get
237: ( p_count => x_msg_count ,
238: p_data => x_msg_data
239: );
236: FND_MSG_PUB.Count_And_Get
237: ( p_count => x_msg_count ,
238: p_data => x_msg_data
239: );
240: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
241: -- ROLLBACK TO l_order_tag;
242: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
243: FND_MSG_PUB.Count_And_Get
244: ( p_count => x_msg_count,
238: p_data => x_msg_data
239: );
240: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
241: -- ROLLBACK TO l_order_tag;
242: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
243: FND_MSG_PUB.Count_And_Get
244: ( p_count => x_msg_count,
245: p_data => x_msg_data
246: );
245: p_data => x_msg_data
246: );
247: WHEN OTHERS THEN
248: -- ROLLBACK TO l_order_tag;
249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
250: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
251: THEN
252: FND_MSG_PUB.Add_Exc_Msg
253: ( G_PKG_NAME ,
262: END Process_DRC_Order;
263:
264: PROCEDURE Process_DRC_Order(
265: p_api_version IN NUMBER,
266: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
267: p_commit IN VARCHAR2 := FND_API.G_FALSE,
268: p_validation_level IN NUMBER :=
269: FND_API.G_VALID_LEVEL_FULL,
270: x_RETURN_STATUS OUT NOCOPY VARCHAR2,
263:
264: PROCEDURE Process_DRC_Order(
265: p_api_version IN NUMBER,
266: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
267: p_commit IN VARCHAR2 := FND_API.G_FALSE,
268: p_validation_level IN NUMBER :=
269: FND_API.G_VALID_LEVEL_FULL,
270: x_RETURN_STATUS OUT NOCOPY VARCHAR2,
271: x_msg_count OUT NOCOPY NUMBER,
265: p_api_version IN NUMBER,
266: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
267: p_commit IN VARCHAR2 := FND_API.G_FALSE,
268: p_validation_level IN NUMBER :=
269: FND_API.G_VALID_LEVEL_FULL,
270: x_RETURN_STATUS OUT NOCOPY VARCHAR2,
271: x_msg_count OUT NOCOPY NUMBER,
272: x_msg_data OUT NOCOPY VARCHAR2,
273: P_WORKITEM_ID IN NUMBER,
295: -- Will not get order_fulfillment if these conditions are not satisfied.
296: -- 19/03/2000
297: --
298:
299: IF (X_SDP_ORDER_ID IS NOT NULL) AND (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
300: x_sdp_Fulfillment_Status := XDP_ENGINE.GET_ORDER_PARAM_VALUE(X_SDP_ORDER_ID,'FULFILLMENT_STATUS');
301: x_sdp_Fulfillment_Result := XDP_ENGINE.GET_ORDER_PARAM_VALUE(X_SDP_ORDER_ID,'FULFILLMENT_RESULT');
302: END IF;
303: EXCEPTION
301: x_sdp_Fulfillment_Result := XDP_ENGINE.GET_ORDER_PARAM_VALUE(X_SDP_ORDER_ID,'FULFILLMENT_RESULT');
302: END IF;
303: EXCEPTION
304: WHEN OTHERS THEN
305: x_sdp_Fulfillment_Status := FND_API.G_RET_STS_UNEXP_ERROR;
306: x_sdp_Fulfillment_Result := SUBSTR(SQLERRM,1,256);
307:
308: END Process_DRC_Order;
309: