DBA Data[Home] [Help]

PACKAGE BODY: APPS.OZF_CHARGEBACK_ATTRMAP_PUB

Source


1 PACKAGE BODY OZF_CHARGEBACK_ATTRMAP_PUB AS
2 /* $Header: ozfpcamb.pls 115.0 2003/06/26 05:06:00 mchang noship $ */
3 
4 -- Package name     : OZF_CHARGEBACK_ATTRMAP_PUB
5 -- Purpose          :
6 -- History          :
7 -- NOTE             :
8 -- End of Comments
9 
10 G_PKG_NAME      CONSTANT VARCHAR2(50) := 'OZF_CHARGEBACK_ATTRMAP_PUB';
11 G_FILE_NAME     CONSTANT VARCHAR2(20) := 'ozfpcamb.pls';
12 
13 ---------------------------------------------------------------------
14 -- PROCEDURE
15 --    get_sold_to_org_id
16 --
17 -- PURPOSE
18 --    This function returns the sold_to_org_id based on the input parameters.
19 --
20 --    User can modify the code to his own mapping rules and validation rules
21 --    for sold_to_org_id.  User can either use the input header record or the
22 --    interface table record based on the p_id to get the proper value.
23 --
24 --    Similar functions should be created if user wants to modify other attribute
25 --    in the header structure.
26 --
27 -- PARAMETERS
28 --    p_hdr   in oe_order_pub.header_rec_type
29 --    p_id    in number
30 --    return  number;
31 --
32 -- NOTES
33 ---------------------------------------------------------------------
34 PROCEDURE get_sold_to_org_id(
35            xp_hdr IN OUT NOCOPY oe_order_pub.header_rec_type
36 	  ,p_id  in number
37 	  ,x_return_status out NOCOPY varchar2)
38 IS
39 BEGIN
40   x_return_status := FND_API.G_RET_STS_SUCCESS;
41   -- Add Mapping and validation rules here
42 END get_sold_to_org_id;
43 
44 ---------------------------------------------------------------------
45 -- PROCEDURE
46 --    get_sold_to_org_id
47 --
48 -- PURPOSE
49 --    This function returns the sold_to_org_id based on the input parameters.
50 --    It overrides the function get_sold_to_org_id.
51 --
52 --    User can modify the code to his own mapping rules and validation rules
53 --    for sold_to_org_id.  User can either use the input header record or the
54 --    interface table record based on the p_id to get the proper value.
55 --
56 --    Similar functions should be created if user wants to modify other attribute
57 --    in the Line structure.
58 --
59 -- PARAMETERS
60 --    p_line   in oe_order_pub.line_rec_type
61 --    p_id    in number
62 --    return  number;
63 --
64 -- NOTES
65 ---------------------------------------------------------------------
66 PROCEDURE get_sold_to_org_id(
67            xp_line IN OUT NOCOPY oe_order_pub.line_rec_type
68 	   ,p_id  in number
69 	   ,x_return_status out NOCOPY varchar2)
70 IS
71 BEGIN
72     x_return_status := FND_API.G_RET_STS_SUCCESS;
73   -- Add Mapping and validation rules here
74 END get_sold_to_org_id;
75 
76 ---------------------------------------------------------------------
77 -- PROCEDURE
78 --    Create_Global_Header
79 --
80 -- PURPOSE
81 --    Create_Global_Header
82 --
83 -- PARAMETERS
84 --    xp_hdr                   INOUT NOCOPY OE_ORDER_PUB.HEADER_REC_TYPE
85 --    p_interface_id           IN    NUMBER
86 --
87 -- NOTES
88 --
89 ---------------------------------------------------------------------
90 PROCEDURE  Create_Global_Header
91 (
92     p_api_version            IN    NUMBER
93    ,p_init_msg_list          IN    VARCHAR2 := FND_API.G_FALSE
94    ,p_commit                 IN    VARCHAR2 := FND_API.G_FALSE
95    ,p_validation_level       IN    NUMBER   := FND_API.G_VALID_LEVEL_FULL
96 
97    ,x_return_status          OUT NOCOPY   VARCHAR2
98    ,x_msg_data               OUT NOCOPY   VARCHAR2
99    ,x_msg_count              OUT NOCOPY   NUMBER
100    ,xp_hdr                   IN OUT NOCOPY OE_ORDER_PUB.HEADER_REC_TYPE
101    ,p_interface_id           IN    NUMBER
102 )IS
103 l_api_name          CONSTANT VARCHAR2(30) := 'Create_Global_Header';
104 l_api_version       CONSTANT NUMBER := 1.0;
105 l_full_name         CONSTANT VARCHAR2(60) := G_PKG_NAME ||'.'|| l_api_name;
106 --
107 l_return_status          varchar2(30);
108 BEGIN
109    -- Standard begin of API savepoint
110     SAVEPOINT  Global_Header_Pub;
111     -- Standard call to check for call compatibility.
112     IF NOT FND_API.Compatible_API_Call (
113         l_api_version,
114         p_api_version,
115         l_api_name,
116         G_PKG_NAME)
117     THEN
118         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
119     END IF;
120 
121     -- Debug Message
122     IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
123         FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
124         FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
125         FND_MSG_PUB.Add;
126     END IF;
127 
128     --Initialize message list if p_init_msg_list is TRUE.
129     IF FND_API.To_Boolean (p_init_msg_list) THEN
130         FND_MSG_PUB.initialize;
131     END IF;
132     -- Initialize API return status to sucess
133     x_return_status := FND_API.G_RET_STS_SUCCESS;
134 
135     get_sold_to_org_id(xp_hdr   => xp_hdr,
136                        p_id     => p_interface_id,
137 		       x_return_status => l_return_status);
138     IF l_return_status = FND_API.g_ret_sts_error THEN
139        RAISE FND_API.g_exc_error;
140     ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
141        RAISE FND_API.g_exc_unexpected_error;
142     END IF;
143 
144     -- Debug Message
145     IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
146         FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
147         FND_MESSAGE.Set_Token('TEXT',l_full_name||': End');
148         FND_MSG_PUB.Add;
149     END IF;
150     --Standard call to get message count and if count=1, get the message
151     FND_MSG_PUB.Count_And_Get (
152         p_encoded => FND_API.G_FALSE,
153         p_count => x_msg_count,
154         p_data  => x_msg_data
155     );
156 EXCEPTION
157     WHEN FND_API.G_EXC_ERROR THEN
158         ROLLBACK TO Global_Header_Pub ;
159         x_return_status := FND_API.G_RET_STS_ERROR;
160         -- Standard call to get message count and if count=1, get the message
161         FND_MSG_PUB.Count_And_Get (
162             p_encoded => FND_API.G_FALSE,
163             p_count => x_msg_count,
164             p_data  => x_msg_data
165         );
166     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
167         ROLLBACK TO Global_Header_Pub;
168         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
169 	-- Standard call to get message count and if count=1, get the message
170         FND_MSG_PUB.Count_And_Get (
171             p_encoded => FND_API.G_FALSE,
172             p_count => x_msg_count,
173             p_data  => x_msg_data
174         );
175     WHEN OTHERS THEN
176         ROLLBACK TO Global_Header_Pub;
177         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
178         -- Standard call to get message count and if count=1, get the message
179         FND_MSG_PUB.Count_And_Get (
180             p_encoded => FND_API.G_FALSE,
181             p_count => x_msg_count,
182             p_data  => x_msg_data
183         );
184 END Create_Global_Header;
185 
186 
187 ---------------------------------------------------------------------
188 -- PROCEDURE
189 --    Create_Global_Line
190 --
191 -- PURPOSE
192 --    Create_Global_Line
193 --
194 -- PARAMETERS
195 --    xp_line                  INOUT NOCOPY OE_ORDER_PUB.line_REC_TYPE
196 --    p_interface_id           IN    NUMBER
197 --
198 -- NOTES
199 --
200 ---------------------------------------------------------------------
201 PROCEDURE  Create_Global_Line
202 (
203     p_api_version            IN    NUMBER
204    ,p_init_msg_list          IN    VARCHAR2 := FND_API.G_FALSE
205    ,p_commit                 IN    VARCHAR2 := FND_API.G_FALSE
206    ,p_validation_level       IN    NUMBER   := FND_API.G_VALID_LEVEL_FULL
207 
208    ,x_return_status          OUT NOCOPY   VARCHAR2
209    ,x_msg_data               OUT NOCOPY   VARCHAR2
210    ,x_msg_count              OUT NOCOPY   NUMBER
211    ,xp_line                  IN OUT NOCOPY OE_ORDER_PUB.LINE_REC_TYPE
212    ,p_interface_id           IN    NUMBER
213 )IS
214 l_api_name          CONSTANT VARCHAR2(30) := 'Create_Global_Line';
215 l_api_version       CONSTANT NUMBER := 1.0;
216 l_full_name         CONSTANT VARCHAR2(60) := G_PKG_NAME ||'.'|| l_api_name;
217 --
218 l_return_status          varchar2(30);
219 
220 BEGIN
221    -- Standard begin of API savepoint
222     SAVEPOINT  Global_Line_Pub;
223     -- Standard call to check for call compatibility.
224     IF NOT FND_API.Compatible_API_Call (
225         l_api_version,
226         p_api_version,
227         l_api_name,
228         G_PKG_NAME)
229     THEN
230         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
231     END IF;
232 
233     -- Debug Message
234     IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
235         FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
236         FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
237         FND_MSG_PUB.Add;
238     END IF;
239 
240     --Initialize message list if p_init_msg_list is TRUE.
241     IF FND_API.To_Boolean (p_init_msg_list) THEN
242         FND_MSG_PUB.initialize;
243     END IF;
244     -- Initialize API return status to sucess
245     x_return_status := FND_API.G_RET_STS_SUCCESS;
246 
247     -- Here is an example how to overwrite a value in the line global structure.
248     get_sold_to_org_id( xp_line   => xp_line,
249                         p_id       => p_interface_id,
250 		        x_return_status => l_return_status);
251     IF l_return_status = FND_API.g_ret_sts_error THEN
252        RAISE FND_API.g_exc_error;
253     ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
254        RAISE FND_API.g_exc_unexpected_error;
255     END IF;
256 
257     -- Debug Message
258     IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
259         FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
260         FND_MESSAGE.Set_Token('TEXT',l_full_name||': End');
261         FND_MSG_PUB.Add;
262     END IF;
263     --Standard call to get message count and if count=1, get the message
264     FND_MSG_PUB.Count_And_Get (
265         p_encoded => FND_API.G_FALSE,
266         p_count => x_msg_count,
267         p_data  => x_msg_data
268     );
269 EXCEPTION
270     WHEN FND_API.G_EXC_ERROR THEN
271         ROLLBACK TO Global_Line_Pub ;
272         x_return_status := FND_API.G_RET_STS_ERROR;
273         -- Standard call to get message count and if count=1, get the message
274         FND_MSG_PUB.Count_And_Get (
275             p_encoded => FND_API.G_FALSE,
276             p_count => x_msg_count,
277             p_data  => x_msg_data
278         );
279     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
280         ROLLBACK TO Global_Line_Pub;
281         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
282 	-- Standard call to get message count and if count=1, get the message
283         FND_MSG_PUB.Count_And_Get (
284             p_encoded => FND_API.G_FALSE,
285             p_count => x_msg_count,
286             p_data  => x_msg_data
287         );
288     WHEN OTHERS THEN
289         ROLLBACK TO Global_Line_Pub;
290         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
291         -- Standard call to get message count and if count=1, get the message
292         FND_MSG_PUB.Count_And_Get (
293             p_encoded => FND_API.G_FALSE,
294             p_count => x_msg_count,
295             p_data  => x_msg_data
296         );
297 END Create_Global_Line;
298 
299 END OZF_CHARGEBACK_ATTRMAP_PUB;