DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKL_ACCOUNT_GENERATOR_PUB

Source


1 PACKAGE BODY OKL_ACCOUNT_GENERATOR_PUB AS
2 /* $Header: OKLPAGTB.pls 120.3 2005/10/30 04:20:54 appldev noship $ */
3 
4 -- Changed by Santonyr on 22-Sep-2004 to fix bug 3901209.
5 -- Added a new parameter 'p_ae_tmpt_line_id'.
6 -- If Account Generator fails due to lack of sources, it picks up the
7 -- default account code for the passed account template line and returns.
8 
9 -- Changed the signature for bug 4157521
10 
11 FUNCTION GET_CCID
12 (
13   p_api_version          	IN  NUMBER,
14   p_init_msg_list        	IN  VARCHAR2,
15   x_return_status        	OUT NOCOPY VARCHAR2,
16   x_msg_count            	OUT NOCOPY NUMBER,
17   x_msg_data             	OUT NOCOPY VARCHAR2,
18   p_acc_gen_wf_sources_rec       IN  acc_gen_wf_sources_rec,
19   p_ae_line_type		IN  okl_acc_gen_rules.ae_line_type%TYPE,
20   p_primary_key_tbl    		IN  primary_key_tbl,
21   p_ae_tmpt_line_id		IN NUMBER DEFAULT NULL
22 )
23 RETURN NUMBER
24 AS
25   l_api_version   NUMBER := 1.0;
26   l_api_name          CONSTANT VARCHAR2(30)  := 'OKL_ACCOUNT_GENERATOR';
27   l_return_status     VARCHAR2(1)  := OKL_API.G_RET_STS_SUCCESS;
28   l_Code_Combination_Id		NUMBER := -1;
29 
30 BEGIN
31   SAVEPOINT ACCOUNT_GENERATOR;
32   x_return_status    := FND_API.G_RET_STS_SUCCESS;
33   -- customer pre-processing
34 
35 
36 
37 -- Execute the Main Procedure
38 
39 -- Changed the signature for bug 4157521
40 
41       l_Code_Combination_id := OKL_ACCOUNT_GENERATOR_PVT.GET_CCID(p_api_version 	  	  => l_api_version,
42                                          p_init_msg_list 	  => p_init_msg_list,
43                                          x_return_status 	  => x_return_status,
44 					 x_msg_count 		  => x_msg_count,
45    	   	                         x_msg_data 		  => x_msg_data,
46 					 p_acc_gen_wf_sources_rec      => p_acc_gen_wf_sources_rec,
47   	   	                         p_ae_line_type      	  => p_ae_line_type,
48   	   	                         p_primary_key_tbl 	  => p_primary_key_tbl,
49   	   	                         p_ae_tmpt_line_id	  => p_ae_tmpt_line_id);
50 
51 
52   IF x_return_status = OKL_API.G_RET_STS_UNEXP_ERROR THEN
53       RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
54   ELSIF x_return_status = OKL_API.G_RET_STS_ERROR THEN
55       RAISE FND_API.G_EXC_ERROR;
56   END IF;
57 
58 
59 
60 
61   RETURN l_Code_Combination_id;
62 
63 EXCEPTION
64   WHEN FND_API.G_EXC_ERROR THEN
65       ROLLBACK TO ACCOUNT_GENERATOR;
66       x_return_status := FND_API.G_RET_STS_ERROR;
67       FND_MSG_PUB.Count_and_get(p_encoded => OKL_API.G_FALSE
68                                ,p_count   => x_msg_count
69                                ,p_data    => x_msg_data);
70       RETURN l_Code_Combination_id;
71   WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
72       ROLLBACK TO ACCOUNT_GENERATOR;
73       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
74       FND_MSG_PUB.Count_and_get(p_encoded => OKL_API.G_FALSE
75                                ,p_count   => x_msg_count
76                                ,p_data    => x_msg_data);
77       RETURN l_Code_Combination_id;
78   WHEN OTHERS THEN
79       FND_MSG_PUB.ADD_EXC_MSG('OKL_ACCOUNT_GENERATOR_PUB','GET_CCID');
80       FND_MSG_PUB.Count_and_get(p_encoded => OKL_API.G_FALSE
81                                ,p_count   => x_msg_count
82                                ,p_data    => x_msg_data);
83       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
84       RETURN l_Code_Combination_id;
85 END GET_CCID;
86 
87 
88 END OKL_ACCOUNT_GENERATOR_PUB;