DBA Data[Home] [Help]

PACKAGE BODY: APPS.MRP_UTIL

Source


1 PACKAGE BODY MRP_UTIL AS
2 /* $Header: MRPUTILB.pls 115.2 2004/08/05 18:36:07 skanta ship $  */
3 
4 -- log messaging if debug is turned on
5 PROCEDURE MRP_DEBUG(buf  IN  VARCHAR2)
6 IS
7 BEGIN
8   -- if MRP:Debug profile is not set return
9   IF (G_MRP_DEBUG <> 'Y') THEN
10     return;
11   END IF;
12   -- add a line of text to the log file and
13 
14   FND_FILE.PUT_LINE(FND_FILE.LOG, buf);
15 
16   return;
17 
18 EXCEPTION
19   WHEN OTHERS THEN
20     return;
21 END MRP_DEBUG;
22 
23 -- log messaging irrespective of whether debug is turned on or off
24 PROCEDURE MRP_LOG(buf  IN  VARCHAR2)
25 IS
26 BEGIN
27 
28   -- log the message
29   FND_FILE.PUT_LINE(FND_FILE.LOG, buf);
30 
31   return;
32 
33 EXCEPTION
34   WHEN OTHERS THEN
35     return;
36 END MRP_LOG;
37 
38 -- out messaging
39 PROCEDURE MRP_OUT(buf IN VARCHAR2)
40 IS
41 BEGIN
42     -- add a line of text to the output file and
43 	-- add the line terminator
44     FND_FILE.PUT_LINE(FND_FILE.OUTPUT, buf);
45 	FND_FILE.NEW_LINE(FND_FILE.OUTPUT,1);
46 
47     return;
48 
49 EXCEPTION
50   WHEN OTHERS THEN
51 	return;
52 END MRP_OUT;
53 
54 --
55 FUNCTION lookup_desc(l_type in mfg_lookups.lookup_type%TYPE,
56                         l_code in mfg_lookups.lookup_code%TYPE) RETURN VARCHAR2 IS
57 
58     CURSOR cur_desc(x_type mfg_lookups.lookup_type%TYPE,
59                     x_code mfg_lookups.lookup_code%TYPE)
60     IS
61      SELECT meaning
62      FROM mfg_lookups
63      WHERE lookup_code = x_code
64      AND lookup_type = x_type;
65 
66     l_desc mfg_lookups.meaning%TYPE;
67 BEGIN
68         IF l_code is null then return null;
69         ELSE
70             open cur_desc(l_type,l_code);
71             fetch cur_desc into l_desc;
72             close cur_desc;
73         END IF;
74         RETURN l_desc;
75 EXCEPTION
76    WHEN OTHERS THEN
77       RETURN null;
78 END lookup_desc;
79 
80 END MRP_UTIL;