1 PACKAGE BODY MRP_OM_API_PK AS
2 /* $Header: MRPOAPIB.pls 115.5 2002/11/22 01:19:05 schaudha noship $ */
3
4
5 PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('MSC_ATP_DEBUG'), 'N');
6
7 PROCEDURE MRP_OM_Interface (
8 p_line_tbl IN line_id_tbl ,
9 x_return_status OUT NOCOPY varchar2
10 ) IS
11 pvalue boolean;
12 BEGIN
13 IF PG_DEBUG in ('Y', 'C') THEN
14 msc_sch_wb.atp_debug('Begin MRP_OM_Interface');
15 END IF;
16 FORALL i IN p_line_tbl.FIRST..p_line_tbl.LAST
17 INSERT INTO mrp_so_lines_temp
18 (
19 LAST_UPDATED_BY ,
20 LAST_UPDATE_DATE,
21 CREATION_DATE,
22 CREATED_BY,
23 LAST_UPDATE_LOGIN,
24 line_id,
25 process_status
26 )
27 VALUES
28 (
29 FND_GLOBAL.USER_ID,
30 SYSDATE,
31 SYSDATE,
32 FND_GLOBAL.USER_ID,
33 FND_GLOBAL.USER_ID,
34 p_line_tbl(i),
35 2 -- To Be Processed.
36 ) ;
37 x_return_status := FND_API.G_RET_STS_SUCCESS;
38 IF PG_DEBUG in ('Y', 'C') THEN
39 msc_sch_wb.atp_debug('End MRP_OM_Interface');
40 END IF;
41 EXCEPTION
42 WHEN OTHERS THEN
43 IF PG_DEBUG in ('Y', 'C') THEN
44 msc_sch_wb.atp_debug('Error occured in MRP_OM_Interface'||
45 sqlcode);
46 msc_sch_wb.atp_debug('MRP_OM_Interface: ' || sqlerrm);
47 END IF;
48 -- Reset the profile option MRP Planning Manager
49 -- First Time to Yes.
50 -- This will make the compute sales order
51 -- changes function to do a full table scan
52 -- of the table oe_order_lines_all to maintain
53 -- a consistent picture of demand as the insert
54 -- into the temporary table has failed!
55 pvalue := fnd_profile.save('MRP_PLNG_MGR_FIRST_TIME',
56 'Y', 'SITE');
57 x_return_status := FND_API.G_RET_STS_ERROR;
58 -- It would be a better idea to send a
59 -- notification to a system manager at this point
60 -- as this will make the planning manager to
61 -- go very slow.
62 -- But I am leaving that as an enhancement for
63 -- the moment.
64 END MRP_OM_Interface;
65
66
67 END MRP_OM_API_PK;