DBA Data[Home] [Help]

PACKAGE BODY: APPS.JL_ZZ_FA_UTILITIES_PKG

Source


1 PACKAGE BODY JL_ZZ_FA_UTILITIES_PKG AS
2 /* $Header: jlzzsutb.pls 115.1 99/09/03 13:16:51 porting shi $ */
3 
4   ------------------------------------------------------------
5   -- Procedure raise_error                                  --
6   --                                                        --
7   -- Retrieves an application code and message and stops    --
8   -- the execution of the program.                          --
9   ------------------------------------------------------------
10   PROCEDURE raise_error (p_app_name IN VARCHAR2
11                        , p_msg_name IN VARCHAR2
12                        , p_msg_type IN VARCHAR2) IS
13 
14     l_err_msg VARCHAR2(1000);
15 
16   BEGIN
17     fnd_message.set_name (p_app_name,p_msg_name);
18     l_err_msg := fnd_message.get;
19     app_exception.raise_exception (exception_type => p_msg_type
20     , exception_code =>
21       jl_zz_fa_utilities_pkg.get_app_errnum(p_app_name,p_msg_name)
22                                 , exception_text => l_err_msg);
23 
24   END raise_error;
25 
26   ------------------------------------------------------------
27   -- Procedure raise_ora_error                              --
28   --                                                        --
29   -- Retrieves an Oracle error and stops the execution of   --
30   -- the program.                                           --
31   ------------------------------------------------------------
32   PROCEDURE raise_ora_error IS
33     l_err_msg VARCHAR2(1000);
34 
35   BEGIN
36 
37     l_err_msg := SQLERRM;
38     app_exception.raise_exception (exception_text => l_err_msg);
39 
40   END raise_ora_error;
41 
42   ------------------------------------------------------------
43   -- Function get_app_errnum                                --
44   --                                                        --
45   -- Retrieves the application error number, with the       --
46   -- application short name and message name given.         --
47   ------------------------------------------------------------
48   FUNCTION get_app_errnum(p_app_name IN VARCHAR2,
49                           p_msg_name IN VARCHAR2)
50                           return number IS
51     msg_num FND_NEW_MESSAGES.MESSAGE_NUMBER%TYPE;
52 
53   BEGIN
54     BEGIN
55       select message_number
56       into msg_num
57       from fnd_new_messages a, fnd_application b
58       where upper(a.language_code) = upper(userenv('LANG'))
59       and   upper(a.message_name)  = upper(p_msg_name)
60       and   a.application_id       = b.application_id
61       and   b.application_short_name = upper(p_app_name);
62     EXCEPTION
63       when others then
64         msg_num := 0;
65     END;
66      return(msg_num);
67   END get_app_errnum;
68 
69   ------------------------------------------------------------
70   -- Procedure do_commit                                    --
71   --                                                        --
72   -- Execute commit at server side, to be able to execute   --
73   -- a "commit" in forms regardless of the trigger where    --
74   -- the code is being executed.                            --
75   ------------------------------------------------------------
76   PROCEDURE do_commit is
77   BEGIN
78     commit;
79   END do_commit;
80 
81 END JL_ZZ_FA_UTILITIES_PKG;