DBA Data[Home] [Help]

PACKAGE BODY: APPS.AST_UWQ_LLIST_MSG_PKG

Source


1 package body AST_UWQ_LLIST_MSG_PKG AS
2 /* $Header: astulmsb.pls 115.9 2003/02/25 19:29:41 jraj ship $ */
3 
4 procedure AST_UWQ_LLIST_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(2000);
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 
31    cursor c_source_description(p_source_code_id in number) is
32      select  '< Source Code: ' || source_code || ' >'
33      ||  ' < Name: ' || name || ' >'
34      ||  ' < Description: '  || description || ' >'
35      from ams_source_codes_details_v where
36 	source_code_id = p_source_code_id;
37 BEGIN
38 
39 	FOR I IN 1.. p_action_input_data_list.COUNT LOOP
40               l_name := p_action_input_data_list(i).name;
41               l_value := p_action_input_data_list(i).value;
42 
43               ------ Get field name and value of your records ------
44 
45 	   if     l_name = 'SOURCE_PROMOTION_ID'   then
46    	        l_source_code_id :=  l_value ;
47 			exit;
48 	   end if;
49 	END LOOP;
50 
51   if  p_action_key = 'astulmsb_camp_details' then  -- begin of main "if"
52 
53         if l_source_code_id is not null then
54   	  OPEN c_source_description(l_source_code_id);
55 	    fetch c_source_description into l_description;
56 
57 	    if c_source_description%found then
58 		null;
59             else
60 	-- ERROR --
61 	    x_return_status := FND_API.g_ret_sts_unexp_error;
62 		  fnd_message.set_name('AST','AST_UWQ_INVALID_SOURCE');
63 		  l_error_msg :=   fnd_message.get;
64             FND_MESSAGE.Set_Name('AST', 'AST_API_ERR');
65             FND_MESSAGE.Set_Token('TEXT', l_error_msg || ' ' || l_description, FALSE);
66             FND_MSG_PUB.ADD;
67             RAISE FND_API.G_EXC_ERROR;
68            end if;
69          CLOSE c_source_description;
70 
71 	  else
72             fnd_message.set_name('AST','AST_NO_SOURCE_DATA');
73             l_no_source :=   fnd_message.get;
74             l_description := '< '|| l_no_source || ': > ';
75           end if;
76 
77      -- setting the OUT variables -begin
78 
79 	 x_mesg_data_char	:=l_description;
80          x_return_status	:=fnd_api.g_ret_sts_success;
81 
82 	 fnd_msg_pub.Count_And_Get(p_count => x_msg_count,
83 	                           p_data  => x_msg_data);
84 
85      -- setting the OUT variables -end
86      end if;     -- end of main "if"
87 	exception
88 
89 	when fnd_api.g_exc_error  then
90       x_return_status:=fnd_api.g_ret_sts_error;
91 
92 	when fnd_api.g_exc_unexpected_error  then
93       x_return_status:=fnd_api.g_ret_sts_unexp_error;
94 
95 	when others then
96       x_return_status:=fnd_api.g_ret_sts_unexp_error;
97 
98 	 fnd_msg_pub.Count_And_Get(p_count => x_msg_count,
99 	                           p_data  => x_msg_data);
100 
101 END AST_UWQ_LLIST_MESSAGE;
102 
103 END AST_UWQ_LLIST_MSG_PKG;