[Home] [Help]
PACKAGE BODY: APPS.PO_AP_INTEGRATION_GRP
Source
1 PACKAGE BODY PO_AP_INTEGRATION_GRP AS
2 /* $Header: POXGAPIB.pls 115.1 2004/03/25 07:17:42 axian noship $ */
3
4 g_pkg_name CONSTANT VARCHAR2(30) := 'PO_AP_INTEGRATION_GRP';
5
6 -------------------------------------------------------------------------------
7 --Start of Comments
8 --Name: get_invoice_numbering_options
9 --Pre-reqs:
10 -- p_org_id is not null
11 --Modifies:
12 -- FND_MSG_PUB on error
13 --Locks:
14 -- None
15 --Function:
16 -- Retrieves the invoice numbering options: the gapless invoice numbering
17 -- flag and the buying company identifier
18 --Parameters:
19 --IN:
20 --p_api_version:
21 -- Version number of API that caller expects. It should match the constant
22 -- 'l_api_version' defined in the procedure.
23 --p_org_id
24 -- Operating unit ID that will be used to retrieve OU-specific invoice
25 -- numbering options
26 --OUT:
27 --x_return_status:
28 -- FND_API.g_ret_sts_success -- if the procedure completed successfully
29 -- FND_API.g_ret_sts_unexp_error -- if an unexpected error occurred
30 --x_msg_data:
31 -- Error message text in case of exception/error
32 --x_buying_company_identifier:
33 -- Self-bill buying company identifier from the Purchasing Options of the
34 -- input OU
35 --x_gapless_inv_num_flag:
36 -- If gapless invoice numbering is enabled, return Y; else return N
37 --Testing:
38 --End of Comments
39 -------------------------------------------------------------------------------
40 PROCEDURE get_invoice_numbering_options
41 (
42 p_api_version IN NUMBER,
43 p_org_id IN NUMBER,
44 x_return_status OUT NOCOPY VARCHAR2,
45 x_msg_data OUT NOCOPY VARCHAR2,
46 x_buying_company_identifier OUT NOCOPY VARCHAR2,
47 x_gapless_inv_num_flag OUT NOCOPY VARCHAR2
48 )
49 IS
50 l_api_version CONSTANT NUMBER := 1.0;
51 l_api_name CONSTANT VARCHAR2(30) := 'get_invoice_numbering_options';
52 l_progress VARCHAR2(3) := '000';
53
54 BEGIN
55 l_progress := '010';
56
57 -- Standard call to check for call compatibility
58 IF NOT FND_API.compatible_api_call(l_api_version,
59 p_api_version,
60 l_api_name,
61 g_pkg_name) THEN
62 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
63 END IF;
64
65 x_return_status:= FND_API.g_ret_sts_success;
66 l_progress := '020';
67
68 -- Call the private get_invoice_numbering_options
69 PO_AP_INTEGRATION_PVT.get_invoice_numbering_options(
70 p_api_version => p_api_version,
71 p_org_id => p_org_id,
72 x_return_status => x_return_status,
73 x_msg_data => x_msg_data,
74 x_buying_company_identifier => x_buying_company_identifier,
75 x_gapless_inv_num_flag => x_gapless_inv_num_flag
76 );
77
78 EXCEPTION
79 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
80 x_gapless_inv_num_flag := 'N';
81 x_buying_company_identifier := NULL;
82 x_return_status := FND_API.g_ret_sts_unexp_error;
83 x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
84 p_encoded => 'F');
85 WHEN OTHERS THEN
86 x_gapless_inv_num_flag := 'N';
87 x_buying_company_identifier := NULL;
88 x_return_status := FND_API.g_ret_sts_unexp_error;
89 IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
90 FND_MSG_PUB.add_exc_msg (p_pkg_name => g_pkg_name,
91 p_procedure_name => l_api_name,
92 p_error_text => SUBSTRB(SQLERRM, 1, 200)
93 ||' at location '|| l_progress);
94 END IF;
95 x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
96 p_encoded => 'F');
97
98 END get_invoice_numbering_options;
99
100 END PO_AP_INTEGRATION_GRP;