DBA Data[Home] [Help]

PACKAGE BODY: APPS.AK_ON_OBJECTS_GRP

Source


1 package body AK_ON_OBJECTS_GRP as
2 /* $Header: akdgonb.pls 120.2 2005/09/15 22:26:37 tshort ship $ */
3 
4 --=======================================================
5 --  Procedure   UPLOAD
6 --
7 --  Usage       Group API for loading flows, objects, regions,
8 --              and attributes from a loader file to the database.
9 --              This API should be used for uploading all AK loader
10 --              files to a database.
11 --
12 --  Desc        This API calls the corresponding private API to read
13 --              the all flow, object, region, and attribute data
14 --              (including all the tables in these business objects)
15 --              from the loader file, and update them to the database.
16 --
17 --  Results     The API returns the standard p_return_status parameter
18 --              indicating one of the standard return statuses :
19 --                  * Unexpected error
20 --                  * Error
21 --                  * Success
22 --  Parameters
23 --
24 --  Version     Initial version number  =   1.0
25 --  History     Current version number  =   1.0
26 --=======================================================
27 procedure UPLOAD (
28 p_validation_level         IN      NUMBER := FND_API.G_VALID_LEVEL_FULL,
29 p_api_version_number       IN      NUMBER,
30 p_init_msg_tbl             IN      BOOLEAN := FALSE,
31 p_msg_count                OUT NOCOPY     NUMBER,
32 p_msg_data                 OUT NOCOPY     VARCHAR2,
33 p_return_status            OUT NOCOPY     VARCHAR2
34 ) is
35 l_api_version_number CONSTANT number := 1.0;
36 l_api_name           CONSTANT varchar2(30) := 'Upload';
37 l_return_status  varchar2(1);
38 begin
39 --
40 -- Check verion number
41 --
42 IF NOT FND_API.Compatible_API_Call (
43 l_api_version_number, p_api_version_number, l_api_name,
44 G_PKG_NAME) then
45 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
46 return;
47 END IF;
48 
49 -- Initialize the message table if requested.
50 
51 if p_init_msg_tbl then
52 FND_MSG_PUB.initialize;
53 end if;
54 
55 --  savepoint Start_upload;
56 
57 --
58 -- Call private API to process the upload request
59 --
60 AK_ON_OBJECTS_PVT.UPLOAD (
61 p_validation_level => p_validation_level,
62 p_api_version_number => 1.0,
63 p_msg_count => p_msg_count,
64 p_msg_data => p_msg_data,
65 p_return_status => l_return_status
66 );
67 
68 if (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) or
69 (l_return_status = FND_API.G_RET_STS_ERROR) then
70 RAISE FND_API.G_EXC_ERROR;
71 end if;
72 
73 p_return_status := FND_API.G_RET_STS_SUCCESS;
74 
75 EXCEPTION
76 WHEN FND_API.G_EXC_ERROR THEN
77 p_return_status := FND_API.G_RET_STS_ERROR;
78 --    rollback to Start_upload;
79 WHEN OTHERS THEN
80 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
81 --    rollback to Start_upload;
82 FND_MSG_PUB.Build_Exc_Msg( G_PKG_NAME, l_api_name,
83 SUBSTR (SQLERRM, 1, 240) );
84 FND_MSG_PUB.Add;
85 
86 end UPLOAD;
87 
88 end AK_ON_OBJECTS_GRP;