1 PACKAGE BODY AR_BPA_PARTY_SEARCH AS
2 /*$Header: ARBPDQMB.pls 120.6 2006/09/14 18:50:05 lishao noship $ */
3
4 /*=======================================================================+
5 | Package Global Constants
6 +=======================================================================*/
7
8 /*========================================================================
9 | Prototype Declarations Procedures
10 *=======================================================================*/
11
12
13 /*========================================================================
14 | Prototype Declarations Functions
15 *=======================================================================*/
16
17 /*========================================================================
18 | PUBLIC PROCEDURE DQM_SEARCH
19 |
20 | DESCRIPTION
21 | This procedure provides the cover routine for the call to the
22 | DQM search engine.
23 | This is used from the bill presentment architecture search pages.
24 |
25 | PARAMETERS
26 | p_keyword IN The keyword on which search is to
27 | be performed.
28 | p_search_context_id OUT NOCOPY The unique id returned by DQM
29 |
30 | KNOWN ISSUES
31 | Enter business functionality which was de-scoped as part of the
32 | implementation. Ideally this should never be used.
33 |
34 | NOTES
35 | Any interesting aspect of the code in the package body which needs
36 | to be stated.
37 |
38 | MODIFICATION HISTORY
39 | Date Author Description of Changes
40 | 11-Jan-2003 LISHAO Created
41 |
42 *=======================================================================*/
43 Procedure DQM_SEARCH (p_keyword IN varchar2,
44 p_search_context_id OUT NOCOPY NUMBER)
45 is
46 -- Pass Party search criteria in this variable
47 party_cond HZ_PARTY_SEARCH.PARTY_SEARCH_REC_TYPE;
48 l_count NUMBER;
49
50 -- Pass Party Site search criteria in this variable
51 party_site_cond HZ_PARTY_SEARCH.PARTY_SITE_LIST;
52
53 -- Pass Contact search criteria in this variable
54 contact_cond HZ_PARTY_SEARCH.CONTACT_LIST;
55
56 -- Pass Contact Point search criteria in this variable
57 contact_point_cond HZ_PARTY_SEARCH.CONTACT_POINT_LIST;
58
59 -- The Match Rule to use for the search
60 -- this should be set to the ID of the match rule you
61 -- created for your application
62 l_rule_number VARCHAR2(30);
63 l_rule_id NUMBER;
64 -- The Search Context ID returned by the API.
65 -- This is used to query the results table for
66 -- the matched records.
67 l_search_context_id NUMBER;
68
69 -- Other OUT NOCOPY parameters returned by the API.
70 l_return_status VARCHAR2(1);
71 l_msg_count NUMBER;
72 l_msg_data VARCHAR2(2000);
73
74 -- API also returns the number of matches.
75 l_num_matches NUMBER;
76
77 BEGIN
78 -- 1. Setup the Search criteria
79 party_cond.PARTY_ALL_NAMES := p_keyword;
80 -- party_cond.party_name := p_keyword;
81 -- party_cond.organization_name := p_keyword;
82
83 -- Note that the party_site, contact and contact point
84 -- search records are tables. So you can pass any
85 -- number of addresses to search on.
86
87 -- Note that Phone and Email address criteria need to
88 -- be passed seperately.
89 -- FND_PROFILE.get('HZ_SEARCH_RULE', l_rule_number);
90
91 --IF l_rule_number IS NULL THEN
92 --Bug 4528997: use "SAMPLE:BASIC SEARCH RULE" as the default rule.
93 --FND_MESSAGE.SET_NAME( 'AR', 'AR_BPA_NO_MATCH_RULE' );
94 --app_exception.raise_exception;
95 l_rule_id := 33;
96 -- ELSE
97 -- l_rule_id := to_number(l_rule_number);
98 -- END IF;
99
100 HZ_PARTY_SEARCH.find_parties (p_init_msg_list =>'T',
101 x_rule_id => l_rule_id,
102 p_party_search_rec => party_cond,
103 p_party_site_list => party_site_cond,
104 p_contact_list => contact_cond ,
105 p_contact_point_list => contact_point_cond,
106 p_restrict_sql => null,
107 p_search_merged => null,
108 x_search_ctx_id => l_search_context_id,
109 x_num_matches => l_num_matches,
110 x_return_status => l_return_status,
111 x_msg_count => l_msg_count,
112 x_msg_data => l_msg_data);
113
114 -- 3. Setup the SEARCH_RESULTS block to show the
115 -- results. This block is based on the Global Temporary Table
116 -- HZ_MATCHED_PARTIES_GT
117
118 p_search_context_id := l_search_context_id;
119
120 END DQM_SEARCH;
121
122
123 END AR_BPA_PARTY_SEARCH;