71: IF p_id IS NULL
72: THEN
73: fnd_message.set_name ('FND', 'MO_OU_REQUIRED');
74: fnd_msg_pub.ADD;
75: RAISE fnd_api.g_exc_error;
76: END IF;
77: END;
78:
79: -- Start of comments
83: -- Pre-reqs : None.
84: -- Parameters :
85: -- IN : p_api_version IN NUMBER Required
86: -- p_init_msg_list IN VARCHAR2 Optional
87: -- Default = FND_API.G_FALSE
88: -- p_commit IN VARCHAR2 Optional
89: -- Default = FND_API.G_FALSE
90: -- p_validation_level IN NUMBER Optional
91: -- Default = FND_API.G_VALID_LEVEL_FULL
85: -- IN : p_api_version IN NUMBER Required
86: -- p_init_msg_list IN VARCHAR2 Optional
87: -- Default = FND_API.G_FALSE
88: -- p_commit IN VARCHAR2 Optional
89: -- Default = FND_API.G_FALSE
90: -- p_validation_level IN NUMBER Optional
91: -- Default = FND_API.G_VALID_LEVEL_FULL
92: -- p_comp_plan IN comp_plan_rec_type
93: -- OUT : x_return_status OUT VARCHAR2(1)
87: -- Default = FND_API.G_FALSE
88: -- p_commit IN VARCHAR2 Optional
89: -- Default = FND_API.G_FALSE
90: -- p_validation_level IN NUMBER Optional
91: -- Default = FND_API.G_VALID_LEVEL_FULL
92: -- p_comp_plan IN comp_plan_rec_type
93: -- OUT : x_return_status OUT VARCHAR2(1)
94: -- x_msg_count OUT NUMBER
95: -- x_msg_data OUT VARCHAR2(2000)
99: --
100: -- End of comments
101: PROCEDURE create_comp_plan (
102: p_api_version IN NUMBER,
103: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
104: p_commit IN VARCHAR2 := fnd_api.g_false,
105: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
106: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
107: x_comp_plan_id OUT NOCOPY NUMBER,
100: -- End of comments
101: PROCEDURE create_comp_plan (
102: p_api_version IN NUMBER,
103: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
104: p_commit IN VARCHAR2 := fnd_api.g_false,
105: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
106: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
107: x_comp_plan_id OUT NOCOPY NUMBER,
108: x_return_status OUT NOCOPY VARCHAR2,
101: PROCEDURE create_comp_plan (
102: p_api_version IN NUMBER,
103: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
104: p_commit IN VARCHAR2 := fnd_api.g_false,
105: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
106: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
107: x_comp_plan_id OUT NOCOPY NUMBER,
108: x_return_status OUT NOCOPY VARCHAR2,
109: x_msg_count OUT NOCOPY NUMBER,
121: -- Standard Start of API savepoint
122: SAVEPOINT create_comp_plan;
123:
124: -- Standard call to check for call compatibility.
125: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
126: THEN
127: RAISE fnd_api.g_exc_unexpected_error;
128: END IF;
129:
123:
124: -- Standard call to check for call compatibility.
125: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
126: THEN
127: RAISE fnd_api.g_exc_unexpected_error;
128: END IF;
129:
130: -- Initialize message list if p_init_msg_list is set to TRUE.
131: IF fnd_api.to_boolean (p_init_msg_list)
127: RAISE fnd_api.g_exc_unexpected_error;
128: END IF;
129:
130: -- Initialize message list if p_init_msg_list is set to TRUE.
131: IF fnd_api.to_boolean (p_init_msg_list)
132: THEN
133: fnd_msg_pub.initialize;
134: END IF;
135:
133: fnd_msg_pub.initialize;
134: END IF;
135:
136: -- Initialize API return status to success
137: x_return_status := fnd_api.g_ret_sts_success;
138: -- API body
139: x_comp_plan_id := p_comp_plan.comp_plan_id;
140: -- *** Check the ORG_ID is null or not ***
141: check_org_id (p_comp_plan.org_id);
139: x_comp_plan_id := p_comp_plan.comp_plan_id;
140: -- *** Check the ORG_ID is null or not ***
141: check_org_id (p_comp_plan.org_id);
142:
143: -- Convert fnd_api.g_miss to NULL
144:
145: -- 1. name can not be null
146: IF (p_comp_plan.NAME IS NULL)
147: OR (p_comp_plan.NAME = fnd_api.g_miss_char)
143: -- Convert fnd_api.g_miss to NULL
144:
145: -- 1. name can not be null
146: IF (p_comp_plan.NAME IS NULL)
147: OR (p_comp_plan.NAME = fnd_api.g_miss_char)
148: OR (p_comp_plan.start_date IS NULL)
149: OR (p_comp_plan.start_date = fnd_api.g_miss_date)
150: THEN
151: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
145: -- 1. name can not be null
146: IF (p_comp_plan.NAME IS NULL)
147: OR (p_comp_plan.NAME = fnd_api.g_miss_char)
148: OR (p_comp_plan.start_date IS NULL)
149: OR (p_comp_plan.start_date = fnd_api.g_miss_date)
150: THEN
151: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
152: THEN
153: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
153: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
154: fnd_msg_pub.ADD;
155: END IF;
156:
157: RAISE fnd_api.g_exc_error;
158: END IF;
159:
160: -- 2. comp plan name must be unique
161: SELECT COUNT (1)
171: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('NAME', 'INPUT_TOKEN'));
172: fnd_msg_pub.ADD;
173: END IF;
174:
175: RAISE fnd_api.g_exc_error;
176: END IF;
177:
178: -- start date > end date
179: IF (p_comp_plan.end_date IS NOT NULL) AND (p_comp_plan.start_date > p_comp_plan.end_date)
183: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
184: fnd_msg_pub.ADD;
185: END IF;
186:
187: RAISE fnd_api.g_exc_error;
188: END IF;
189:
190: -- calling public api
191: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, NULL, p_comp_plan.NAME),
187: RAISE fnd_api.g_exc_error;
188: END IF;
189:
190: -- calling public api
191: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, NULL, p_comp_plan.NAME),
192: DECODE (p_comp_plan.description, fnd_api.g_miss_char, NULL, p_comp_plan.description),
193: 'INCOMPLETE',
194: DECODE (p_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, p_comp_plan.allow_rev_class_overlap),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
188: END IF;
189:
190: -- calling public api
191: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, NULL, p_comp_plan.NAME),
192: DECODE (p_comp_plan.description, fnd_api.g_miss_char, NULL, p_comp_plan.description),
193: 'INCOMPLETE',
194: DECODE (p_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, p_comp_plan.allow_rev_class_overlap),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
190: -- calling public api
191: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, NULL, p_comp_plan.NAME),
192: DECODE (p_comp_plan.description, fnd_api.g_miss_char, NULL, p_comp_plan.description),
193: 'INCOMPLETE',
194: DECODE (p_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, p_comp_plan.allow_rev_class_overlap),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
191: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, NULL, p_comp_plan.NAME),
192: DECODE (p_comp_plan.description, fnd_api.g_miss_char, NULL, p_comp_plan.description),
193: 'INCOMPLETE',
194: DECODE (p_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, p_comp_plan.allow_rev_class_overlap),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
192: DECODE (p_comp_plan.description, fnd_api.g_miss_char, NULL, p_comp_plan.description),
193: 'INCOMPLETE',
194: DECODE (p_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, p_comp_plan.allow_rev_class_overlap),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
194: DECODE (p_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, p_comp_plan.allow_rev_class_overlap),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
195: DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.start_date)),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
196: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (p_comp_plan.end_date)),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
197: NULL,
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
198: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, p_comp_plan.attribute_category),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
199: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, NULL, p_comp_plan.attribute1),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
200: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, NULL, p_comp_plan.attribute2),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
201: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, NULL, p_comp_plan.attribute3),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
202: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, NULL, p_comp_plan.attribute4),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
203: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, NULL, p_comp_plan.attribute5),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
204: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, NULL, p_comp_plan.attribute6),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
205: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, NULL, p_comp_plan.attribute7),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
213: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, NULL, p_comp_plan.attribute15),
206: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, NULL, p_comp_plan.attribute8),
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
213: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, NULL, p_comp_plan.attribute15),
214: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, NULL, p_comp_plan.org_id)
207: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, NULL, p_comp_plan.attribute9),
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
213: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, NULL, p_comp_plan.attribute15),
214: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, NULL, p_comp_plan.org_id)
215: INTO l_comp_rec.NAME,
208: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, NULL, p_comp_plan.attribute10),
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
213: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, NULL, p_comp_plan.attribute15),
214: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, NULL, p_comp_plan.org_id)
215: INTO l_comp_rec.NAME,
216: l_comp_rec.description,
209: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, NULL, p_comp_plan.attribute11),
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
213: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, NULL, p_comp_plan.attribute15),
214: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, NULL, p_comp_plan.org_id)
215: INTO l_comp_rec.NAME,
216: l_comp_rec.description,
217: l_comp_rec.status,
210: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, NULL, p_comp_plan.attribute12),
211: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, NULL, p_comp_plan.attribute13),
212: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, NULL, p_comp_plan.attribute14),
213: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, NULL, p_comp_plan.attribute15),
214: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, NULL, p_comp_plan.org_id)
215: INTO l_comp_rec.NAME,
216: l_comp_rec.description,
217: l_comp_rec.status,
218: l_comp_rec.rc_overlap,
259: x_comp_plan_id => x_comp_plan_id,
260: x_loading_status => l_loading_status
261: );
262:
263: IF (x_return_status <> fnd_api.g_ret_sts_success)
264: THEN
265: RAISE fnd_api.g_exc_error;
266: END IF;
267:
261: );
262:
263: IF (x_return_status <> fnd_api.g_ret_sts_success)
264: THEN
265: RAISE fnd_api.g_exc_error;
266: END IF;
267:
268: p_comp_plan.object_version_number := get_ovn (x_comp_plan_id);
269:
295: */
296:
297: -- End of API body.
298: -- Standard check of p_commit.
299: IF fnd_api.to_boolean (p_commit)
300: THEN
301: COMMIT WORK;
302: END IF;
303:
301: COMMIT WORK;
302: END IF;
303:
304: -- Standard call to get message count and if count is 1, get message info.
305: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
306: EXCEPTION
307: WHEN fnd_api.g_exc_error
308: THEN
309: ROLLBACK TO create_comp_plan;
303:
304: -- Standard call to get message count and if count is 1, get message info.
305: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
306: EXCEPTION
307: WHEN fnd_api.g_exc_error
308: THEN
309: ROLLBACK TO create_comp_plan;
310: x_return_status := fnd_api.g_ret_sts_error;
311: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
306: EXCEPTION
307: WHEN fnd_api.g_exc_error
308: THEN
309: ROLLBACK TO create_comp_plan;
310: x_return_status := fnd_api.g_ret_sts_error;
311: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
307: WHEN fnd_api.g_exc_error
308: THEN
309: ROLLBACK TO create_comp_plan;
310: x_return_status := fnd_api.g_ret_sts_error;
311: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
315: x_return_status := fnd_api.g_ret_sts_unexp_error;
308: THEN
309: ROLLBACK TO create_comp_plan;
310: x_return_status := fnd_api.g_ret_sts_error;
311: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
315: x_return_status := fnd_api.g_ret_sts_unexp_error;
316: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
311: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
315: x_return_status := fnd_api.g_ret_sts_unexp_error;
316: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
317: WHEN OTHERS
318: THEN
319: ROLLBACK TO create_comp_plan;
312: WHEN fnd_api.g_exc_unexpected_error
313: THEN
314: ROLLBACK TO create_comp_plan;
315: x_return_status := fnd_api.g_ret_sts_unexp_error;
316: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
317: WHEN OTHERS
318: THEN
319: ROLLBACK TO create_comp_plan;
320: x_return_status := fnd_api.g_ret_sts_unexp_error;
316: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
317: WHEN OTHERS
318: THEN
319: ROLLBACK TO create_comp_plan;
320: x_return_status := fnd_api.g_ret_sts_unexp_error;
321:
322: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
323: THEN
324: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
323: THEN
324: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
325: END IF;
326:
327: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
328: END create_comp_plan;
329:
330: -- Start of comments
331: -- API name : Update_Comp_Plan
334: -- Pre-reqs : None.
335: -- Parameters :
336: -- IN : p_api_version IN NUMBER Required
337: -- p_init_msg_list IN VARCHAR2 Optional
338: -- Default = FND_API.G_FALSE
339: -- p_commit IN VARCHAR2 Optional
340: -- Default = FND_API.G_FALSE
341: -- p_validation_level IN NUMBER Optional
342: -- Default = FND_API.G_VALID_LEVEL_FULL
336: -- IN : p_api_version IN NUMBER Required
337: -- p_init_msg_list IN VARCHAR2 Optional
338: -- Default = FND_API.G_FALSE
339: -- p_commit IN VARCHAR2 Optional
340: -- Default = FND_API.G_FALSE
341: -- p_validation_level IN NUMBER Optional
342: -- Default = FND_API.G_VALID_LEVEL_FULL
343: -- p_comp_plan IN comp_plan_rec_type
344: -- OUT : x_return_status OUT VARCHAR2(1)
338: -- Default = FND_API.G_FALSE
339: -- p_commit IN VARCHAR2 Optional
340: -- Default = FND_API.G_FALSE
341: -- p_validation_level IN NUMBER Optional
342: -- Default = FND_API.G_VALID_LEVEL_FULL
343: -- p_comp_plan IN comp_plan_rec_type
344: -- OUT : x_return_status OUT VARCHAR2(1)
345: -- x_msg_count OUT NUMBER
346: -- x_msg_data OUT VARCHAR2(2000)
349: --
350: -- End of comments
351: PROCEDURE update_comp_plan (
352: p_api_version IN NUMBER,
353: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
354: p_commit IN VARCHAR2 := fnd_api.g_false,
355: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
356: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
357: x_return_status OUT NOCOPY VARCHAR2,
350: -- End of comments
351: PROCEDURE update_comp_plan (
352: p_api_version IN NUMBER,
353: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
354: p_commit IN VARCHAR2 := fnd_api.g_false,
355: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
356: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
357: x_return_status OUT NOCOPY VARCHAR2,
358: x_msg_count OUT NOCOPY NUMBER,
351: PROCEDURE update_comp_plan (
352: p_api_version IN NUMBER,
353: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
354: p_commit IN VARCHAR2 := fnd_api.g_false,
355: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
356: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
357: x_return_status OUT NOCOPY VARCHAR2,
358: x_msg_count OUT NOCOPY NUMBER,
359: x_msg_data OUT NOCOPY VARCHAR2
409: -- Standard Start of API savepoint
410: SAVEPOINT update_comp_plan;
411:
412: -- Standard call to check for call compatibility.
413: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
414: THEN
415: RAISE fnd_api.g_exc_unexpected_error;
416: END IF;
417:
411:
412: -- Standard call to check for call compatibility.
413: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
414: THEN
415: RAISE fnd_api.g_exc_unexpected_error;
416: END IF;
417:
418: -- Initialize message list if p_init_msg_list is set to TRUE.
419: IF fnd_api.to_boolean (p_init_msg_list)
415: RAISE fnd_api.g_exc_unexpected_error;
416: END IF;
417:
418: -- Initialize message list if p_init_msg_list is set to TRUE.
419: IF fnd_api.to_boolean (p_init_msg_list)
420: THEN
421: fnd_msg_pub.initialize;
422: END IF;
423:
421: fnd_msg_pub.initialize;
422: END IF;
423:
424: -- Initialize API return status to success
425: x_return_status := fnd_api.g_ret_sts_success;
426: -- API body
427: -- *** Check the ORG_ID is null or not ***
428: check_org_id (p_comp_plan.org_id);
429:
435: fnd_message.set_name ('CN', 'CN_REQ_PAR_MISSING');
436: fnd_msg_pub.ADD;
437: END IF;
438:
439: RAISE fnd_api.g_exc_error;
440: END IF;
441:
442: -- 2. comp plan name must be unique
443: SELECT COUNT (1)
453: fnd_message.set_token ('INPUT_NAME', cn_api.get_lkup_meaning ('NAME', 'INPUT_TOKEN'));
454: fnd_msg_pub.ADD;
455: END IF;
456:
457: RAISE fnd_api.g_exc_error;
458: END IF;
459:
460: -- clku 7/10/2001, bug 1689518
461: -- 3. check whether the revenue classes of the plan elements assigned overlap,
479: INTO l_old_comp_plan;
480:
481: CLOSE l_old_comp_plan_cr;
482:
483: SELECT DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, TRUNC (l_old_comp_plan.start_date), TRUNC (p_comp_plan.start_date)),
484: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, TRUNC (l_old_comp_plan.end_date), TRUNC (p_comp_plan.end_date))
485: INTO l_start_date,
486: l_end_date
487: FROM DUAL;
480:
481: CLOSE l_old_comp_plan_cr;
482:
483: SELECT DECODE (p_comp_plan.start_date, fnd_api.g_miss_date, TRUNC (l_old_comp_plan.start_date), TRUNC (p_comp_plan.start_date)),
484: DECODE (p_comp_plan.end_date, fnd_api.g_miss_date, TRUNC (l_old_comp_plan.end_date), TRUNC (p_comp_plan.end_date))
485: INTO l_start_date,
486: l_end_date
487: FROM DUAL;
488:
494: fnd_message.set_name ('CN', 'CN_DATE_RANGE_ERROR');
495: fnd_msg_pub.ADD;
496: END IF;
497:
498: RAISE fnd_api.g_exc_error;
499: END IF;
500:
501: -- call table handler
502: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, l_old_comp_plan.NAME, p_comp_plan.NAME),
498: RAISE fnd_api.g_exc_error;
499: END IF;
500:
501: -- call table handler
502: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, l_old_comp_plan.NAME, p_comp_plan.NAME),
503: DECODE (p_comp_plan.description, fnd_api.g_miss_char, l_old_comp_plan.description, p_comp_plan.description),
504: DECODE (p_comp_plan.allow_rev_class_overlap,
505: fnd_api.g_miss_char, l_old_comp_plan.allow_rev_class_overlap,
506: p_comp_plan.allow_rev_class_overlap
499: END IF;
500:
501: -- call table handler
502: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, l_old_comp_plan.NAME, p_comp_plan.NAME),
503: DECODE (p_comp_plan.description, fnd_api.g_miss_char, l_old_comp_plan.description, p_comp_plan.description),
504: DECODE (p_comp_plan.allow_rev_class_overlap,
505: fnd_api.g_miss_char, l_old_comp_plan.allow_rev_class_overlap,
506: p_comp_plan.allow_rev_class_overlap
507: ),
501: -- call table handler
502: SELECT DECODE (p_comp_plan.NAME, fnd_api.g_miss_char, l_old_comp_plan.NAME, p_comp_plan.NAME),
503: DECODE (p_comp_plan.description, fnd_api.g_miss_char, l_old_comp_plan.description, p_comp_plan.description),
504: DECODE (p_comp_plan.allow_rev_class_overlap,
505: fnd_api.g_miss_char, l_old_comp_plan.allow_rev_class_overlap,
506: p_comp_plan.allow_rev_class_overlap
507: ),
508: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, l_old_comp_plan.attribute_category, p_comp_plan.attribute_category),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
504: DECODE (p_comp_plan.allow_rev_class_overlap,
505: fnd_api.g_miss_char, l_old_comp_plan.allow_rev_class_overlap,
506: p_comp_plan.allow_rev_class_overlap
507: ),
508: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, l_old_comp_plan.attribute_category, p_comp_plan.attribute_category),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
505: fnd_api.g_miss_char, l_old_comp_plan.allow_rev_class_overlap,
506: p_comp_plan.allow_rev_class_overlap
507: ),
508: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, l_old_comp_plan.attribute_category, p_comp_plan.attribute_category),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
506: p_comp_plan.allow_rev_class_overlap
507: ),
508: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, l_old_comp_plan.attribute_category, p_comp_plan.attribute_category),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
507: ),
508: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, l_old_comp_plan.attribute_category, p_comp_plan.attribute_category),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
508: DECODE (p_comp_plan.attribute_category, fnd_api.g_miss_char, l_old_comp_plan.attribute_category, p_comp_plan.attribute_category),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
509: DECODE (p_comp_plan.attribute1, fnd_api.g_miss_char, l_old_comp_plan.attribute1, p_comp_plan.attribute1),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
510: DECODE (p_comp_plan.attribute2, fnd_api.g_miss_char, l_old_comp_plan.attribute2, p_comp_plan.attribute2),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
511: DECODE (p_comp_plan.attribute3, fnd_api.g_miss_char, l_old_comp_plan.attribute3, p_comp_plan.attribute3),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
512: DECODE (p_comp_plan.attribute4, fnd_api.g_miss_char, l_old_comp_plan.attribute4, p_comp_plan.attribute4),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
513: DECODE (p_comp_plan.attribute5, fnd_api.g_miss_char, l_old_comp_plan.attribute5, p_comp_plan.attribute5),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
514: DECODE (p_comp_plan.attribute6, fnd_api.g_miss_char, l_old_comp_plan.attribute6, p_comp_plan.attribute6),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
515: DECODE (p_comp_plan.attribute7, fnd_api.g_miss_char, l_old_comp_plan.attribute7, p_comp_plan.attribute7),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
523: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, l_old_comp_plan.attribute15, p_comp_plan.attribute15),
516: DECODE (p_comp_plan.attribute8, fnd_api.g_miss_char, l_old_comp_plan.attribute8, p_comp_plan.attribute8),
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
523: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, l_old_comp_plan.attribute15, p_comp_plan.attribute15),
524: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, l_old_comp_plan.org_id, p_comp_plan.org_id)
517: DECODE (p_comp_plan.attribute9, fnd_api.g_miss_char, l_old_comp_plan.attribute9, p_comp_plan.attribute9),
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
523: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, l_old_comp_plan.attribute15, p_comp_plan.attribute15),
524: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, l_old_comp_plan.org_id, p_comp_plan.org_id)
525: INTO l_name,
518: DECODE (p_comp_plan.attribute10, fnd_api.g_miss_char, l_old_comp_plan.attribute10, p_comp_plan.attribute10),
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
523: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, l_old_comp_plan.attribute15, p_comp_plan.attribute15),
524: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, l_old_comp_plan.org_id, p_comp_plan.org_id)
525: INTO l_name,
526: l_description,
519: DECODE (p_comp_plan.attribute11, fnd_api.g_miss_char, l_old_comp_plan.attribute11, p_comp_plan.attribute11),
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
523: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, l_old_comp_plan.attribute15, p_comp_plan.attribute15),
524: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, l_old_comp_plan.org_id, p_comp_plan.org_id)
525: INTO l_name,
526: l_description,
527: l_overlap,
520: DECODE (p_comp_plan.attribute12, fnd_api.g_miss_char, l_old_comp_plan.attribute12, p_comp_plan.attribute12),
521: DECODE (p_comp_plan.attribute13, fnd_api.g_miss_char, l_old_comp_plan.attribute13, p_comp_plan.attribute13),
522: DECODE (p_comp_plan.attribute14, fnd_api.g_miss_char, l_old_comp_plan.attribute14, p_comp_plan.attribute14),
523: DECODE (p_comp_plan.attribute15, fnd_api.g_miss_char, l_old_comp_plan.attribute15, p_comp_plan.attribute15),
524: DECODE (p_comp_plan.org_id, fnd_api.g_miss_char, l_old_comp_plan.org_id, p_comp_plan.org_id)
525: INTO l_name,
526: l_description,
527: l_overlap,
528: l_attribute_category,
548: IF l_old_comp_plan.object_version_number <> p_comp_plan.object_version_number
549: THEN
550: fnd_message.set_name ('CN', 'CN_RECORD_CHANGED');
551: fnd_msg_pub.ADD;
552: RAISE fnd_api.g_exc_error;
553: END IF;
554:
555: -- 4. check for consistency in date range assignment
556: -- check plan element assignments - they just have to intersect
567: IF l_temp_count > 0
568: THEN
569: fnd_message.set_name ('CN', 'CN_PLAN_ELT_DISJOINT');
570: fnd_msg_pub.ADD;
571: RAISE fnd_api.g_exc_error;
572: END IF;
573:
574: SELECT COUNT (1)
575: INTO l_temp_count
579: IF l_temp_count > 0
580: THEN
581: fnd_message.set_name ('CN', 'CN_ROLE_NOT_WITHIN_PLAN');
582: fnd_msg_pub.ADD;
583: RAISE fnd_api.g_exc_error;
584: END IF;
585:
586: -- since srp assignments always within role assignments, then we
587: -- don't need to check those
646: /* Adding Notes Information */
647:
648: /* 1. Check if the name has been changed */
649: l_consolidated_note := '';
650: IF (p_comp_plan.NAME <> fnd_api.g_miss_char AND p_comp_plan.NAME IS NOT NULL AND p_comp_plan.NAME <> l_old_comp_plan.NAME)
651: THEN
652: -- Need to add note CNR12_NOTE_COMPPLAN_UPDATE
653: fnd_message.set_name ('CN', 'CNR12_NOTE_COMPPLAN_UPDATE');
654: fnd_message.set_token ('OLD_CP_NAME', l_old_comp_plan.NAME);
671: */
672: END IF;
673:
674: /* 2. Check if the start date has been changed */
675: IF (p_comp_plan.start_date <> fnd_api.g_miss_date AND p_comp_plan.start_date IS NOT NULL
676: AND p_comp_plan.start_date <> l_old_comp_plan.start_date
677: )
678: THEN
679: -- Need to add note CNR12_NOTE_COMPPLAN_SDATE_CRE
698: */
699: END IF;
700:
701: /* 3. Check if the end date has been changed */
702: IF (p_comp_plan.end_date <> fnd_api.g_miss_date AND p_comp_plan.end_date IS NOT NULL AND p_comp_plan.end_date <> l_old_comp_plan.end_date)
703: THEN
704: -- Need to add note CNR12_NOTE_COMPPLAN_EDATE_UPD
705: fnd_message.set_name ('CN', 'CNR12_NOTE_COMPPLAN_EDATE_UPD');
706: fnd_message.set_token ('OLD_END_DATE', TO_CHAR (l_old_comp_plan.end_date));
722: */
723: END IF;
724:
725: /* 4. Allow Revenue Class Overlap flag --> Changed to N */
726: IF ( p_comp_plan.allow_rev_class_overlap <> fnd_api.g_miss_char
727: AND p_comp_plan.allow_rev_class_overlap IS NOT NULL
728: AND p_comp_plan.allow_rev_class_overlap <> l_old_comp_plan.allow_rev_class_overlap
729: AND p_comp_plan.allow_rev_class_overlap = 'N'
730: )
748: */
749: END IF;
750:
751: /* 5. Allow Revenue Class Overlap flag --> Changed to Y */
752: IF ( p_comp_plan.allow_rev_class_overlap <> fnd_api.g_miss_char
753: AND p_comp_plan.allow_rev_class_overlap IS NOT NULL
754: AND p_comp_plan.allow_rev_class_overlap <> l_old_comp_plan.allow_rev_class_overlap
755: AND p_comp_plan.allow_rev_class_overlap = 'Y'
756: )
791: END IF;
792:
793: -- End of API body.
794: -- Standard check of p_commit.
795: IF fnd_api.to_boolean (p_commit)
796: THEN
797: COMMIT WORK;
798: END IF;
799:
797: COMMIT WORK;
798: END IF;
799:
800: -- Standard call to get message count and if count is 1, get message info.
801: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
802: EXCEPTION
803: WHEN fnd_api.g_exc_error
804: THEN
805: ROLLBACK TO update_comp_plan;
799:
800: -- Standard call to get message count and if count is 1, get message info.
801: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
802: EXCEPTION
803: WHEN fnd_api.g_exc_error
804: THEN
805: ROLLBACK TO update_comp_plan;
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
802: EXCEPTION
803: WHEN fnd_api.g_exc_error
804: THEN
805: ROLLBACK TO update_comp_plan;
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
803: WHEN fnd_api.g_exc_error
804: THEN
805: ROLLBACK TO update_comp_plan;
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
811: x_return_status := fnd_api.g_ret_sts_unexp_error;
804: THEN
805: ROLLBACK TO update_comp_plan;
806: x_return_status := fnd_api.g_ret_sts_error;
807: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
811: x_return_status := fnd_api.g_ret_sts_unexp_error;
812: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
807: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
811: x_return_status := fnd_api.g_ret_sts_unexp_error;
812: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
813: WHEN OTHERS
814: THEN
815: ROLLBACK TO update_comp_plan;
808: WHEN fnd_api.g_exc_unexpected_error
809: THEN
810: ROLLBACK TO update_comp_plan;
811: x_return_status := fnd_api.g_ret_sts_unexp_error;
812: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
813: WHEN OTHERS
814: THEN
815: ROLLBACK TO update_comp_plan;
816: x_return_status := fnd_api.g_ret_sts_unexp_error;
812: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
813: WHEN OTHERS
814: THEN
815: ROLLBACK TO update_comp_plan;
816: x_return_status := fnd_api.g_ret_sts_unexp_error;
817:
818: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
819: THEN
820: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
819: THEN
820: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
821: END IF;
822:
823: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
824: END update_comp_plan;
825:
826: -- Start of comments
827: -- API name : Delete_Comp_Plan
830: -- Pre-reqs : None.
831: -- Parameters :
832: -- IN : p_api_version IN NUMBER Required
833: -- p_init_msg_list IN VARCHAR2 Optional
834: -- Default = FND_API.G_FALSE
835: -- p_commit IN VARCHAR2 Optional
836: -- Default = FND_API.G_FALSE
837: -- p_validation_level IN NUMBER Optional
838: -- Default = FND_API.G_VALID_LEVEL_FULL
832: -- IN : p_api_version IN NUMBER Required
833: -- p_init_msg_list IN VARCHAR2 Optional
834: -- Default = FND_API.G_FALSE
835: -- p_commit IN VARCHAR2 Optional
836: -- Default = FND_API.G_FALSE
837: -- p_validation_level IN NUMBER Optional
838: -- Default = FND_API.G_VALID_LEVEL_FULL
839: -- p_comp_plan IN comp_plan_rec_type
840: -- OUT : x_return_status OUT VARCHAR2(1)
834: -- Default = FND_API.G_FALSE
835: -- p_commit IN VARCHAR2 Optional
836: -- Default = FND_API.G_FALSE
837: -- p_validation_level IN NUMBER Optional
838: -- Default = FND_API.G_VALID_LEVEL_FULL
839: -- p_comp_plan IN comp_plan_rec_type
840: -- OUT : x_return_status OUT VARCHAR2(1)
841: -- x_msg_count OUT NUMBER
842: -- x_msg_data OUT VARCHAR2(2000)
845: --
846: -- End of comments
847: PROCEDURE delete_comp_plan (
848: p_api_version IN NUMBER,
849: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
850: p_commit IN VARCHAR2 := fnd_api.g_false,
851: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
852: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
853: x_return_status OUT NOCOPY VARCHAR2,
846: -- End of comments
847: PROCEDURE delete_comp_plan (
848: p_api_version IN NUMBER,
849: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
850: p_commit IN VARCHAR2 := fnd_api.g_false,
851: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
852: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
853: x_return_status OUT NOCOPY VARCHAR2,
854: x_msg_count OUT NOCOPY NUMBER,
847: PROCEDURE delete_comp_plan (
848: p_api_version IN NUMBER,
849: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
850: p_commit IN VARCHAR2 := fnd_api.g_false,
851: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
852: p_comp_plan IN OUT NOCOPY comp_plan_rec_type,
853: x_return_status OUT NOCOPY VARCHAR2,
854: x_msg_count OUT NOCOPY NUMBER,
855: x_msg_data OUT NOCOPY VARCHAR2
868: -- Standard Start of API savepoint
869: SAVEPOINT delete_comp_plan;
870:
871: -- Standard call to check for call compatibility.
872: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
873: THEN
874: RAISE fnd_api.g_exc_unexpected_error;
875: END IF;
876:
870:
871: -- Standard call to check for call compatibility.
872: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
873: THEN
874: RAISE fnd_api.g_exc_unexpected_error;
875: END IF;
876:
877: -- Initialize message list if p_init_msg_list is set to TRUE.
878: IF fnd_api.to_boolean (p_init_msg_list)
874: RAISE fnd_api.g_exc_unexpected_error;
875: END IF;
876:
877: -- Initialize message list if p_init_msg_list is set to TRUE.
878: IF fnd_api.to_boolean (p_init_msg_list)
879: THEN
880: fnd_msg_pub.initialize;
881: END IF;
882:
880: fnd_msg_pub.initialize;
881: END IF;
882:
883: -- Initialize API return status to success
884: x_return_status := fnd_api.g_ret_sts_success;
885: -- API body
886: -- *** Check the ORG_ID is null or not ***
887: check_org_id (p_comp_plan.org_id);
888: l_org_id := p_comp_plan.org_id;
965: END IF;
966:
967: -- End of API body.
968: -- Standard check of p_commit.
969: IF fnd_api.to_boolean (p_commit)
970: THEN
971: COMMIT WORK;
972: END IF;
973:
971: COMMIT WORK;
972: END IF;
973:
974: -- Standard call to get message count and if count is 1, get message info.
975: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
976: EXCEPTION
977: WHEN fnd_api.g_exc_error
978: THEN
979: ROLLBACK TO delete_comp_plan;
973:
974: -- Standard call to get message count and if count is 1, get message info.
975: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
976: EXCEPTION
977: WHEN fnd_api.g_exc_error
978: THEN
979: ROLLBACK TO delete_comp_plan;
980: x_return_status := fnd_api.g_ret_sts_error;
981: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
976: EXCEPTION
977: WHEN fnd_api.g_exc_error
978: THEN
979: ROLLBACK TO delete_comp_plan;
980: x_return_status := fnd_api.g_ret_sts_error;
981: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
977: WHEN fnd_api.g_exc_error
978: THEN
979: ROLLBACK TO delete_comp_plan;
980: x_return_status := fnd_api.g_ret_sts_error;
981: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
985: x_return_status := fnd_api.g_ret_sts_unexp_error;
978: THEN
979: ROLLBACK TO delete_comp_plan;
980: x_return_status := fnd_api.g_ret_sts_error;
981: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
985: x_return_status := fnd_api.g_ret_sts_unexp_error;
986: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
981: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
985: x_return_status := fnd_api.g_ret_sts_unexp_error;
986: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
987: WHEN OTHERS
988: THEN
989: ROLLBACK TO delete_comp_plan;
982: WHEN fnd_api.g_exc_unexpected_error
983: THEN
984: ROLLBACK TO delete_comp_plan;
985: x_return_status := fnd_api.g_ret_sts_unexp_error;
986: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
987: WHEN OTHERS
988: THEN
989: ROLLBACK TO delete_comp_plan;
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
986: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
987: WHEN OTHERS
988: THEN
989: ROLLBACK TO delete_comp_plan;
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
991:
992: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
993: THEN
994: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
993: THEN
994: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
995: END IF;
996:
997: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
998: END delete_comp_plan;
999:
1000: -- Start of comments
1001: -- API name : Get_Comp_Plan_Sum
1004: -- Pre-reqs : None.
1005: -- Parameters :
1006: -- IN : p_api_version IN NUMBER Required
1007: -- p_init_msg_list IN VARCHAR2 Optional
1008: -- Default = FND_API.G_FALSE
1009: -- p_commit IN VARCHAR2 Optional
1010: -- Default = FND_API.G_FALSE
1011: -- p_validation_level IN NUMBER Optional
1012: -- Default = FND_API.G_VALID_LEVEL_FULL
1006: -- IN : p_api_version IN NUMBER Required
1007: -- p_init_msg_list IN VARCHAR2 Optional
1008: -- Default = FND_API.G_FALSE
1009: -- p_commit IN VARCHAR2 Optional
1010: -- Default = FND_API.G_FALSE
1011: -- p_validation_level IN NUMBER Optional
1012: -- Default = FND_API.G_VALID_LEVEL_FULL
1013: -- p_start_record IN NUMBER
1014: -- Default = -1
1008: -- Default = FND_API.G_FALSE
1009: -- p_commit IN VARCHAR2 Optional
1010: -- Default = FND_API.G_FALSE
1011: -- p_validation_level IN NUMBER Optional
1012: -- Default = FND_API.G_VALID_LEVEL_FULL
1013: -- p_start_record IN NUMBER
1014: -- Default = -1
1015: -- p_fetch_size IN NUMBER
1016: -- Default = -1
1016: -- Default = -1
1017: -- p_search_name IN VARCHAR2
1018: -- Default = '%'
1019: -- p_search_date IN DATE
1020: -- Default = FND_API.G_MISS_DATE
1021: -- p_search_status IN VARCHAR2
1022: -- Default = FND_API.G_MISS_CHAR
1023: -- OUT : x_return_status OUT VARCHAR2(1)
1024: -- x_msg_count OUT NUMBER
1018: -- Default = '%'
1019: -- p_search_date IN DATE
1020: -- Default = FND_API.G_MISS_DATE
1021: -- p_search_status IN VARCHAR2
1022: -- Default = FND_API.G_MISS_CHAR
1023: -- OUT : x_return_status OUT VARCHAR2(1)
1024: -- x_msg_count OUT NUMBER
1025: -- x_msg_data OUT VARCHAR2(2000)
1026: -- x_comp_plan OUT comp_plan_tbl_type
1030: --
1031: -- End of comments
1032: PROCEDURE get_comp_plan_sum (
1033: p_api_version IN NUMBER,
1034: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1035: p_commit IN VARCHAR2 := fnd_api.g_false,
1036: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1037: p_start_record IN NUMBER := -1,
1038: p_fetch_size IN NUMBER := -1,
1031: -- End of comments
1032: PROCEDURE get_comp_plan_sum (
1033: p_api_version IN NUMBER,
1034: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1035: p_commit IN VARCHAR2 := fnd_api.g_false,
1036: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1037: p_start_record IN NUMBER := -1,
1038: p_fetch_size IN NUMBER := -1,
1039: p_search_name IN VARCHAR2 := '%',
1032: PROCEDURE get_comp_plan_sum (
1033: p_api_version IN NUMBER,
1034: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1035: p_commit IN VARCHAR2 := fnd_api.g_false,
1036: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1037: p_start_record IN NUMBER := -1,
1038: p_fetch_size IN NUMBER := -1,
1039: p_search_name IN VARCHAR2 := '%',
1040: p_search_date IN DATE := fnd_api.g_miss_date,
1036: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1037: p_start_record IN NUMBER := -1,
1038: p_fetch_size IN NUMBER := -1,
1039: p_search_name IN VARCHAR2 := '%',
1040: p_search_date IN DATE := fnd_api.g_miss_date,
1041: p_search_status IN VARCHAR2 := fnd_api.g_miss_char,
1042: x_comp_plan OUT NOCOPY comp_plan_tbl_type,
1043: x_total_record OUT NOCOPY NUMBER,
1044: x_return_status OUT NOCOPY VARCHAR2,
1037: p_start_record IN NUMBER := -1,
1038: p_fetch_size IN NUMBER := -1,
1039: p_search_name IN VARCHAR2 := '%',
1040: p_search_date IN DATE := fnd_api.g_miss_date,
1041: p_search_status IN VARCHAR2 := fnd_api.g_miss_char,
1042: x_comp_plan OUT NOCOPY comp_plan_tbl_type,
1043: x_total_record OUT NOCOPY NUMBER,
1044: x_return_status OUT NOCOPY VARCHAR2,
1045: x_msg_count OUT NOCOPY NUMBER,
1062: -- Standard Start of API savepoint
1063: SAVEPOINT get_comp_plan_sum;
1064:
1065: -- Standard call to check for call compatibility.
1066: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1067: THEN
1068: RAISE fnd_api.g_exc_unexpected_error;
1069: END IF;
1070:
1064:
1065: -- Standard call to check for call compatibility.
1066: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1067: THEN
1068: RAISE fnd_api.g_exc_unexpected_error;
1069: END IF;
1070:
1071: -- Initialize message list if p_init_msg_list is set to TRUE.
1072: IF fnd_api.to_boolean (p_init_msg_list)
1068: RAISE fnd_api.g_exc_unexpected_error;
1069: END IF;
1070:
1071: -- Initialize message list if p_init_msg_list is set to TRUE.
1072: IF fnd_api.to_boolean (p_init_msg_list)
1073: THEN
1074: fnd_msg_pub.initialize;
1075: END IF;
1076:
1074: fnd_msg_pub.initialize;
1075: END IF;
1076:
1077: -- Initialize API return status to success
1078: x_return_status := fnd_api.g_ret_sts_success;
1079: -- API body
1080: x_comp_plan := g_miss_comp_plan_rec_tb;
1081: l_counter := 0;
1082: x_total_record := 0;
1102: END LOOP;
1103:
1104: -- End of API body.
1105: -- Standard check of p_commit.
1106: IF fnd_api.to_boolean (p_commit)
1107: THEN
1108: COMMIT WORK;
1109: END IF;
1110:
1108: COMMIT WORK;
1109: END IF;
1110:
1111: -- Standard call to get message count and if count is 1, get message info.
1112: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1113: EXCEPTION
1114: WHEN fnd_api.g_exc_error
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1110:
1111: -- Standard call to get message count and if count is 1, get message info.
1112: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1113: EXCEPTION
1114: WHEN fnd_api.g_exc_error
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1117: x_return_status := fnd_api.g_ret_sts_error;
1118: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1113: EXCEPTION
1114: WHEN fnd_api.g_exc_error
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1117: x_return_status := fnd_api.g_ret_sts_error;
1118: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1114: WHEN fnd_api.g_exc_error
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1117: x_return_status := fnd_api.g_ret_sts_error;
1118: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1122: x_return_status := fnd_api.g_ret_sts_unexp_error;
1115: THEN
1116: ROLLBACK TO get_comp_plan_sum;
1117: x_return_status := fnd_api.g_ret_sts_error;
1118: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1122: x_return_status := fnd_api.g_ret_sts_unexp_error;
1123: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1118: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1122: x_return_status := fnd_api.g_ret_sts_unexp_error;
1123: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1124: WHEN OTHERS
1125: THEN
1126: ROLLBACK TO get_comp_plan_sum;
1119: WHEN fnd_api.g_exc_unexpected_error
1120: THEN
1121: ROLLBACK TO get_comp_plan_sum;
1122: x_return_status := fnd_api.g_ret_sts_unexp_error;
1123: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1124: WHEN OTHERS
1125: THEN
1126: ROLLBACK TO get_comp_plan_sum;
1127: x_return_status := fnd_api.g_ret_sts_unexp_error;
1123: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1124: WHEN OTHERS
1125: THEN
1126: ROLLBACK TO get_comp_plan_sum;
1127: x_return_status := fnd_api.g_ret_sts_unexp_error;
1128:
1129: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1130: THEN
1131: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1130: THEN
1131: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1132: END IF;
1133:
1134: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1135: END get_comp_plan_sum;
1136:
1137: -- Start of comments
1138: -- API name : Get_Comp_Plan_Dtl
1141: -- Pre-reqs : None.
1142: -- Parameters :
1143: -- IN : p_api_version IN NUMBER Required
1144: -- p_init_msg_list IN VARCHAR2 Optional
1145: -- Default = FND_API.G_FALSE
1146: -- p_commit IN VARCHAR2 Optional
1147: -- Default = FND_API.G_FALSE
1148: -- p_validation_level IN NUMBER Optional
1149: -- Default = FND_API.G_VALID_LEVEL_FULL
1143: -- IN : p_api_version IN NUMBER Required
1144: -- p_init_msg_list IN VARCHAR2 Optional
1145: -- Default = FND_API.G_FALSE
1146: -- p_commit IN VARCHAR2 Optional
1147: -- Default = FND_API.G_FALSE
1148: -- p_validation_level IN NUMBER Optional
1149: -- Default = FND_API.G_VALID_LEVEL_FULL
1150: -- p_comp_plan_id IN NUMBER
1151: -- OUT : x_return_status OUT VARCHAR2(1)
1145: -- Default = FND_API.G_FALSE
1146: -- p_commit IN VARCHAR2 Optional
1147: -- Default = FND_API.G_FALSE
1148: -- p_validation_level IN NUMBER Optional
1149: -- Default = FND_API.G_VALID_LEVEL_FULL
1150: -- p_comp_plan_id IN NUMBER
1151: -- OUT : x_return_status OUT VARCHAR2(1)
1152: -- x_msg_count OUT NUMBER
1153: -- x_msg_data OUT VARCHAR2(2000)
1157: --
1158: -- End of comments
1159: PROCEDURE get_comp_plan_dtl (
1160: p_api_version IN NUMBER,
1161: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1162: p_commit IN VARCHAR2 := fnd_api.g_false,
1163: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1164: p_comp_plan_id IN NUMBER,
1165: x_comp_plan OUT NOCOPY comp_plan_tbl_type,
1158: -- End of comments
1159: PROCEDURE get_comp_plan_dtl (
1160: p_api_version IN NUMBER,
1161: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1162: p_commit IN VARCHAR2 := fnd_api.g_false,
1163: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1164: p_comp_plan_id IN NUMBER,
1165: x_comp_plan OUT NOCOPY comp_plan_tbl_type,
1166: x_return_status OUT NOCOPY VARCHAR2,
1159: PROCEDURE get_comp_plan_dtl (
1160: p_api_version IN NUMBER,
1161: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1162: p_commit IN VARCHAR2 := fnd_api.g_false,
1163: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1164: p_comp_plan_id IN NUMBER,
1165: x_comp_plan OUT NOCOPY comp_plan_tbl_type,
1166: x_return_status OUT NOCOPY VARCHAR2,
1167: x_msg_count OUT NOCOPY NUMBER,
1182: -- Standard Start of API savepoint
1183: SAVEPOINT get_comp_plan_dtl;
1184:
1185: -- Standard call to check for call compatibility.
1186: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1187: THEN
1188: RAISE fnd_api.g_exc_unexpected_error;
1189: END IF;
1190:
1184:
1185: -- Standard call to check for call compatibility.
1186: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1187: THEN
1188: RAISE fnd_api.g_exc_unexpected_error;
1189: END IF;
1190:
1191: -- Initialize message list if p_init_msg_list is set to TRUE.
1192: IF fnd_api.to_boolean (p_init_msg_list)
1188: RAISE fnd_api.g_exc_unexpected_error;
1189: END IF;
1190:
1191: -- Initialize message list if p_init_msg_list is set to TRUE.
1192: IF fnd_api.to_boolean (p_init_msg_list)
1193: THEN
1194: fnd_msg_pub.initialize;
1195: END IF;
1196:
1194: fnd_msg_pub.initialize;
1195: END IF;
1196:
1197: -- Initialize API return status to success
1198: x_return_status := fnd_api.g_ret_sts_success;
1199:
1200: -- API body
1201: OPEN l_comp_plan_cr;
1202:
1240: CLOSE l_comp_plan_cr;
1241:
1242: -- End of API body.
1243: -- Standard check of p_commit.
1244: IF fnd_api.to_boolean (p_commit)
1245: THEN
1246: COMMIT WORK;
1247: END IF;
1248:
1246: COMMIT WORK;
1247: END IF;
1248:
1249: -- Standard call to get message count and if count is 1, get message info.
1250: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1251: EXCEPTION
1252: WHEN fnd_api.g_exc_error
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1248:
1249: -- Standard call to get message count and if count is 1, get message info.
1250: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1251: EXCEPTION
1252: WHEN fnd_api.g_exc_error
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1251: EXCEPTION
1252: WHEN fnd_api.g_exc_error
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1252: WHEN fnd_api.g_exc_error
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1260: x_return_status := fnd_api.g_ret_sts_unexp_error;
1253: THEN
1254: ROLLBACK TO get_comp_plan_dtl;
1255: x_return_status := fnd_api.g_ret_sts_error;
1256: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1260: x_return_status := fnd_api.g_ret_sts_unexp_error;
1261: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1256: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1260: x_return_status := fnd_api.g_ret_sts_unexp_error;
1261: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1262: WHEN OTHERS
1263: THEN
1264: ROLLBACK TO get_comp_plan_dtl;
1257: WHEN fnd_api.g_exc_unexpected_error
1258: THEN
1259: ROLLBACK TO get_comp_plan_dtl;
1260: x_return_status := fnd_api.g_ret_sts_unexp_error;
1261: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1262: WHEN OTHERS
1263: THEN
1264: ROLLBACK TO get_comp_plan_dtl;
1265: x_return_status := fnd_api.g_ret_sts_unexp_error;
1261: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1262: WHEN OTHERS
1263: THEN
1264: ROLLBACK TO get_comp_plan_dtl;
1265: x_return_status := fnd_api.g_ret_sts_unexp_error;
1266:
1267: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1268: THEN
1269: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1268: THEN
1269: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1270: END IF;
1271:
1272: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1273: END get_comp_plan_dtl;
1274:
1275: -- Start of comments
1276: -- API name : Get_Sales_Role
1279: -- Pre-reqs : None.
1280: -- Parameters :
1281: -- IN : p_api_version IN NUMBER Required
1282: -- p_init_msg_list IN VARCHAR2 Optional
1283: -- Default = FND_API.G_FALSE
1284: -- p_commit IN VARCHAR2 Optional
1285: -- Default = FND_API.G_FALSE
1286: -- p_validation_level IN NUMBER Optional
1287: -- Default = FND_API.G_VALID_LEVEL_FULL
1281: -- IN : p_api_version IN NUMBER Required
1282: -- p_init_msg_list IN VARCHAR2 Optional
1283: -- Default = FND_API.G_FALSE
1284: -- p_commit IN VARCHAR2 Optional
1285: -- Default = FND_API.G_FALSE
1286: -- p_validation_level IN NUMBER Optional
1287: -- Default = FND_API.G_VALID_LEVEL_FULL
1288: -- p_comp_plan_id IN NUMBER
1289: -- OUT : x_return_status OUT VARCHAR2(1)
1283: -- Default = FND_API.G_FALSE
1284: -- p_commit IN VARCHAR2 Optional
1285: -- Default = FND_API.G_FALSE
1286: -- p_validation_level IN NUMBER Optional
1287: -- Default = FND_API.G_VALID_LEVEL_FULL
1288: -- p_comp_plan_id IN NUMBER
1289: -- OUT : x_return_status OUT VARCHAR2(1)
1290: -- x_msg_count OUT NUMBER
1291: -- x_msg_data OUT VARCHAR2(2000)
1295: --
1296: -- End of comments
1297: PROCEDURE get_sales_role (
1298: p_api_version IN NUMBER,
1299: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1300: p_commit IN VARCHAR2 := fnd_api.g_false,
1301: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1302: p_comp_plan_id IN NUMBER,
1303: x_sales_role OUT NOCOPY sales_role_tbl_type,
1296: -- End of comments
1297: PROCEDURE get_sales_role (
1298: p_api_version IN NUMBER,
1299: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1300: p_commit IN VARCHAR2 := fnd_api.g_false,
1301: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1302: p_comp_plan_id IN NUMBER,
1303: x_sales_role OUT NOCOPY sales_role_tbl_type,
1304: x_return_status OUT NOCOPY VARCHAR2,
1297: PROCEDURE get_sales_role (
1298: p_api_version IN NUMBER,
1299: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1300: p_commit IN VARCHAR2 := fnd_api.g_false,
1301: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1302: p_comp_plan_id IN NUMBER,
1303: x_sales_role OUT NOCOPY sales_role_tbl_type,
1304: x_return_status OUT NOCOPY VARCHAR2,
1305: x_msg_count OUT NOCOPY NUMBER,
1327: -- Standard Start of API savepoint
1328: SAVEPOINT get_sales_role;
1329:
1330: -- Standard call to check for call compatibility.
1331: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1332: THEN
1333: RAISE fnd_api.g_exc_unexpected_error;
1334: END IF;
1335:
1329:
1330: -- Standard call to check for call compatibility.
1331: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1332: THEN
1333: RAISE fnd_api.g_exc_unexpected_error;
1334: END IF;
1335:
1336: -- Initialize message list if p_init_msg_list is set to TRUE.
1337: IF fnd_api.to_boolean (p_init_msg_list)
1333: RAISE fnd_api.g_exc_unexpected_error;
1334: END IF;
1335:
1336: -- Initialize message list if p_init_msg_list is set to TRUE.
1337: IF fnd_api.to_boolean (p_init_msg_list)
1338: THEN
1339: fnd_msg_pub.initialize;
1340: END IF;
1341:
1339: fnd_msg_pub.initialize;
1340: END IF;
1341:
1342: -- Initialize API return status to success
1343: x_return_status := fnd_api.g_ret_sts_success;
1344: -- API body
1345: x_sales_role := g_miss_sales_role_rec_tb;
1346: l_counter := 0;
1347:
1357: END LOOP;
1358:
1359: -- End of API body.
1360: -- Standard check of p_commit.
1361: IF fnd_api.to_boolean (p_commit)
1362: THEN
1363: COMMIT WORK;
1364: END IF;
1365:
1363: COMMIT WORK;
1364: END IF;
1365:
1366: -- Standard call to get message count and if count is 1, get message info.
1367: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1368: EXCEPTION
1369: WHEN fnd_api.g_exc_error
1370: THEN
1371: ROLLBACK TO get_sales_role;
1365:
1366: -- Standard call to get message count and if count is 1, get message info.
1367: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1368: EXCEPTION
1369: WHEN fnd_api.g_exc_error
1370: THEN
1371: ROLLBACK TO get_sales_role;
1372: x_return_status := fnd_api.g_ret_sts_error;
1373: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1368: EXCEPTION
1369: WHEN fnd_api.g_exc_error
1370: THEN
1371: ROLLBACK TO get_sales_role;
1372: x_return_status := fnd_api.g_ret_sts_error;
1373: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1369: WHEN fnd_api.g_exc_error
1370: THEN
1371: ROLLBACK TO get_sales_role;
1372: x_return_status := fnd_api.g_ret_sts_error;
1373: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1377: x_return_status := fnd_api.g_ret_sts_unexp_error;
1370: THEN
1371: ROLLBACK TO get_sales_role;
1372: x_return_status := fnd_api.g_ret_sts_error;
1373: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1377: x_return_status := fnd_api.g_ret_sts_unexp_error;
1378: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1373: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1377: x_return_status := fnd_api.g_ret_sts_unexp_error;
1378: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1379: WHEN OTHERS
1380: THEN
1381: ROLLBACK TO get_sales_role;
1374: WHEN fnd_api.g_exc_unexpected_error
1375: THEN
1376: ROLLBACK TO get_sales_role;
1377: x_return_status := fnd_api.g_ret_sts_unexp_error;
1378: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1379: WHEN OTHERS
1380: THEN
1381: ROLLBACK TO get_sales_role;
1382: x_return_status := fnd_api.g_ret_sts_unexp_error;
1378: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1379: WHEN OTHERS
1380: THEN
1381: ROLLBACK TO get_sales_role;
1382: x_return_status := fnd_api.g_ret_sts_unexp_error;
1383:
1384: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1385: THEN
1386: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1385: THEN
1386: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1387: END IF;
1388:
1389: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1390: END get_sales_role;
1391:
1392: -- Start of comments
1393: -- API name : Validate_Comp_Plan
1396: -- Pre-reqs : None.
1397: -- Parameters :
1398: -- IN : p_api_version IN NUMBER Required
1399: -- p_init_msg_list IN VARCHAR2 Optional
1400: -- Default = FND_API.G_FALSE
1401: -- p_commit IN VARCHAR2 Optional
1402: -- Default = FND_API.G_FALSE
1403: -- p_validation_level IN NUMBER Optional
1404: -- Default = FND_API.G_VALID_LEVEL_FULL
1398: -- IN : p_api_version IN NUMBER Required
1399: -- p_init_msg_list IN VARCHAR2 Optional
1400: -- Default = FND_API.G_FALSE
1401: -- p_commit IN VARCHAR2 Optional
1402: -- Default = FND_API.G_FALSE
1403: -- p_validation_level IN NUMBER Optional
1404: -- Default = FND_API.G_VALID_LEVEL_FULL
1405: -- p_comp_plan IN comp_plan_rec_type
1406: -- OUT : x_return_status OUT VARCHAR2(1)
1400: -- Default = FND_API.G_FALSE
1401: -- p_commit IN VARCHAR2 Optional
1402: -- Default = FND_API.G_FALSE
1403: -- p_validation_level IN NUMBER Optional
1404: -- Default = FND_API.G_VALID_LEVEL_FULL
1405: -- p_comp_plan IN comp_plan_rec_type
1406: -- OUT : x_return_status OUT VARCHAR2(1)
1407: -- x_msg_count OUT NUMBER
1408: -- x_msg_data OUT VARCHAR2(2000)
1411: --
1412: -- End of comments
1413: PROCEDURE validate_comp_plan (
1414: p_api_version IN NUMBER,
1415: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1416: p_commit IN VARCHAR2 := fnd_api.g_false,
1417: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1418: p_comp_plan IN comp_plan_rec_type,
1419: x_return_status OUT NOCOPY VARCHAR2,
1412: -- End of comments
1413: PROCEDURE validate_comp_plan (
1414: p_api_version IN NUMBER,
1415: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1416: p_commit IN VARCHAR2 := fnd_api.g_false,
1417: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1418: p_comp_plan IN comp_plan_rec_type,
1419: x_return_status OUT NOCOPY VARCHAR2,
1420: x_msg_count OUT NOCOPY NUMBER,
1413: PROCEDURE validate_comp_plan (
1414: p_api_version IN NUMBER,
1415: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
1416: p_commit IN VARCHAR2 := fnd_api.g_false,
1417: p_validation_level IN NUMBER := fnd_api.g_valid_level_full,
1418: p_comp_plan IN comp_plan_rec_type,
1419: x_return_status OUT NOCOPY VARCHAR2,
1420: x_msg_count OUT NOCOPY NUMBER,
1421: x_msg_data OUT NOCOPY VARCHAR2
1453: -- Standard Start of API savepoint
1454: SAVEPOINT validate_comp_plan;
1455:
1456: -- Standard call to check for call compatibility.
1457: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1458: THEN
1459: RAISE fnd_api.g_exc_unexpected_error;
1460: END IF;
1461:
1455:
1456: -- Standard call to check for call compatibility.
1457: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name)
1458: THEN
1459: RAISE fnd_api.g_exc_unexpected_error;
1460: END IF;
1461:
1462: -- Initialize message list if p_init_msg_list is set to TRUE.
1463: IF fnd_api.to_boolean (p_init_msg_list)
1459: RAISE fnd_api.g_exc_unexpected_error;
1460: END IF;
1461:
1462: -- Initialize message list if p_init_msg_list is set to TRUE.
1463: IF fnd_api.to_boolean (p_init_msg_list)
1464: THEN
1465: fnd_msg_pub.initialize;
1466: END IF;
1467:
1465: fnd_msg_pub.initialize;
1466: END IF;
1467:
1468: -- Initialize API return status to success
1469: x_return_status := fnd_api.g_ret_sts_success;
1470:
1471: -- API body
1472: -- *** Check the ORG_ID is null or not ***
1473: --check_org_id(p_comp_plan.org_id);
1485: fnd_message.set_name ('CN', 'CN_NO_PE_ASSIGNED');
1486: fnd_msg_pub.ADD;
1487: END IF;
1488:
1489: RAISE fnd_api.g_exc_error;
1490: END IF;
1491:
1492: -- 2. cannot have incomplete formula assigned
1493: FOR f IN incomp_formulas
1508: fnd_message.set_token ('FORMULA_NAME', l_incomp_forms);
1509: fnd_msg_pub.ADD;
1510: END IF;
1511:
1512: RAISE fnd_api.g_exc_error;
1513: END IF;
1514:
1515: OPEN l_old_comp_plan_cr;
1516:
1548: WHERE comp_plan_id = p_comp_plan.comp_plan_id;
1549:
1550: IF l_status_code <> 'COMPLETE'
1551: THEN
1552: x_return_status := fnd_api.g_ret_sts_error;
1553: --RAISE fnd_api.g_exc_error;
1554: END IF;
1555:
1556: -- End of API body.
1549:
1550: IF l_status_code <> 'COMPLETE'
1551: THEN
1552: x_return_status := fnd_api.g_ret_sts_error;
1553: --RAISE fnd_api.g_exc_error;
1554: END IF;
1555:
1556: -- End of API body.
1557: -- Standard check of p_commit.
1554: END IF;
1555:
1556: -- End of API body.
1557: -- Standard check of p_commit.
1558: IF fnd_api.to_boolean (p_commit)
1559: THEN
1560: COMMIT WORK;
1561: END IF;
1562:
1560: COMMIT WORK;
1561: END IF;
1562:
1563: -- Standard call to get message count and if count is 1, get message info.
1564: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1565: EXCEPTION
1566: WHEN fnd_api.g_exc_error
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1562:
1563: -- Standard call to get message count and if count is 1, get message info.
1564: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1565: EXCEPTION
1566: WHEN fnd_api.g_exc_error
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1565: EXCEPTION
1566: WHEN fnd_api.g_exc_error
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1566: WHEN fnd_api.g_exc_error
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1574: x_return_status := fnd_api.g_ret_sts_unexp_error;
1567: THEN
1568: ROLLBACK TO validate_comp_plan;
1569: x_return_status := fnd_api.g_ret_sts_error;
1570: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1574: x_return_status := fnd_api.g_ret_sts_unexp_error;
1575: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1570: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1574: x_return_status := fnd_api.g_ret_sts_unexp_error;
1575: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1576: WHEN OTHERS
1577: THEN
1578: ROLLBACK TO validate_comp_plan;
1571: WHEN fnd_api.g_exc_unexpected_error
1572: THEN
1573: ROLLBACK TO validate_comp_plan;
1574: x_return_status := fnd_api.g_ret_sts_unexp_error;
1575: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1576: WHEN OTHERS
1577: THEN
1578: ROLLBACK TO validate_comp_plan;
1579: x_return_status := fnd_api.g_ret_sts_unexp_error;
1575: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1576: WHEN OTHERS
1577: THEN
1578: ROLLBACK TO validate_comp_plan;
1579: x_return_status := fnd_api.g_ret_sts_unexp_error;
1580:
1581: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1582: THEN
1583: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1582: THEN
1583: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1584: END IF;
1585:
1586: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1587: END validate_comp_plan;
1588:
1589: --| -----------------------------------------------------------------------=
1590: --| Procedure Name : check_revenue_class_overlap
1667:
1668: result boolean;
1669:
1670: BEGIN
1671: x_return_status := fnd_api.g_ret_sts_success;
1672: x_loading_status := p_loading_status;
1673:
1674: BEGIN
1675: SELECT NAME,
1687: fnd_msg_pub.ADD;
1688: END IF;
1689:
1690: x_loading_status := 'CN_CP_NOT_EXIST';
1691: x_return_status := fnd_api.g_ret_sts_error;
1692: END;
1693:
1694: IF l_rc_overlap = 'N'
1695: THEN
1715: fnd_msg_pub.ADD;
1716: END IF; */
1717:
1718: x_loading_status := 'PLN_PLAN_DUP_REV_CLASS';
1719: x_return_status := fnd_api.g_ret_sts_error;
1720: END IF;
1721: END IF;
1722: END check_revenue_class_overlap;
1723:
1779: -- || Compplan.
1780: -- =====================================================
1781: PROCEDURE duplicate_comp_plan (
1782: p_api_version IN NUMBER,
1783: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1784: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1785: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1786: p_comp_plan_id IN CN_COMP_PLANS.COMP_PLAN_ID%TYPE,
1787: p_org_id IN NUMBER,
1780: -- =====================================================
1781: PROCEDURE duplicate_comp_plan (
1782: p_api_version IN NUMBER,
1783: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1784: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1785: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1786: p_comp_plan_id IN CN_COMP_PLANS.COMP_PLAN_ID%TYPE,
1787: p_org_id IN NUMBER,
1788: x_return_status OUT NOCOPY VARCHAR2,
1781: PROCEDURE duplicate_comp_plan (
1782: p_api_version IN NUMBER,
1783: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1784: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1785: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1786: p_comp_plan_id IN CN_COMP_PLANS.COMP_PLAN_ID%TYPE,
1787: p_org_id IN NUMBER,
1788: x_return_status OUT NOCOPY VARCHAR2,
1789: x_msg_count OUT NOCOPY NUMBER,
1817: SAVEPOINT duplicate_comp_plan;
1818:
1819: -- Standard call to check for call compatibility.
1820:
1821: IF NOT FND_API.Compatible_API_Call (l_api_version ,
1822: p_api_version ,
1823: l_api_name,
1824: G_PKG_NAME )
1825: THEN
1823: l_api_name,
1824: G_PKG_NAME )
1825: THEN
1826:
1827: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1828:
1829: END IF;
1830:
1831: -- Initialize message list if p_init_msg_list is set to TRUE.
1829: END IF;
1830:
1831: -- Initialize message list if p_init_msg_list is set to TRUE.
1832:
1833: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1834:
1835: FND_MSG_PUB.initialize;
1836:
1837: END IF;
1837: END IF;
1838:
1839: -- Initialize API return status to success
1840:
1841: x_return_status := FND_API.G_RET_STS_SUCCESS;
1842:
1843:
1844: Open get_comp_plan_data;
1845: fetch get_comp_plan_data into l_comp_plan;
1844: Open get_comp_plan_data;
1845: fetch get_comp_plan_data into l_comp_plan;
1846:
1847: IF get_comp_plan_data%notfound THEN
1848: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1849: END IF;
1850:
1851: -- calling public api
1852: SELECT
1849: END IF;
1850:
1851: -- calling public api
1852: SELECT
1853: DECODE (l_comp_plan.description, fnd_api.g_miss_char, NULL, l_comp_plan.description),
1854: 'INCOMPLETE',
1855: DECODE (l_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, l_comp_plan.allow_rev_class_overlap),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1851: -- calling public api
1852: SELECT
1853: DECODE (l_comp_plan.description, fnd_api.g_miss_char, NULL, l_comp_plan.description),
1854: 'INCOMPLETE',
1855: DECODE (l_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, l_comp_plan.allow_rev_class_overlap),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1852: SELECT
1853: DECODE (l_comp_plan.description, fnd_api.g_miss_char, NULL, l_comp_plan.description),
1854: 'INCOMPLETE',
1855: DECODE (l_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, l_comp_plan.allow_rev_class_overlap),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1853: DECODE (l_comp_plan.description, fnd_api.g_miss_char, NULL, l_comp_plan.description),
1854: 'INCOMPLETE',
1855: DECODE (l_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, l_comp_plan.allow_rev_class_overlap),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1854: 'INCOMPLETE',
1855: DECODE (l_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, l_comp_plan.allow_rev_class_overlap),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1855: DECODE (l_comp_plan.allow_rev_class_overlap, fnd_api.g_miss_char, NULL, l_comp_plan.allow_rev_class_overlap),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1856: DECODE (l_comp_plan.start_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.start_date)),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1857: DECODE (l_comp_plan.end_date, fnd_api.g_miss_date, NULL, TRUNC (l_comp_plan.end_date)),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1858: DECODE (l_comp_plan.attribute_category, fnd_api.g_miss_char, NULL, l_comp_plan.attribute_category),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1859: DECODE (l_comp_plan.attribute1, fnd_api.g_miss_char, NULL, l_comp_plan.attribute1),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1860: DECODE (l_comp_plan.attribute2, fnd_api.g_miss_char, NULL, l_comp_plan.attribute2),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1861: DECODE (l_comp_plan.attribute3, fnd_api.g_miss_char, NULL, l_comp_plan.attribute3),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1862: DECODE (l_comp_plan.attribute4, fnd_api.g_miss_char, NULL, l_comp_plan.attribute4),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1863: DECODE (l_comp_plan.attribute5, fnd_api.g_miss_char, NULL, l_comp_plan.attribute5),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1864: DECODE (l_comp_plan.attribute6, fnd_api.g_miss_char, NULL, l_comp_plan.attribute6),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1865: DECODE (l_comp_plan.attribute7, fnd_api.g_miss_char, NULL, l_comp_plan.attribute7),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1873: DECODE (l_comp_plan.attribute15, fnd_api.g_miss_char, NULL, l_comp_plan.attribute15),
1866: DECODE (l_comp_plan.attribute8, fnd_api.g_miss_char, NULL, l_comp_plan.attribute8),
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1873: DECODE (l_comp_plan.attribute15, fnd_api.g_miss_char, NULL, l_comp_plan.attribute15),
1874: DECODE (l_comp_plan.org_id, fnd_api.g_miss_char, NULL, l_comp_plan.org_id)
1867: DECODE (l_comp_plan.attribute9, fnd_api.g_miss_char, NULL, l_comp_plan.attribute9),
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1873: DECODE (l_comp_plan.attribute15, fnd_api.g_miss_char, NULL, l_comp_plan.attribute15),
1874: DECODE (l_comp_plan.org_id, fnd_api.g_miss_char, NULL, l_comp_plan.org_id)
1875: INTO
1868: DECODE (l_comp_plan.attribute10, fnd_api.g_miss_char, NULL, l_comp_plan.attribute10),
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1873: DECODE (l_comp_plan.attribute15, fnd_api.g_miss_char, NULL, l_comp_plan.attribute15),
1874: DECODE (l_comp_plan.org_id, fnd_api.g_miss_char, NULL, l_comp_plan.org_id)
1875: INTO
1876: l_comp_plan_rec.description,
1869: DECODE (l_comp_plan.attribute11, fnd_api.g_miss_char, NULL, l_comp_plan.attribute11),
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1873: DECODE (l_comp_plan.attribute15, fnd_api.g_miss_char, NULL, l_comp_plan.attribute15),
1874: DECODE (l_comp_plan.org_id, fnd_api.g_miss_char, NULL, l_comp_plan.org_id)
1875: INTO
1876: l_comp_plan_rec.description,
1877: l_comp_plan_rec.status_code,
1870: DECODE (l_comp_plan.attribute12, fnd_api.g_miss_char, NULL, l_comp_plan.attribute12),
1871: DECODE (l_comp_plan.attribute13, fnd_api.g_miss_char, NULL, l_comp_plan.attribute13),
1872: DECODE (l_comp_plan.attribute14, fnd_api.g_miss_char, NULL, l_comp_plan.attribute14),
1873: DECODE (l_comp_plan.attribute15, fnd_api.g_miss_char, NULL, l_comp_plan.attribute15),
1874: DECODE (l_comp_plan.org_id, fnd_api.g_miss_char, NULL, l_comp_plan.org_id)
1875: INTO
1876: l_comp_plan_rec.description,
1877: l_comp_plan_rec.status_code,
1878: l_comp_plan_rec.allow_rev_class_overlap,
1903: p_org_id,'PLAN',null,null,l_unique_name,
1904: x_return_status,x_msg_count,
1905: x_msg_data);
1906:
1907: IF (x_return_status <> fnd_api.g_ret_sts_success)
1908: THEN
1909: RAISE fnd_api.g_exc_error;
1910: END IF;
1911:
1905: x_msg_data);
1906:
1907: IF (x_return_status <> fnd_api.g_ret_sts_success)
1908: THEN
1909: RAISE fnd_api.g_exc_error;
1910: END IF;
1911:
1912: l_comp_plan_rec.name := l_unique_name;
1913:
1910: END IF;
1911:
1912: l_comp_plan_rec.name := l_unique_name;
1913:
1914: create_comp_plan(p_api_version,FND_API.G_FALSE,
1915: FND_API.G_FALSE,p_validation_level,
1916: l_comp_plan_rec,x_comp_plan_id,x_return_status,
1917: x_msg_count,x_msg_data);
1918:
1911:
1912: l_comp_plan_rec.name := l_unique_name;
1913:
1914: create_comp_plan(p_api_version,FND_API.G_FALSE,
1915: FND_API.G_FALSE,p_validation_level,
1916: l_comp_plan_rec,x_comp_plan_id,x_return_status,
1917: x_msg_count,x_msg_data);
1918:
1919: IF (x_return_status <> fnd_api.g_ret_sts_success)
1915: FND_API.G_FALSE,p_validation_level,
1916: l_comp_plan_rec,x_comp_plan_id,x_return_status,
1917: x_msg_count,x_msg_data);
1918:
1919: IF (x_return_status <> fnd_api.g_ret_sts_success)
1920: THEN
1921: RAISE fnd_api.g_exc_error;
1922: END IF;
1923:
1917: x_msg_count,x_msg_data);
1918:
1919: IF (x_return_status <> fnd_api.g_ret_sts_success)
1920: THEN
1921: RAISE fnd_api.g_exc_error;
1922: END IF;
1923:
1924: FOR j in get_quota_assign_data
1925: LOOP
1929: l_quota_assign_rec.org_id := j.org_id;
1930: l_quota_assign_rec.object_version_number := 1;
1931: l_quota_assign_rec.quota_sequence := j.quota_sequence;
1932:
1933: CN_QUOTA_ASSIGN_PVT.create_quota_assign(p_api_version,FND_API.G_FALSE,
1934: FND_API.G_FALSE,p_validation_level,
1935: l_quota_assign_rec,x_return_status,
1936: x_msg_count,x_msg_data);
1937:
1930: l_quota_assign_rec.object_version_number := 1;
1931: l_quota_assign_rec.quota_sequence := j.quota_sequence;
1932:
1933: CN_QUOTA_ASSIGN_PVT.create_quota_assign(p_api_version,FND_API.G_FALSE,
1934: FND_API.G_FALSE,p_validation_level,
1935: l_quota_assign_rec,x_return_status,
1936: x_msg_count,x_msg_data);
1937:
1938: IF (x_return_status <> fnd_api.g_ret_sts_success)
1934: FND_API.G_FALSE,p_validation_level,
1935: l_quota_assign_rec,x_return_status,
1936: x_msg_count,x_msg_data);
1937:
1938: IF (x_return_status <> fnd_api.g_ret_sts_success)
1939: THEN
1940: RAISE fnd_api.g_exc_error;
1941: END IF;
1942: END LOOP;
1936: x_msg_count,x_msg_data);
1937:
1938: IF (x_return_status <> fnd_api.g_ret_sts_success)
1939: THEN
1940: RAISE fnd_api.g_exc_error;
1941: END IF;
1942: END LOOP;
1943:
1944:
1944:
1945:
1946: -- Standard check of p_commit.
1947:
1948: IF FND_API.To_Boolean( p_commit ) THEN
1949: COMMIT WORK;
1950: END IF;
1951:
1952: -- Standard call to get message count and if count is 1, get message info.
1953:
1954: FND_MSG_PUB.Count_And_Get
1955: (p_count => x_msg_count ,
1956: p_data => x_msg_data ,
1957: p_encoded => FND_API.G_FALSE );
1958:
1959: EXCEPTION
1960:
1961: WHEN FND_API.G_EXC_ERROR THEN
1957: p_encoded => FND_API.G_FALSE );
1958:
1959: EXCEPTION
1960:
1961: WHEN FND_API.G_EXC_ERROR THEN
1962: ROLLBACK TO duplicate_comp_plan;
1963: x_return_status := FND_API.G_RET_STS_ERROR ;
1964: FND_MSG_PUB.count_and_get
1965: (p_count => x_msg_count ,
1959: EXCEPTION
1960:
1961: WHEN FND_API.G_EXC_ERROR THEN
1962: ROLLBACK TO duplicate_comp_plan;
1963: x_return_status := FND_API.G_RET_STS_ERROR ;
1964: FND_MSG_PUB.count_and_get
1965: (p_count => x_msg_count ,
1966: p_data => x_msg_data ,
1967: p_encoded => FND_API.G_FALSE );
1963: x_return_status := FND_API.G_RET_STS_ERROR ;
1964: FND_MSG_PUB.count_and_get
1965: (p_count => x_msg_count ,
1966: p_data => x_msg_data ,
1967: p_encoded => FND_API.G_FALSE );
1968:
1969: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1970: ROLLBACK TO duplicate_comp_plan;
1971: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1965: (p_count => x_msg_count ,
1966: p_data => x_msg_data ,
1967: p_encoded => FND_API.G_FALSE );
1968:
1969: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1970: ROLLBACK TO duplicate_comp_plan;
1971: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1972: FND_MSG_PUB.count_and_get
1973: (p_count => x_msg_count ,
1967: p_encoded => FND_API.G_FALSE );
1968:
1969: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1970: ROLLBACK TO duplicate_comp_plan;
1971: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1972: FND_MSG_PUB.count_and_get
1973: (p_count => x_msg_count ,
1974: p_data => x_msg_data ,
1975: p_encoded => FND_API.G_FALSE );
1971: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1972: FND_MSG_PUB.count_and_get
1973: (p_count => x_msg_count ,
1974: p_data => x_msg_data ,
1975: p_encoded => FND_API.G_FALSE );
1976:
1977: WHEN OTHERS THEN
1978: ROLLBACK TO duplicate_comp_plan;
1979: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1975: p_encoded => FND_API.G_FALSE );
1976:
1977: WHEN OTHERS THEN
1978: ROLLBACK TO duplicate_comp_plan;
1979: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1980: IF FND_MSG_PUB.check_msg_level
1981: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1982: THEN
1983: FND_MSG_PUB.add_exc_msg
1987:
1988: FND_MSG_PUB.count_and_get
1989: (p_count => x_msg_count ,
1990: p_data => x_msg_data ,
1991: p_encoded => FND_API.G_FALSE );
1992:
1993: END duplicate_comp_plan;
1994:
1995: