117: -- First we need to validate whether the given header_id already exists in the csp_moveorder_headers.
118: OPEN l_Get_Header_ID_Csr;
119: FETCH l_Get_Header_ID_Csr INTO l_check_existence;
120: IF l_Get_Header_ID_Csr%NOTFOUND THEN
121: -- Now, validate whether the given header_id exists in the mtl_txn_request_headers table.
122: BEGIN
123: SELECT header_id INTO l_check_existence
124: FROM mtl_txn_request_headers
125: WHERE header_id = p_header_id;
120: IF l_Get_Header_ID_Csr%NOTFOUND THEN
121: -- Now, validate whether the given header_id exists in the mtl_txn_request_headers table.
122: BEGIN
123: SELECT header_id INTO l_check_existence
124: FROM mtl_txn_request_headers
125: WHERE header_id = p_header_id;
126:
127: EXCEPTION
128: WHEN NO_DATA_FOUND THEN
133: WHEN OTHERS THEN
134: fnd_message.set_name('CSP', 'CSP_UNEXPECTED_ERRORS');
135: fnd_message.set_token('ERR_FIELD', 'p_header_id', FALSE);
136: fnd_message.set_token('ROUTINE', l_pkg_api_name, FALSE);
137: fnd_message.set_token('TABLE', 'MTL_TXN_REQUEST_HEADERS', FALSE);
138: FND_MSG_PUB.ADD;
139: RAISE EXCP_USER_DEFINED;
140:
141: END;
153: BEGIN
154: SELECT distinct freight_code INTO l_carrier
155: FROM org_freight_tl
156: WHERE freight_code = p_carrier
157: AND organization_id = (SELECT organization_id FROM mtl_txn_request_headers
158: WHERE header_id = p_header_id);
159: EXCEPTION
160: WHEN NO_DATA_FOUND THEN
161: FND_MESSAGE.SET_NAME('CSP', 'CSP_INVALID_CARRIER');
199: FND_MESSAGE.SET_TOKEN ('PARAMETER', 'p_header_id', FALSE);
200: FND_MSG_PUB.ADD;
201: RAISE EXCP_USER_DEFINED;
202: ELSE
203: -- Validate whether the given header_id exists in the mtl_txn_request_headers table.
204: BEGIN
205: SELECT header_id INTO l_check_existence
206: FROM csp_moveorder_headers
207: WHERE header_id = p_header_id;
228: BEGIN
229: SELECT distinct freight_code INTO l_carrier
230: FROM org_freight_tl
231: WHERE freight_code = p_carrier
232: AND organization_id = (SELECT organization_id FROM mtl_txn_request_headers
233: WHERE header_id = p_header_id);
234: EXCEPTION
235: WHEN NO_DATA_FOUND THEN
236: FND_MESSAGE.SET_NAME('CSP', 'CSP_INVALID_CARRIER');
272: FND_MESSAGE.SET_TOKEN ('PARAMETER', 'p_header_id', FALSE);
273: FND_MSG_PUB.ADD;
274: RAISE EXCP_USER_DEFINED;
275: ELSE
276: -- Validate whether the given header_id exists in the mtl_txn_request_headers table.
277: BEGIN
278: SELECT header_id INTO l_check_existence
279: FROM csp_moveorder_headers
280: WHERE header_id = p_header_id;