DBA Data[Home] [Help]

PACKAGE: APPS.OKC_CREATE_PO_FROM_K_PVT

Source


1 Package  OKC_CREATE_PO_FROM_K_PVT AUTHID CURRENT_USER AS
2  /* $Header: OKCRKPOS.pls 120.0 2005/05/26 09:35:10 appldev noship $ */
3 
4 
5 ----------------------------------------------------------------------------------
6 -- Start of comments
7 --
8 -- API Name     : okc_create_po_from_k_pvt.create_po_from_k
9 --
10 -- Type         : Private
11 --
12 -- Pre-reqs     : None
13 --
14 -- Function : This procedure is called from the public package
15 -- okc_create_po_from_k_pub. It accepts a Contract Identifier as a
16 -- parameter and uses it to create records in POs interface tables
17 -- which will be converted to a PO
18 --
19 -- Parameters   : Please see specification below. No special parameters.
20 --
21 -- Version      : Initial version
22 --
23 -- End of comments
24 ----------------------------------------------------------------------------------
25 
26   PROCEDURE create_po_from_k(p_api_version              IN  NUMBER
27 			               ,p_init_msg_list            IN  VARCHAR2
28 			               ,p_chr_id                   IN  okc_k_headers_b.ID%TYPE
29                               ,x_return_status            OUT NOCOPY VARCHAR2
30 			               ,x_msg_count                OUT NOCOPY NUMBER
31 			               ,x_msg_data                 OUT NOCOPY VARCHAR2);
32 
33 
34 ----------------------------------------------------------------------------------
35 -- Start of comments
36 --
37 -- API Name     : okc_create_po_from_k_pvt.tieback_related_objs_from_po
38 --
39 -- Type         : Private
40 --
41 -- Pre-reqs     : None
42 --
43 -- Function: This procedure is called from the Public package on the
44 -- second invokation of the Create PO from Contract. It is called
45 -- after the Population of Interface tables and Purchasing Documents
46 -- Open Interface. The purpose of the procedure is to tieback the
47 -- transactions. It also invokes the Purchasing Interface Errors
48 -- report as a concurrent program (not a child process)
49 --
50 -- Why tieback is needed: During the first pass of the main procedure,
51 -- records are created in okc_k_rel_objs with the contract
52 -- header/lines and the corresponding PO header/lines. After this,
53 -- PDOI is submitted to create the PO Header and lines from the
54 -- interface tables. It is possible that some lines or the entire
55 -- Contract does not get transferred over to PO. This will result in a
56 -- loss of data integrity since okc_k_rel_objs will be pointing to
57 -- non-existent objects. Hence cleanup of those objects is required
58 -- after PDOI is run.
59 --
60 -- This also prints the PO number in the out file.
61 --
62 -- Phase I specific: In Phase I, the current version of PDOI does not
63 -- accept po_ine_id. Hence the related object is initially created
64 -- linking K Line id to (PO Header Id+Line Num). After PDOI, the
65 -- correct line id is known and hence okc_k_rel_objs can be updated to
66 -- reflect this
67 --
68 -- Parameters : Please see specification below. No special parameters
69 --
70 -- Version      : Initial version
71 --
72 -- End of comments
73 --------------------------------------------------------------------------------
74 
75 PROCEDURE tieback_related_objs_from_po(
76                 p_api_version    IN NUMBER
77                ,p_init_msg_list  IN VARCHAR2
78                ,p_chr_id         IN okc_k_headers_b.id%TYPE
79                ,x_po_number     OUT NOCOPY VARCHAR2
80                ,x_return_status OUT NOCOPY VARCHAR2
81                ,x_msg_count     OUT NOCOPY NUMBER
82                ,x_msg_data      OUT NOCOPY VARCHAR2
83 								);
84 
85 ----------------------------------------------------------------------------------
86 -- Start of comments
87 --
88 -- API Name     : okc_create_po_from_k_pvt.set_notification_msg
89 --
90 -- Type         : Private
91 --
92 -- Pre-reqs     : None
93 --
94 -- Function     : This procedure sets the notification messages on the stack
95 --
96 -- Parameters   : Please see specification below. No special parameters.
97 --
98 -- Version      : Initial version
99 --
100 -- End of comments
101 ----------------------------------------------------------------------------------
102 PROCEDURE set_notification_msg (p_api_version                   IN NUMBER
103                     	       ,p_init_msg_list                 IN VARCHAR2
104    		                   ,p_application_name              IN VARCHAR2
105 		                   ,p_message_subject               IN FND_NEW_MESSAGES.MESSAGE_NAME%TYPE
106 		                   ,p_message_body 	                IN FND_NEW_MESSAGES.MESSAGE_NAME%TYPE
107 		                   ,p_message_body_token1 	    IN VARCHAR2
108 		                   ,p_message_body_token1_value     IN VARCHAR2
109 		                   ,p_message_body_token2 	    IN VARCHAR2
110 		                   ,p_message_body_token2_value     IN VARCHAR2
111                                ,p_message_body_token3 	    IN VARCHAR2
112 		                   ,p_message_body_token3_value     IN VARCHAR2
113 		                   ,x_return_status   		    OUT NOCOPY VARCHAR2);
114 
115   ----------------------------------------------------------------------------------
116 -- Start of comments
117 --
118 -- API Name     : okc_create_po_from_k_pvt.notify_buyer
119 --
120 -- Type         : Private
121 --
122 -- Pre-reqs     : None
123 --
124 -- Function     : This procedure notifies the buyer of a purchase order creation
125 --
126 -- Parameters   : Please see specification below. No special parameters.
127 --
128 -- Version      : Initial version
129 --
130 -- End of comments
131 ----------------------------------------------------------------------------------
132 
133     PROCEDURE notify_buyer(p_api_version                    IN NUMBER
134                           ,p_init_msg_list                  IN VARCHAR2
135                           ,p_application_name               IN VARCHAR2
136 		          ,p_message_subject                IN FND_NEW_MESSAGES.MESSAGE_NAME%TYPE
137 		          ,p_message_body 	            IN FND_NEW_MESSAGES.MESSAGE_NAME%TYPE
138 		          ,p_message_body_token1 	      IN VARCHAR2
139 		          ,p_message_body_token1_value      IN VARCHAR2
140 		          ,p_message_body_token2 	      IN VARCHAR2
141 		          ,p_message_body_token2_value      IN VARCHAR2
142                           ,p_message_body_token3 	      IN VARCHAR2
143 		       	  ,p_message_body_token3_value      IN VARCHAR2
144 		      	  ,p_chr_id                         IN OKC_K_HEADERS_B.ID%TYPE
145                           ,x_k_buyer_name                   OUT NOCOPY VARCHAR2
146                           ,x_return_status   		      OUT NOCOPY VARCHAR2
147                           ,x_msg_count                      OUT NOCOPY NUMBER
148                           ,x_msg_data                       OUT NOCOPY VARCHAR2);
149 
150 END OKC_CREATE_PO_FROM_K_PVT; -- Package Specification OKC_CREATE_PO_FROM_K_PVT