DBA Data[Home] [Help]

PACKAGE BODY: APPS.AST_UWQ_OLIST_MSG_PKG

Source


1 package body AST_UWQ_OLIST_MSG_PKG AS
2 /* $Header: astuomsb.pls 115.3 2003/02/19 01:08:19 jraj ship $ */
3 
4 procedure AST_UWQ_OLIST_MESSAGE
5  ( p_resource_id        	IN  NUMBER,
6    p_language           	IN  VARCHAR2 DEFAULT NULL,
7    p_source_lang        	IN  VARCHAR2 DEFAULT NULL,
8    p_action_key         	IN  VARCHAR2,
9    p_action_input_data_list 	IN system.action_input_data_nst DEFAULT null,
10    x_mesg_data_char 	 OUT NOCOPY VARCHAR2,
11    x_msg_count              OUT NOCOPY VARCHAR2,
12    x_msg_data                OUT NOCOPY VARCHAR2,
13    x_return_status           OUT NOCOPY VARCHAR2) AS
14 
15    l_description  varchar2(8200);
16 
17    l_name  varchar2(500);
18    l_value  varchar2(1996);
19 
20    l_source_code_id  number;
21    l_source_descr varchar2(3000);
22 
23    l_no_source varchar2(3000);
24 
25    l_return_status          VARCHAR2(1);
26    l_msg_count              NUMBER;
27    l_msg_data               VARCHAR2(2000);
28    l_error_msg			   VARCHAR2(100);
29 
30    cursor c_source_description(p_source_code_id in number) is
31      select  '< Source Code: ' || source_code || ' >'
32      ||  ' < Name: ' || name || ' >'
33      ||  ' < Description: '  || description || ' >'
34      from ams_source_codes_details_v where
35 	source_code_id = p_source_code_id;
36 BEGIN
37 
38 	FOR I IN 1.. p_action_input_data_list.COUNT LOOP
39               l_name := p_action_input_data_list(i).name;
40               l_value := p_action_input_data_list(i).value;
41 
42               ------ Get field name and value of your records ------
43 
44 	   if     l_name = 'SOURCE_PROMOTION_ID'   then
45    	        l_source_code_id :=  l_value ;
46 			exit;
47 	   end if;
48 	END LOOP;
49 
50   if  p_action_key = 'astuomsb_camp_details' then  -- begin of main "if"
51 
52         if l_source_code_id is not null then
53   	  OPEN c_source_description(l_source_code_id);
54 	    fetch c_source_description into l_description;
55 
56 	    if c_source_description%found then
57 		null;
58             else
59 	-- ERROR --
60 	    x_return_status := FND_API.g_ret_sts_unexp_error;
61 		  fnd_message.set_name('AST','AST_UWQ_INVALID_SOURCE');
62 		  l_error_msg :=   fnd_message.get;
63             FND_MESSAGE.Set_Name('AST', 'AST_API_ERR');
64             FND_MESSAGE.Set_Token('TEXT', l_error_msg || ' ' || l_description, FALSE);
65             FND_MSG_PUB.ADD;
66             RAISE FND_API.G_EXC_ERROR;
67            end if;
68          CLOSE c_source_description;
69 	  else
70             fnd_message.set_name('AST','AST_NO_SOURCE_DATA');
71             l_no_source :=   fnd_message.get;
72             l_description := '< '|| l_no_source || ': > ';
73           end if;
74 
75      -- setting the OUT variables -begin
76 
77 	 x_mesg_data_char	:=l_description;
78          x_return_status	:=fnd_api.g_ret_sts_success;
79 
80 	 fnd_msg_pub.Count_And_Get(p_count => x_msg_count,
81 	                           p_data  => x_msg_data);
82 
83      -- setting the OUT variables -end
84      end if;     -- end of main "if"
85 	exception
86 
87 	when fnd_api.g_exc_error  then
88       x_return_status:=fnd_api.g_ret_sts_error;
89 
90 	when fnd_api.g_exc_unexpected_error  then
91       x_return_status:=fnd_api.g_ret_sts_unexp_error;
92 
93 	when others then
94       x_return_status:=fnd_api.g_ret_sts_unexp_error;
95 
96 	 fnd_msg_pub.Count_And_Get(p_count => x_msg_count,
97 	                           p_data  => x_msg_data);
98 
99 END AST_UWQ_OLIST_MESSAGE;
100 
101 END AST_UWQ_OLIST_MSG_PKG;