1 PACKAGE FA_SRVR_MSG as
2 /* $Header: FASMESGS.pls 120.3 2005/06/25 00:35:11 snarayan 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
77 -- Procedure Add_Message
78 --
79 -- Usage Called by server side function to a pre-defined error message
80 -- and/or calling function name into message stack and global API
81 -- message table.
82 --
83 -- Desc Add_Message inserts calling function name into message stack
84 -- only if the global FA_MSG_DEBUG is 'YES' or FA_ERROR_LEVEL is 1.
85 --
86 -- Example
87 -- a. insert function name to the stack:
88 --
89 -- FA_SRVR_MSG.add_message
90 -- (CALLING_FN => 'ALEX_TEST_PKG.Check_Book_Status');
91 --
92 -- b. insert pre-defined message to the stack:
93 --
94 -- FA_SRVR_MSG.add_message
95 -- (CALLING_FN => 'ALEX_TEST_PKG.Check_Book_Status',
96 -- NAME => 'FA_TFRINV_ZERO_TFR_COST');
97 --
98 -- c. insert pre-defined message with token to the stack:
99 --
100 -- FA_SRVR_MSG.add_message
101 -- (CALLING_FN => 'ALEX_TEST_PKG.Check_Book_Status',
102 -- NAME => 'FA_ACCOUNT_CCID_CANNOT_UPGRADE',
103 -- TOKEN1 => 'BOOK',
104 -- VALUE1 => X_Book_TYpe_Code);
105 --
106 PROCEDURE Add_Message
107 ( calling_fn in varchar2,
108 name in varchar2 := null,
109 token1 in varchar2 := null,
110 value1 in varchar2 := null,
111 token2 in varchar2 := null,
112 value2 in varchar2 := null,
113 token3 in varchar2 := null,
114 value3 in varchar2 := null,
115 token4 in varchar2 := null,
116 value4 in varchar2 := null,
117 token5 in varchar2 := null,
118 value5 in varchar2 := null,
119 translate in boolean := FALSE,
120 application in varchar2 := 'OFA',
121 p_log_level_rec in fa_api_types.log_level_rec_type default null,
122 p_message_level in number := FND_LOG.LEVEL_ERROR
123 );
124
125
126 -- Prodedure Get_Message
127 --
128 -- Usage Called by client side program to return the number of messages
129 -- table and messages text in decoded and translated mode on the
130 -- golbal API message table
131 --
132 -- Parameters mesg_count IN OUT NUMBER number of messages in message table
133 -- mesg1 - mesg7 IN OUT VARCHAR2 message text
134 --
135 PROCEDURE Get_Message
136 ( mesg_count in out nocopy number,
137 mesg1 in out nocopy varchar2,
138 mesg2 in out nocopy varchar2,
139 mesg3 in out nocopy varchar2,
140 mesg4 in out nocopy varchar2,
141 mesg5 in out nocopy varchar2,
142 mesg6 in out nocopy varchar2,
143 mesg7 in out nocopy varchar2
144 );
145
146
147 -- Procedure Set_Message_Level
148 --
149 -- Usage Called by server side program to set the global variable
150 -- FA_ERROR_LEVEL.
151 --
152 -- Desc By default, the FA_ERROR_LEVEL is set to 10 and Add_Message
153 -- only inserts a pre-defined message into message stack and does
154 -- not insert the calling function name into stack. You can call
155 -- Set_Message_Level to override the default setting to insert
156 -- calling function name into stack.
157 --
158 PROCEDURE Set_Message_Level
159 ( message_level in number);
160
161
162 -- Prodedure Dump_API_Messages
163 --
164 -- Usage Called by server program for debugging purpose.
165 -- It prints all messages on API message stack to screen.
166 --
167 PROCEDURE Dump_API_Messages;
168
169 -- Procedure Write_Msg_Log
170 --
171 -- Usage To get messages from message stack and write to log file.
172 --
173 -- Parameters msg_data -- this value is actually not in use, since we do not
174 -- want to rely on the data, which we are not sure whether it is
175 -- in encoded or translated format.
176 PROCEDURE Write_Msg_Log
177 ( msg_count in number,
178 msg_data in varchar2);
179
180
181 END FA_SRVR_MSG;