DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_REQ_ISO_SV

Source


1 PACKAGE BODY PO_REQ_ISO_SV AS
2 /* $Header: POXISOCB.pls 115.2 2002/11/23 03:28:39 sbull noship $ */
3 
4 PROCEDURE Call_Process_Order(x_oe_header_id   IN  NUMBER,
5                              x_oe_line_id     IN  NUMBER,
6                              x_oe_line_qty    IN  NUMBER,
7                              x_cancel_reason IN VARCHAR2,
8                              x_msg_data    OUT NOCOPY VARCHAR2,
9                              x_msg_count   OUT NOCOPY NUMBER,
10                              l_return_status    OUT NOCOPY  VARCHAR2) IS
11 
12 l_Header_price_Att_tbl		OE_Order_PUB.Header_Price_Att_Tbl_Type;
13 l_Header_Adj_Att_tbl		OE_Order_PUB.Header_Adj_Att_Tbl_Type;
14 l_Header_Adj_Assoc_tbl		OE_Order_PUB.Header_Adj_Assoc_Tbl_Type;
15 l_Line_price_Att_tbl		OE_Order_PUB.Line_Price_Att_Tbl_Type;
16 l_Line_Adj_Att_tbl			OE_Order_PUB.Line_Adj_Att_Tbl_Type;
17 l_Line_Adj_Assoc_tbl		OE_Order_PUB.Line_Adj_Assoc_Tbl_Type;
18 l_hdr_rec                     OE_Order_PUB.Header_Rec_Type;
19 l_line_rec                    OE_Order_PUB.Line_Rec_Type;
20 l_line_adj_rec                OE_Order_PUB.Line_Adj_Rec_Type;
21 l_line_tbl                    OE_Order_PUB.Line_Tbl_Type;
22 l_line_adj_tbl                OE_Order_PUB.Line_Adj_Tbl_Type;
23 l_x_header_rec                OE_Order_PUB.Header_Rec_Type;
24 l_x_Header_Adj_tbl            OE_Order_PUB.Header_Adj_Tbl_Type;
25 l_x_Header_Scredit_tbl        OE_Order_PUB.Header_Scredit_Tbl_Type;
26 l_x_line_tbl                  OE_Order_PUB.Line_Tbl_Type;
27 l_x_Line_Adj_tbl              OE_Order_PUB.Line_Adj_Tbl_Type;
28 l_x_Line_Scredit_tbl          OE_Order_PUB.Line_Scredit_Tbl_Type;
29 l_action_request_tbl        OE_Order_PUB.request_tbl_type;
30 l_x_action_request_tbl        OE_Order_PUB.request_tbl_type;
31 l_x_lot_serial_tbl	      OE_Order_PUB.lot_serial_tbl_type;
32 l_header_val_rec         OE_Order_PUB.header_val_rec_type;
33 l_line_val_tbl           OE_Order_PUB.line_val_tbl_type;
34 l_line_adj_val_tbl         OE_Order_PUB.line_adj_val_tbl_type;
35 l_line_scredit_val_tbl      OE_Order_PUB.line_scredit_val_tbl_type;
36 l_header_scredit_val_tbl   OE_Order_PUB.header_scredit_val_tbl_type;
37 l_header_adj_val_tbl       OE_Order_PUB.header_adj_val_tbl_type;
38 l_lot_serial_val_tbl      OE_Order_PUB.lot_serial_val_tbl_type;
39 
40 x_progress             varchar2(3);
41 
42 BEGIN
43 
44 x_progress := '000';
45 /* dreddy-iso : set the line_id,cancel reason and quantity .
46    This is for line level cancellation */
47 
48 IF x_oe_line_id is not null THEN
49   l_line_rec := OE_Order_PUB.G_MISS_LINE_REC;
50 
51   l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
52   l_line_rec.line_id := x_oe_line_id;
53   l_line_rec.ordered_quantity := x_oe_line_qty;
54   l_line_rec.change_reason := x_cancel_reason;
55   l_line_tbl(1) := l_line_rec;
56 END IF;
57 
58 x_progress := '010';
59 /* dreddy-iso : set the header id and cancel reason.
60    this is for header level cancellation */
61 
62 IF x_oe_header_id is not null THEN
63   l_hdr_rec := OE_Order_PUB.G_MISS_HEADER_REC;
64 
65   l_hdr_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
66   l_hdr_rec.header_id := x_oe_header_id;
67   l_hdr_rec.change_reason := x_cancel_reason;
68   l_x_header_rec := l_hdr_rec;
69 END IF;
70 
71 x_progress := '020';
72 
73 /* dreddy-iso : call OM's process order API */
74 OE_Order_GRP.Process_order
75     (   p_api_version_number          => 1.0
76     ,   p_init_msg_list               => FND_API.G_TRUE
77     ,   x_return_status               => l_return_status
78     ,   x_msg_count                   => x_msg_count
79     ,   x_msg_data                    => x_msg_data
80     ,   p_line_tbl	              => l_line_tbl
81     ,   x_header_rec                  => l_x_header_rec
82     ,   x_Header_Adj_tbl              => l_x_Header_Adj_tbl
83     ,   x_Header_Scredit_tbl          => l_x_Header_Scredit_tbl
84     ,   x_line_tbl                    => l_x_line_tbl
85     ,   x_Line_Adj_tbl                => l_x_Line_Adj_tbl
86     ,   x_Line_Scredit_tbl            => l_x_Line_Scredit_tbl
87     ,   x_action_request_tbl          => l_x_action_request_tbl
88     ,   x_Lot_Serial_tbl	      => l_x_lot_serial_tbl
89     ,   x_Header_price_Att_tbl	      => l_Header_price_Att_tbl
90     ,   x_Header_Adj_Att_tbl	      => l_Header_Adj_Att_tbl
91     ,   x_Header_Adj_Assoc_tbl	      => l_Header_Adj_Assoc_tbl
92     ,   x_Line_price_Att_tbl	      => l_Line_price_Att_tbl
93     ,   x_Line_Adj_Att_tbl	      => l_Line_Adj_Att_tbl
94     ,   x_Line_Adj_Assoc_tbl	      => l_Line_Adj_Assoc_tbl
95     ,   x_header_val_rec	      => l_header_val_rec
96     ,   x_Header_Adj_val_tbl	      => l_header_adj_val_tbl
97     ,   x_Header_Scredit_val_tbl      => l_header_scredit_val_tbl
98     ,   x_line_val_tbl                => l_line_val_tbl
99     ,   x_Line_Adj_val_tbl            => l_line_adj_val_tbl
100     ,   x_Line_Scredit_val_tbl        => l_line_scredit_val_tbl
101     ,   x_Lot_Serial_val_tbl          => l_lot_serial_val_tbl
102     );
103 
104     x_progress := '030';
105 
106  EXCEPTION
107    WHEN OTHERS THEN
108       po_message_s.sql_error('po_req_iso_sv.call_process_order', x_progress,sqlcode);
109    RAISE;
110 
111 END;
112 
113 /*==============================================================
114  * dreddy-iso : function to get the return status
115  * get_return_code()
116  *=============================================================*/
117 FUNCTION get_return_code(x_status IN varchar2) return VARCHAR2 IS
118 BEGIN
119 
120   if x_status = FND_API.G_RET_STS_SUCCESS then
121      return ('TRUE');
122   else
123      return ('FALSE');
124   end if;
125 
126 EXCEPTION
127    WHEN OTHERS THEN
128       po_message_s.sql_error('po_req_iso_sv.get_return_code','000',sqlcode);
129    RAISE;
130 END;
131 
132 END PO_REQ_ISO_SV;