[Home] [Help]
PACKAGE BODY: APPS.EAM_ISUP_CHECK_WO_PUB
Source
1 PACKAGE BODY EAM_ISUP_CHECK_WO_PUB AS
2 /* $Header: EAMISWPB.pls 120.1 2005/11/08 23:17:41 mmaduska noship $ */
3 /***************************************************************************
4 --
5 -- Copyright (c) 2002 Oracle Corporation, Redwood Shores, CA, USA
6 -- All rights reserved.
7 --
8 -- FILENAME
9 --
10 -- EAMISWPB.pls
11 --
12 -- DESCRIPTION
13 --
14 -- Body of package EAM_ISUP_CHECK_WO_PUB
15 --
16 -- NOTES
17 --
18 -- HISTORY
19 --
20 -- 02-NOV-2005 Basanth Roy Initial Creation
21 ***************************************************************************/
22 g_pkg_name CONSTANT VARCHAR2(30):= 'EAM_ISUP_CHECK_WO_PUB';
23
24
25 PROCEDURE CHECK_WO_EXISTS
26 ( p_bo_identifier IN VARCHAR2 := 'EAM'
27 , p_api_version_number IN NUMBER := 1.0
28 , p_init_msg_list IN BOOLEAN := FALSE
29 , p_commit IN VARCHAR2 := 'N'
30 , p_header_id IN NUMBER
31 , p_release_id IN NUMBER
32 , x_wo_exists OUT NOCOPY VARCHAR2
33 , x_return_status OUT NOCOPY VARCHAR2
34 , x_msg_count OUT NOCOPY NUMBER
35 )
36 IS
37
38 l_count NUMBER;
39 l_module VARCHAR2(50);
40 l_message_text VARCHAR2(4000);
41
42 BEGIN
43
44 l_module := 'EAM_ISUP_CHECK_WO_PUB';
45 x_wo_exists := 'N';
46 x_return_status := 'S';
47
48 select count(pda.wip_entity_id)
49 into l_count
50 from
51 po_distributions_all pda,
52 wip_entities we
53 where
54 pda.po_header_id = p_header_id
55 and pda.wip_entity_id = we.wip_entity_id
56 and we.entity_type in (6,7);
57
58 IF l_count > 0 THEN
59 x_wo_exists := 'Y';
60 RETURN;
61 END IF;
62
63 select count(pda.wip_entity_id)
64 into l_count
65 from
66 po_distributions_all pda,
67 wip_entities we
68 where
69 pda.po_release_id = p_release_id
70 and pda.wip_entity_id = we.wip_entity_id
71 and we.entity_type in (6,7);
72
73 IF l_count > 0 THEN
74 x_wo_exists := 'Y';
75 RETURN;
76 END IF;
77
78
79 RETURN;
80
81
82 EXCEPTION
83 WHEN OTHERS THEN
84 x_return_status := 'E';
85 l_message_text := l_module||' failed with ' ||SQLERRM;
86 RAISE_APPLICATION_ERROR(-20000, l_message_text);
87
88
89 END CHECK_WO_EXISTS;
90
91
92
93 END EAM_ISUP_CHECK_WO_PUB;