1 PACKAGE BODY PO_INTERFACE_ERRORS_GRP AS
2 /* $Header: POXGPIEB.pls 115.2 2003/08/27 18:12:23 bao noship $*/
3
4 g_pkg_name CONSTANT VARCHAR2(30) := 'PO_INTERFACE_ERRORS_GRP';
5
6 -----------------------------------------------------------------------
7 --Start of Comments
8 --Name: log_error
9 --Pre-reqs:
10 --Modifies: po_interface_errors
11 --Locks:
12 -- None
13 --Function: Insert a record into po_interface_errors table based on
14 -- the values in record p_rec, which is passed in as a parameter
15 --Parameters:
16 --IN:
17 --p_api_version
18 -- API Version the caller thinks this API is on
19 --p_init_msg_list
20 -- Whether the message stack should get initialized within the procedure
21 --p_rec
22 -- A record structure of the table PO_INTERFACE_ERRORS. The values in
23 -- this record will be inserted into po_interface_errors as a record.
24 -- See Notes for its usage
25 --IN OUT:
26 --OUT:
27 --x_return_status
28 -- status of the procedure (FND_API.G_RET_STS_SUCCESS indicates a success,
29 -- otherwise there is an error occurred)
30 --x_msg_count
31 -- Number of messages in the stack
32 --x_msg_data
33 -- If x_msg_count is 1, this out parameter will be populated with that msg
34 --x_row_id
35 -- rowid of the record that just gets inserted
36 --Returns:
37 --Notes:
38 -- *** This is an autonomous procedure ***
39 -- Before calling this procedure, p_rec must be populated with values for
40 -- the columns user wants to set. If p_rec.interface_type is not set, the
41 -- value 'UNKNOWN' will be populated as INTERFACE_TYPE in po_interface_erros.
42 -- If p_rec.interface_transaction_id is not set, the value will be derived
43 -- from the next number in PO_INTERFACE_ERRORS_S sequence.
44 -- Also, the following fields will be derived within the procedure and
45 -- the corresponding columns within p_rec will be ignored:
46 -- creation_date
47 -- created_by
48 -- last_update_date
49 -- last_updated_by
50 -- last_update_login
51 -- request_id
52 -- program_application_id
53 -- program_id
54 --Testing:
55 --End of Comments
56 ------------------------------------------------------------------------
57
58 PROCEDURE log_error
59 ( p_api_version IN NUMBER,
60 p_init_msg_list IN VARCHAR2,
61 x_return_status OUT NOCOPY VARCHAR2,
62 x_msg_count OUT NOCOPY NUMBER,
63 x_msg_data OUT NOCOPY VARCHAR2,
64 p_rec IN PO_INTERFACE_ERRORS%ROWTYPE,
65 x_row_id OUT NOCOPY ROWID
66 ) IS
67
68 PRAGMA AUTONOMOUS_TRANSACTION;
69
70 l_api_name CONSTANT VARCHAR2(30) := 'log_error';
71 l_api_version NUMBER := 1.0;
72
73 l_progress VARCHAR2(3);
74
75 BEGIN
76
77 l_progress := '000';
78 x_return_status := FND_API.G_RET_STS_SUCCESS;
79
80 IF (FND_API.to_boolean(p_init_msg_list)) THEN
81 FND_MSG_PUB.initialize;
82 END IF;
83
84 IF (NOT FND_API.Compatible_API_Call
85 ( p_current_version_number => l_api_version,
86 p_caller_version_number => p_api_version,
87 p_api_name => l_api_name,
88 p_pkg_name => g_pkg_name
89 )
90 ) THEN
91
92 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
93 END IF;
94
95 l_progress := '010';
96
97 PO_INTERFACE_ERRORS_PVT.insert_row
98 ( p_api_version => 1.0,
99 p_init_msg_list => FND_API.G_FALSE,
100 p_commit => FND_API.G_FALSE,
101 x_return_status => x_return_status,
102 x_msg_count => x_msg_count,
103 x_msg_data => x_msg_data,
104 p_rec => p_rec,
105 x_row_id => x_row_id
106 );
107
108 l_progress := '020';
109
110 COMMIT;
111
112 EXCEPTION
113 WHEN OTHERS THEN
114 ROLLBACK;
115
116 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
117
118 FND_MSG_PUB.add_exc_msg
119 ( p_pkg_name => G_PKG_NAME,
120 p_procedure_name => l_api_name || '.' || l_progress
121 );
122
123 FND_MSG_PUB.count_and_get
124 ( p_encoded => 'F',
125 p_count => x_msg_count,
126 p_data => x_msg_data
127 );
128
129 END log_error;
130
131 END PO_INTERFACE_ERRORS_GRP;