DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_COMMITMENT_UTIL

Source


1 PACKAGE BODY OE_COMMITMENT_UTIL AS
2 /* $Header: OEXUCMTB.pls 120.0 2005/06/01 03:06:51 appldev noship $ */
3 
4 --  Global constant holding the package name
5 
6 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'OE_COMMITMENT_UTIL';
7 
8 ----------------------------------------
9 -- Procedure Get_Commitment_Info
10 -- This procedure is provided to be called by OTA team.
11 -- Abstract: given a line id, return the
12 --           commitment id, number, start date and end date.
13 --           Return NULL when there is no commitment on the line.
14 -- Note: The sql is selecting from oe_order_lines instead of oe_payments
15 --       This is fine for now while we're still storing the commitment id
16 --       in oe_order_lines.  This is done to avoid having odf files in
17 --       the patch.
18 ----------------------------------------
19 
20 PROCEDURE Get_Commitment_Info
21 (   p_line_id			IN 	NUMBER  := FND_API.G_MISS_NUM
22 , x_commitment_id OUT NOCOPY NUMBER
23 
24 , x_commitment_number OUT NOCOPY VARCHAR2
25 
26 , x_commitment_start_date OUT NOCOPY DATE
27 
28 , x_commitment_end_date OUT NOCOPY DATE
29 
30 )
31 IS
32 --
33 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
34 --
35 BEGIN
36 
37 
38     SELECT  oe.commitment_id
39     ,	    ra.trx_number
40     ,	    ra.start_date_commitment
41     ,	    ra.end_date_commitment
42 
43     INTO    x_commitment_id
44     ,       x_commitment_number
45     ,       x_commitment_start_date
46     ,       x_commitment_end_date
47 
48     FROM    oe_order_lines oe
49     ,	    ra_customer_trx_all ra
50 
51     WHERE   oe.commitment_id = ra.customer_trx_id
52     AND     line_id = p_line_id
53     ;
54 
55 
56 EXCEPTION
57     WHEN NO_DATA_FOUND THEN
58 
59 	x_commitment_id := NULL;
60 	x_commitment_number := NULL;
61 	x_commitment_start_date := NULL;
62 	x_commitment_end_date := NULL;
63 
64     WHEN OTHERS THEN
65 
66         IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
67         THEN
68             FND_MSG_PUB.Add_Exc_Msg
69             (   G_PKG_NAME
70             ,   'Get_Commitment_Info'
71             );
72         END IF;
73 
74 END Get_Commitment_Info;
75 ---------------------------------------------------------------------
76 
77 END OE_COMMITMENT_UTIL;