1 PACKAGE FA_SRVR_MSG AUTHID CURRENT_USER as
2 /* $Header: FASMESGS.pls 120.5 2009/05/01 17:04:15 glchen ship $ */
3
4 -- GLOBAL VARIABLES
5
6 -- Return Status
7 --
8 -- FA_RET_SUCCESS means that the program was successful in performing
9 -- all the operation requested by its caller.
10 --
11 -- FA_RET_ERROR means that the program failed to perform one or more
12 -- of the operations requested by its caller.
13 --
14 -- FA_RET_UNEXP_ERROR means that the program was not able to perform
15 -- any of the operations requested by its callers because of an
16 -- unexpected error.
17 --
18 FA_RET_SUCCESS CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
19 FA_RET_ERROR CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_ERROR;
20 FA_RET_UNEXPECTED CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_UNEXP_ERROR;
21
22 -- Error Exception
23 --
24 -- FA_EXC_ERROR An known error and program can handle by setting defined
25 -- error message
26 -- FA_EXC_UNEXPECTED An unexpected error which usually is a database error
27 -- and program return SQL error message
28 --
29 FA_EXC_ERROR EXCEPTION;
30 FA_EXC_UNEXPECTED EXCEPTION;
31
32 -- Message Level
33 --
34 -- FA_MSG_DEBUG FA profile value of 'PRINT_DEBUG'
35 --
36 -- FA_ERROR_LEVEL Message level
37 --
38 FA_MSG_DEBUG VARCHAR2(3) := 'NO';
39 FA_ERROR_LEVEL NUMBER := 10;
40
41
42
43 -- Procedure Init_Server_Message
44 --
45 -- Usage Called by server side program to intialize the global API
46 -- message table and get the value of 'PRINT_DEBUG' user profile
47 --
48 PROCEDURE Init_Server_Message;
49
50
51 -- Procedure Reset_Server_Message
52 --
53 -- Usage Called by server side program to delete all messageds on
54 -- the global API message table
55 --
56 PROCEDURE Reset_Server_Message;
57
58
59 -- Procedure Add_SQL_Error
60 --
61 -- Usage Called from 'WHEN OTHER' exception to insert SQL error
62 -- message for unexcepted database error and calling function
63 -- name into message stack. Also, it resets the global message
64 -- level to 1.
65 --
66 -- Example
67 -- WHEN OTHERS then
68 -- FA_SRVR_MSG.Add_SQL_Error
69 -- (calling_fn => 'ALEX_TEST_PKG.Check_Book_Status');
70 --
71 PROCEDURE Add_SQL_Error
72 ( calling_fn in varchar2,
73 p_log_level_rec in fa_api_types.log_level_rec_type default null);
74
75
76 -- Procedure Add_Message
77 --
78 -- Usage Called by server side function to a pre-defined error message
79 -- and/or calling function name into message stack and global API
80 -- message table.
81 --
82 -- Desc Add_Message inserts calling function name into message stack
83 -- only if the global FA_MSG_DEBUG is 'YES' or FA_ERROR_LEVEL is 1.
84 --
85 -- Example
86 -- a. insert function name to the stack:
87 --
88 -- FA_SRVR_MSG.add_message
89 -- (CALLING_FN => 'ALEX_TEST_PKG.Check_Book_Status');
90 --
91 -- b. insert pre-defined message to the stack:
92 --
93 -- FA_SRVR_MSG.add_message
94 -- (CALLING_FN => 'ALEX_TEST_PKG.Check_Book_Status',
95 -- NAME => 'FA_TFRINV_ZERO_TFR_COST');
96 --
97 -- c. insert pre-defined message with token to the stack:
98 --
99 -- FA_SRVR_MSG.add_message
100 -- (CALLING_FN => 'ALEX_TEST_PKG.Check_Book_Status',
101 -- NAME => 'FA_ACCOUNT_CCID_CANNOT_UPGRADE',
102 -- TOKEN1 => 'BOOK',
103 -- VALUE1 => X_Book_TYpe_Code);
104 --
105 PROCEDURE Add_Message
106 ( calling_fn in varchar2,
107 name in varchar2 := null,
108 token1 in varchar2 := null,
109 value1 in varchar2 := null,
110 token2 in varchar2 := null,
111 value2 in varchar2 := null,
112 token3 in varchar2 := null,
113 value3 in varchar2 := null,
114 token4 in varchar2 := null,
115 value4 in varchar2 := null,
116 token5 in varchar2 := null,
117 value5 in varchar2 := null,
118 translate in boolean := FALSE,
119 application in varchar2 := 'OFA',
120 p_log_level_rec in fa_api_types.log_level_rec_type default null,
121 p_message_level in number := FND_LOG.LEVEL_ERROR );
122
123
124 -- Prodedure Get_Message
125 --
126 -- Usage Called by client side program to return the number of messages
127 -- table and messages text in decoded and translated mode on the
128 -- golbal API message table
129 --
130 -- Parameters mesg_count IN OUT NUMBER number of messages in message table
131 -- mesg1 - mesg7 IN OUT VARCHAR2 message text
132 --
133 PROCEDURE Get_Message
134 ( mesg_count in out nocopy number,
135 mesg1 in out nocopy varchar2,
136 mesg2 in out nocopy varchar2,
137 mesg3 in out nocopy varchar2,
138 mesg4 in out nocopy varchar2,
139 mesg5 in out nocopy varchar2,
140 mesg6 in out nocopy varchar2,
141 mesg7 in out nocopy varchar2
142 , p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null);
143
144
145 -- Procedure Set_Message_Level
146 --
147 -- Usage Called by server side program to set the global variable
148 -- FA_ERROR_LEVEL.
149 --
150 -- Desc By default, the FA_ERROR_LEVEL is set to 10 and Add_Message
151 -- only inserts a pre-defined message into message stack and does
152 -- not insert the calling function name into stack. You can call
153 -- Set_Message_Level to override the default setting to insert
154 -- calling function name into stack.
155 --
156 PROCEDURE Set_Message_Level
157 ( message_level in number, p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null);
158
159
160 -- Prodedure Dump_API_Messages
161 --
162 -- Usage Called by server program for debugging purpose.
163 -- It prints all messages on API message stack to screen.
164 --
165 PROCEDURE Dump_API_Messages;
166
167 -- Procedure Write_Msg_Log
168 --
169 -- Usage To get messages from message stack and write to log file.
170 --
171 -- Parameters msg_data -- this value is actually not in use, since we do not
172 -- want to rely on the data, which we are not sure whether it is
173 -- in encoded or translated format.
174 PROCEDURE Write_Msg_Log
175 ( msg_count in number,
176 msg_data in varchar2, p_log_level_rec IN FA_API_TYPES.log_level_rec_type default null);
177
178
179 END FA_SRVR_MSG;