DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_VENDOR_SITES_GRP

Source


1 PACKAGE BODY PO_VENDOR_SITES_GRP AS
2 /* $Header: POXGDVSB.pls 120.2 2006/07/21 13:32:05 skalra noship $ */
3 -------------------------------------------------------------------------------
4 --Start of Comments
5 --Name: Get_Transmission_Defaults
6 --Pre-reqs:
7 --  None.
8 --Modifies:
9 --  None.
10 --Locks:
11 --  None.
12 --Function:
13 -- This procedure is built as a wrapper over procedure get_transmission_defaults--  in the package PO_VENDOR_SITES_SV to allowed to be called by other apps.
14 
15 --Parameters:
16 --IN:
17 --p_api_version
18 --  API version
19 --p_init_msg_list
20 --  True/False parameter to initialize message list
21 --p_document_id
22 --  PO header ID
23 --p_document_type
24 --    This will be parsed to retrieve the PO document type
25 --    The document types are :
26 --        PO : For Standard/Planned
27 --        PA : For Blanket/Contract
28 --        RELEASE : Release
29 --p_document_subtype:
30 --    The subtype of the document.
31 --        Valid Document types and Document subtypes are
32 --        Document Type      Document Subtype
33 --        RELEASE      --->  SCHEDULED/BLANKET
34 --        PO           --->  PLANNED/STANDARD
35 --        PA           --->  CONTRACT/BLANKET
36 --
37 --p_preparer_id
38 --     Preparer_id of the document.
39 --OUT:
40 --x_default_method -
41 --     Default supplier communication method set up in the vendor sites.
42 --x_email_address
43 --     Email address where the email should be sent.
44 --x_fax_number
45 --     Fax number where the fax should be sent.
46 --x_document_num
47 --     Document Number.
48 --x_print_flag
49 --     Set to 'Y' if default transmission method is PRINT
50 --x_fax_flag
51 --     Set to 'Y' if default transmission method is FAX
52 --x_email_flag
53 --     Set to 'Y' if default transmission method is EMAIL
54 --x_return_status
55 --     FND_API.G_RET_STS_ERROR - for expected error
56 --     FND_API.G_RET_STS_UNEXP_ERROR - for unexpected error
57 --     FND_API.G_RET_STS_SUCCESS - for success
58 --x_msg_count
59 --     Message count i.e number of messages in the fnd message stack
60 --x_msg_data
61 --     Message data in fnd message stack
62 
63 --Notes:
64 -- This is a wrapper API for PO_VENDOR_SITES_SV.Get_Transmission_Defaults() to
65 -- retrieve Supplier's default transmission method. Print,Fax or E-Mail flags
66 -- are set appropriately to help in calling of further APIs such as
67 -- po_reqapproval_init1.start_wf_process().
68 --Testing:
69 --
70 --End of Comments
71 -------------------------------------------------------------------------------
72 Procedure Get_Transmission_Defaults(p_api_version        IN VARCHAR2,
73                                     p_init_msg_list      IN VARCHAR2 := FND_API.G_FALSE,
74                                     p_document_id        IN NUMBER,
75                                     p_document_type      IN VARCHAR2,
76                                     p_document_subtype   IN VARCHAR2,
77                                     p_preparer_id        IN OUT NOCOPY NUMBER,
78                                     x_default_method     OUT NOCOPY VARCHAR2,
79                                     x_email_address      OUT NOCOPY VARCHAR2,
80                                     x_fax_number         OUT NOCOPY VARCHAR2,
81                                     x_document_num       OUT NOCOPY VARCHAR2,
82                                     x_print_flag         OUT NOCOPY VARCHAR2,
83                                     x_fax_flag           OUT NOCOPY VARCHAR2,
84                                     x_email_flag         OUT NOCOPY VARCHAR2,
85                                     x_return_status      OUT NOCOPY VARCHAR2,
86                                     x_msg_count          OUT NOCOPY NUMBER,
87                                     x_msg_data           OUT NOCOPY VARCHAR2) IS
88 
89 l_api_name CONSTANT VARCHAR2(30) := 'Get_Transmission_Defaults';
90 l_api_version CONSTANT NUMBER := 1.0;
91 BEGIN
92 x_print_flag := 'N';
93 x_fax_flag := 'N';
94 x_email_flag := 'N';
95 
96     IF NOT (FND_API.compatible_api_call(l_api_version
97                                      ,p_api_version
98                                      ,l_api_name
99                                      ,g_pkg_name)) THEN
100         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
101     END IF;
102 
103 
104     -- initialize API return status to success
105     x_return_status:= FND_API.G_RET_STS_SUCCESS;
106 
107     IF (FND_API.to_Boolean(p_init_msg_list)) THEN
108         FND_MSG_PUB.initialize;
109     END IF;
110 
111     /* Call Get_transmission_Defaults from PO_VENDOR_SITES_SV package */
112     PO_VENDOR_SITES_SV.Get_Transmission_Defaults(
113                                       p_document_id =>  p_document_id,
114                                       p_document_type =>  p_document_type,
115                                       p_document_subtype => p_document_subtype,
116                                       p_preparer_id => p_preparer_id,
117                                       x_default_method => x_default_method,
118                                       x_email_address => x_email_address,
119                                       x_fax_number => x_fax_number,
120                                       x_document_num => x_document_num);
121 
122     IF (x_default_method = 'EMAIL') THEN
123         x_email_flag := 'Y';
124     ELSIF  (x_default_method = 'PRINT') THEN
125         x_print_flag := 'Y';
126     ELSIF  (x_default_method = 'FAX') THEN
127         x_fax_flag := 'Y';
128     END IF;
129 
130 EXCEPTION
131     WHEN OTHERS THEN
132         X_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
133 
134         IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
135             FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
136             IF (g_fnd_debug='Y') THEN
137                 IF (FND_LOG.G_CURRENT_RUNTIME_LEVEL <= FND_LOG.LEVEL_UNEXPECTED) THEN
138                   FND_LOG.string(log_level => FND_LOG.level_unexpected
139                                ,module    => g_module_prefix ||l_api_name
140                                ,message   => SQLERRM);
141                 END IF;
142             END IF;
143        END IF;
144 
145        FND_MSG_PUB.Count_and_Get(p_count => x_msg_count
146                                 ,p_data  => x_msg_data);
147 
148 END Get_Transmission_Defaults;
149 
150 END PO_VENDOR_SITES_GRP;