1 PACKAGE RLM_REPLACE_SV as
2 /*$Header: RLMDPSWS.pls 120.1 2005/07/17 18:15:44 rlanka noship $*/
3 /*===========================================================================
4 PACKAGE NAME: RLM_REPLACE_SV
5
6 DESCRIPTION: Contains all server side code for the DSP sweeper program.
7
8 CLIENT/SERVER:Server
9
10 LIBRARY NAME: None
11
12 OWNER:
13
14 PROCEDURE/FUNCTIONS:
15
16 GLOBALS:
17
18 ===========================================================================*/
19 -- RLM Debug Constants
20 C_SDEBUG CONSTANT NUMBER := rlm_core_sv.C_LEVEL1;
21 C_DEBUG CONSTANT NUMBER := rlm_core_sv.C_LEVEL2;
22 C_TDEBUG CONSTANT NUMBER := rlm_core_sv.C_LEVEL3;
23
24 -- For holding SF,ST,CI of the previous eligible replacement schedule lines,
25 -- declare this global pl/sql table
26 TYPE list_rec_type IS RECORD
27 (
28 ship_from_org_id NUMBER,
29 ship_to_address_id NUMBER,
30 customer_item_id NUMBER,
31 order_number NUMBER
32 );
33
34 TYPE list_tbl IS TABLE OF list_rec_type INDEX BY BINARY_INTEGER;
35
36 g_list_tbl list_tbl;
37
38 /*=============================================================================
39 PROCEDURE NAME: CompareReplaceSched
40
41 DESCRIPTION: This is the top level procedure for sweeper program
42
43 PARAMETERS: x_sched_rec IN rlm_interface_headers%ROWTYPE
44 x_warn_dropped_items IN VARCHAR2
45 x_return_status OUT NOCOPY BOOLEAN
46
47 ============================================================================*/
48 PROCEDURE CompareReplaceSched
49 (
50 x_sched_rec IN rlm_interface_headers%ROWTYPE,
51 x_warn_dropped_items IN VARCHAR2,
52 x_return_status OUT NOCOPY BOOLEAN
53 );
54
55 /*=============================================================================
56 FUNCTION NAME: IsWarningNeeded
57
58 DESCRIPTION: This function returns FALSE if the current schedule
59 does not meet the criteria for running sweeper program.
60
61 PARAMETERS: x_sched_rec IN rlm_interface_headers%ROWTYPE
62 x_warn_dropped_items IN VARCHAR2
63
64 ============================================================================*/
65
66 FUNCTION IsWarningNeeded
67 (
68 x_sched_rec IN rlm_interface_headers%ROWTYPE,
69 x_warn_dropped_items IN VARCHAR2
70 ) RETURN BOOLEAN;
71
72 /*=============================================================================
73 PROCEDURE NAME: FindEligibleSched
74
75 DESCRIPTION: This procedure finds the highest generation date schedule
76 before the current schedule based on tp translator code,
77 tp location code, schedule type, test flag, schedule
78 source.
79
80 PARAMETERS: x_sched_rec IN rlm_interface_headers%ROWTYPE
81 x_prev_header_id OUT NOCOPY NUMBER
82 x_return_status OUT NOCOPY BOOLEAN
83
84 ============================================================================*/
85 PROCEDURE FindEligibleSched
86 (
87 x_sched_rec IN rlm_interface_headers%ROWTYPE,
88 x_prev_header_id OUT NOCOPY NUMBER,
89 x_return_status OUT NOCOPY BOOLEAN
90 );
91
92 /*=============================================================================
93 PROCEDURE NAME: PopulateList
94
95 DESCRIPTION: This procedure builds a list of SF, ST, CI from the
96 eligible schedule found by FindEligibleSched procedure
97
98 PARAMETERS: x_prev_header_id IN NUMBER
99 x_curr_header_id IN NUMBER
100 x_return_status OUT NOCOPY BOOLEAN
101
102 ============================================================================*/
103 PROCEDURE PopulateList
104 (
105 x_prev_header_id IN NUMBER,
106 x_curr_header_id IN NUMBER, /* bugfix 4198327 */
107 x_return_status OUT NOCOPY BOOLEAN
108 );
109
110 /*=============================================================================
111 PROCEDURE NAME: CompareList
112
113 DESCRIPTION: This procedure compares the SF,ST,CI list entries with
114 current schedule
115
116 PARAMETERS: x_curr_header_id IN NUMBER
117
118 ============================================================================*/
119 PROCEDURE CompareList
120 (
121 x_curr_header_id IN NUMBER
122 );
123
124 END RLM_REPLACE_SV;