DBA Data[Home] [Help]

PACKAGE BODY: APPS.RCV_LCM_WEB_SERVICE

Source


1 PACKAGE BODY RCV_LCM_WEB_SERVICE AS
2 /* $Header: RCVLCMWB.pls 120.1 2009/03/04 00:21:24 musinha noship $ */
3 
4    PROCEDURE Get_Landed_Cost (p_group_id IN NUMBER,p_processing_mode IN VARCHAR2) AS
5       --
6 
7       x_progress             varchar2(5) := '00000';
8 
9       p_rti_rec              rti_cur_table;
10 
11       g_user_id              NUMBER        := FND_PROFILE.value('USER_ID');
12       g_resp_id              NUMBER        := FND_PROFILE.value('RESP_ID');
13       g_pgm_appl_id          NUMBER        := FND_PROFILE.value('RESP_APPL_ID');
14       --
15    BEGIN
16       --
17       asn_debug.put_line('Entering RCV_LCM_WEB_SERVICE.Get_Landed_Cost' || to_char(sysdate,'DD-MON-YYYY HH:MI:SS'));
18       asn_debug.put_line('p_group_id        : ' || p_group_id);
19       asn_debug.put_line('p_processing_mode : ' || p_processing_mode);
20       asn_debug.put_line('g_user_id : ' || g_user_id);
21       asn_debug.put_line('g_resp_id : ' || g_resp_id);
22       asn_debug.put_line('g_pgm_appl_id : ' || g_pgm_appl_id);
23       --
24       OPEN rti_cur(p_group_id,p_processing_mode);
25       FETCH rti_cur BULK COLLECT into p_rti_rec;
26 
27       IF p_rti_rec.first IS NOT NULL THEN
28 
29          asn_debug.put_line('calling LCM API to get the landed cost' || p_rti_rec.COUNT);
30 
31          INL_INTEGRATION_GRP.Get_LandedCost(p_rti_rec,p_group_id,p_processing_mode);
32 
33 	 asn_debug.put_line('after calling LCM API to get the landed cost' || p_rti_rec.COUNT);
34 
35       END IF;
36 
37       IF rti_cur%ISOPEN THEN
38          CLOSE rti_cur;
39       END IF;
40 
41    EXCEPTION
42       WHEN OTHERS THEN
43          asn_debug.put_line('the error is:  ' || sqlcode ||' '||substr(SQLERRM, 1, 1000));
44 
45          IF rti_cur%ISOPEN THEN
46             CLOSE rti_cur;
47          END IF;
48 
49          UPDATE rcv_transactions_interface
50          SET    processing_status_code  = 'ERROR'
51          WHERE  processing_status_code  = 'RUNNING'
52          AND    transaction_status_code = 'PENDING'
53          AND    mo_global.check_access(org_id) = 'Y'
54          AND    processing_mode_code = p_processing_mode
55          AND    group_id = nvl(p_group_id, group_id)
56          AND    source_document_code = 'PO'
57          AND    transaction_type NOT IN ('SHIP', 'RECEIVE', 'ACCEPT', 'REJECT','TRANSFER','UNORDERED')
58          AND    lcm_shipment_line_id IS NOT NULL;
59 
60          asn_debug.put_line(sql%rowcount || ' RTIs updated to Error' );
61 
62    END Get_Landed_Cost;
63 
64 END RCV_LCM_WEB_SERVICE;