DBA Data[Home] [Help]

APPS.EAM_METER_READINGS_JSP dependencies on FND_API

Line 169: l_return_status := FND_API.G_RET_STS_SUCCESS;

165: BEGIN
166: l_current_reading := null;
167: l_current_ltd_reading := null;
168:
169: l_return_status := FND_API.G_RET_STS_SUCCESS;
170:
171: -- get current reading and life to date reading
172: if(nvl(p_reset_flag, 'N') = 'Y') then
173: -- reset

Line 178: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

174: if( p_reading is null or p_reading_change is not null) then
175: -- reset only need reading field
176: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_RESET_FIELDS'
177: ,p_token1 => 'METER_NAME', p_value1 => p_meter_name);
178: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
179: -- can reset to anything
180: /* elsif( (nvl(p_meter_direction, 0) < 1 or nvl(p_meter_direction, 0) > 2) ) then
181: -- or
182: -- (nvl(p_meter_direction, 0) = 1 and p_reading > nvl(p_before_reading, 0)) or

Line 186: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR; */

182: -- (nvl(p_meter_direction, 0) = 1 and p_reading > nvl(p_before_reading, 0)) or
183: -- (nvl(p_meter_direction, 0) = 2 and p_reading < nvl(p_before_reading, 0)) ) then
184: -- why bother?
185: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WRR_RESET_WHY');
186: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR; */
187: else
188: -- done!
189: l_current_reading := p_reading;
190: l_current_ltd_reading := p_before_ltd_reading; -- don't reset ltd

Line 206: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

202: if(p_reading is not null and p_reading_change is not null and
203: p_reading - nvl(p_before_reading, 0) <> p_reading_change) then
204: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_DATA_CONFLICT'
205: ,p_token1 => 'METER_NAME', p_value1 => p_meter_name);
206: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
207: end if;
208:
209: -- no problem?
210: if( l_return_status = FND_API.G_RET_STS_SUCCESS) then

Line 210: if( l_return_status = FND_API.G_RET_STS_SUCCESS) then

206: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
207: end if;
208:
209: -- no problem?
210: if( l_return_status = FND_API.G_RET_STS_SUCCESS) then
211: -- check ltd changes?
212: l_change := l_current_ltd_reading - nvl(p_before_ltd_reading, 0);
213: l_ltd_change_before := 0;
214: if( p_before_ltd_reading is not null) then

Line 272: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

268: ,p_token2 => 'TO', p_value2 => l_range_to
269: ,p_token3 => 'METER_NAME', p_value3 => p_meter_name
270: );
271: end if;
272: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
273: end if;
274:
275: end if;
276: end if;

Line 314: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

310: where wip_entity_id = p_wip_entity_id;
311:
312: if( SQL%NOTFOUND) then -- wip_entity_id not found, should not happen.
313: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_NOT_FOUND');
314: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
315: elsif (l_org_id is null or l_asset_number is null or l_asset_group_id is null) then
316: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_DATA_NULL');
317: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
318: elsif ( nvl(p_org_id, l_org_id) <> l_org_id or

Line 317: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

313: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_NOT_FOUND');
314: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
315: elsif (l_org_id is null or l_asset_number is null or l_asset_group_id is null) then
316: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_DATA_NULL');
317: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
318: elsif ( nvl(p_org_id, l_org_id) <> l_org_id or
319: nvl(p_asset_number, l_asset_number)<> l_asset_number or
320: nvl(p_asset_group_id, l_asset_group_id) <> l_asset_group_id ) then
321: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_DATA_NULL');

Line 322: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

318: elsif ( nvl(p_org_id, l_org_id) <> l_org_id or
319: nvl(p_asset_number, l_asset_number)<> l_asset_number or
320: nvl(p_asset_group_id, l_asset_group_id) <> l_asset_group_id ) then
321: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_DATA_NULL');
322: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
323: end if;
324: null;
325: elsif (p_org_id is null or p_asset_number is null or p_asset_group_id is null) then
326: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_MRR_DATA_MISS');

Line 327: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

323: end if;
324: null;
325: elsif (p_org_id is null or p_asset_number is null or p_asset_group_id is null) then
326: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_WO_MRR_DATA_MISS');
327: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
328: end if;
329:
330: EXCEPTION WHEN OTHERS THEN
331: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.CHECK_ASSET_METER_ASSOCIATION',

Line 333: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

329:
330: EXCEPTION WHEN OTHERS THEN
331: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.CHECK_ASSET_METER_ASSOCIATION',
332: p_procedure_name => EAM_DEBUG.G_err_stack);
333: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
334: END check_asset_meter_association;
335:
336: --------------------------------------------------------------------------------------
337: -- get the reading that is just before/after the current reading date

Line 342: p_before IN VARCHAR2 := FND_API.G_TRUE

338: -- we need to know the previous reading data and next reading data to do validation
339: --------------------------------------------------------------------------------------
340: procedure get_adjacent_reading
341: (
342: p_before IN VARCHAR2 := FND_API.G_TRUE
343: ,p_meter_id IN NUMBER
344: ,p_reading_date IN DATE
345: ,x_reading_id OUT NOCOPY NUMBER
346: ,x_reading_date OUT NOCOPY DATE

Line 363: if( FND_API.TO_BOOLEAN(p_before)) then

359: l_reading_id := null;
360: l_reading := null;
361: l_ltd_reading := null;
362:
363: if( FND_API.TO_BOOLEAN(p_before)) then
364: select max(current_reading_date)
365: into l_reading_date
366: from eam_meter_readings
367: where meter_id = p_meter_id and

Line 411: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE

407: -- record a meter reading data
408: ------------------------------------------------------------------------------------
409: procedure add_meter_reading
410: ( p_api_version IN NUMBER := 1.0
411: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
412: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
413: ,p_validate_only IN VARCHAR2 := FND_API.G_TRUE
414: ,p_record_version_number IN NUMBER := NULL
415: ,x_return_status OUT NOCOPY VARCHAR2

Line 412: ,p_commit IN VARCHAR2 := FND_API.G_FALSE

408: ------------------------------------------------------------------------------------
409: procedure add_meter_reading
410: ( p_api_version IN NUMBER := 1.0
411: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
412: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
413: ,p_validate_only IN VARCHAR2 := FND_API.G_TRUE
414: ,p_record_version_number IN NUMBER := NULL
415: ,x_return_status OUT NOCOPY VARCHAR2
416: ,x_msg_count OUT NOCOPY NUMBER

Line 413: ,p_validate_only IN VARCHAR2 := FND_API.G_TRUE

409: procedure add_meter_reading
410: ( p_api_version IN NUMBER := 1.0
411: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
412: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
413: ,p_validate_only IN VARCHAR2 := FND_API.G_TRUE
414: ,p_record_version_number IN NUMBER := NULL
415: ,x_return_status OUT NOCOPY VARCHAR2
416: ,x_msg_count OUT NOCOPY NUMBER
417: ,x_msg_data OUT NOCOPY VARCHAR2

Line 459: IF p_commit = FND_API.G_TRUE THEN

455: l_after_ltd_reading NUMBER;
456:
457: BEGIN
458:
459: IF p_commit = FND_API.G_TRUE THEN
460: SAVEPOINT add_meter_reaing;
461: END IF;
462:
463: eam_debug.init_err_stack('eam_execution_jsp.add_meter_reading');

Line 465: IF NOT FND_API.COMPATIBLE_API_CALL(l_api_version,

461: END IF;
462:
463: eam_debug.init_err_stack('eam_execution_jsp.add_meter_reading');
464:
465: IF NOT FND_API.COMPATIBLE_API_CALL(l_api_version,
466: p_api_version,
467: l_api_name,
468: g_pkg_name)
469: THEN

Line 470: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

466: p_api_version,
467: l_api_name,
468: g_pkg_name)
469: THEN
470: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
471: END IF;
472:
473: IF FND_API.TO_BOOLEAN(p_init_msg_list)
474: THEN

Line 473: IF FND_API.TO_BOOLEAN(p_init_msg_list)

469: THEN
470: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
471: END IF;
472:
473: IF FND_API.TO_BOOLEAN(p_init_msg_list)
474: THEN
475: FND_MSG_PUB.initialize;
476: END IF;
477:

Line 478: x_return_status := FND_API.G_RET_STS_SUCCESS;

474: THEN
475: FND_MSG_PUB.initialize;
476: END IF;
477:
478: x_return_status := FND_API.G_RET_STS_SUCCESS;
479:
480: -- validation logic goes here (mostly)
481:
482: BEGIN

Line 492: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

488:
489: EXCEPTION WHEN OTHERS THEN
490: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_NOT_FOUND'
491: ,p_token1 => 'METER_ID', p_value1 => l_meter_name);
492: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
493: END;
494:
495: -- value check
496: if(p_reading is null and p_reading_change is null) then

Line 499: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

495: -- value check
496: if(p_reading is null and p_reading_change is null) then
497: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_FIELD_REQUIRED'
498: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);
499: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
500: end if;
501:
502: IF(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
503:

Line 502: IF(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN

498: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);
499: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
500: end if;
501:
502: IF(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
503:
504: if (p_reading_date is null) then
505: -- no reading date
506: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_DATE_NULL'

Line 508: x_return_status := FND_API.G_RET_STS_ERROR;

504: if (p_reading_date is null) then
505: -- no reading date
506: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_DATE_NULL'
507: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);
508: x_return_status := FND_API.G_RET_STS_ERROR;
509: elsif (p_reading_date > sysdate) then
510: -- futhure reading
511: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_DATE_BEYOND'
512: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);

Line 513: x_return_status := FND_API.G_RET_STS_ERROR;

509: elsif (p_reading_date > sysdate) then
510: -- futhure reading
511: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_DATE_BEYOND'
512: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);
513: x_return_status := FND_API.G_RET_STS_ERROR;
514: elsif ( p_reading_date < nvl(l_effective_date_from, p_reading_date -1)
515: or p_reading_date > nvl(l_effective_date_to, sysdate) ) then
516: -- not in the meter's effective date range
517: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_EXPIRED'

Line 519: x_return_status := FND_API.G_RET_STS_ERROR;

515: or p_reading_date > nvl(l_effective_date_to, sysdate) ) then
516: -- not in the meter's effective date range
517: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_EXPIRED'
518: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);
519: x_return_status := FND_API.G_RET_STS_ERROR;
520: else -- check reading
521:
522: get_adjacent_reading(
523: p_before => FND_API.G_TRUE,

Line 523: p_before => FND_API.G_TRUE,

519: x_return_status := FND_API.G_RET_STS_ERROR;
520: else -- check reading
521:
522: get_adjacent_reading(
523: p_before => FND_API.G_TRUE,
524: p_meter_id => p_meter_id,
525: p_reading_date => p_reading_date,
526: x_reading_id => l_before_reading_id,
527: x_reading_date => l_before_reading_date,

Line 532: p_before => FND_API.G_FALSE,

528: x_reading => l_before_reading,
529: x_ltd_reading => l_before_ltd_reading);
530:
531: get_adjacent_reading(
532: p_before => FND_API.G_FALSE,
533: p_meter_id => p_meter_id,
534: p_reading_date => p_reading_date,
535: x_reading_id => l_after_reading_id,
536: x_reading_date => l_after_reading_date,

Line 544: x_return_status := FND_API.G_RET_STS_ERROR;

540: if( l_before_reading_date = p_reading_date ) then
541: -- reading at this time already exists
542: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_DATE_EXIST'
543: ,p_token1 => 'METER_NAME', p_value1 => l_meter_name);
544: x_return_status := FND_API.G_RET_STS_ERROR;
545: else
546: eam_meter_readings_jsp.get_current_reading_data(
547: p_reading => p_reading,
548: p_reading_change => p_reading_change,

Line 562: END IF; -- if(x_return_status = fnd_api.g_ret_success)

558: x_current_ltd_reading => l_ltd_reading,
559: p_mtr_warning_shown => p_mtr_warning_shown);
560: end if;
561: end if;
562: END IF; -- if(x_return_status = fnd_api.g_ret_success)
563:
564: -- if validate not passed then raise error
565: l_msg_count := FND_MSG_PUB.count_msg;
566: IF l_msg_count = 1 THEN

Line 568: (p_encoded => FND_API.G_FALSE,

564: -- if validate not passed then raise error
565: l_msg_count := FND_MSG_PUB.count_msg;
566: IF l_msg_count = 1 THEN
567: eam_execution_jsp.Get_Messages
568: (p_encoded => FND_API.G_FALSE,
569: p_msg_index => 1,
570: p_msg_count => l_msg_count,
571: p_msg_data => nvl(l_msg_data,FND_API.g_MISS_CHAR),
572: p_data => l_data,

Line 571: p_msg_data => nvl(l_msg_data,FND_API.g_MISS_CHAR),

567: eam_execution_jsp.Get_Messages
568: (p_encoded => FND_API.G_FALSE,
569: p_msg_index => 1,
570: p_msg_count => l_msg_count,
571: p_msg_data => nvl(l_msg_data,FND_API.g_MISS_CHAR),
572: p_data => l_data,
573: p_msg_index_out => l_msg_index_out);
574: x_msg_count := l_msg_count;
575: x_msg_data := l_msg_data;

Line 581: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

577: x_msg_count := l_msg_count;
578: END IF;
579:
580: IF l_msg_count > 0 THEN
581: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
582: RAISE FND_API.G_EXC_ERROR;
583: END IF;
584:
585: -- otherwise, ready to make the changes

Line 582: RAISE FND_API.G_EXC_ERROR;

578: END IF;
579:
580: IF l_msg_count > 0 THEN
581: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
582: RAISE FND_API.G_EXC_ERROR;
583: END IF;
584:
585: -- otherwise, ready to make the changes
586: -- Fields: p_meter_id, l_reading, l_ltd_reading, p_reset_flag, l_reading_date,

Line 599: IF FND_API.TO_BOOLEAN(P_COMMIT) THEN

595: ,p_wip_entity_id => p_wip_entity_id
596: ,p_description => null
597: );
598:
599: IF FND_API.TO_BOOLEAN(P_COMMIT) THEN
600: COMMIT WORK;
601: END IF;
602:
603: EXCEPTION WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN

Line 603: EXCEPTION WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN

599: IF FND_API.TO_BOOLEAN(P_COMMIT) THEN
600: COMMIT WORK;
601: END IF;
602:
603: EXCEPTION WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
604: IF p_commit = FND_API.G_TRUE THEN
605: ROLLBACK TO add_meter_reading;
606: END IF;
607:

Line 604: IF p_commit = FND_API.G_TRUE THEN

600: COMMIT WORK;
601: END IF;
602:
603: EXCEPTION WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
604: IF p_commit = FND_API.G_TRUE THEN
605: ROLLBACK TO add_meter_reading;
606: END IF;
607:
608: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',

Line 610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

606: END IF;
607:
608: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',
609: p_procedure_name => EAM_DEBUG.G_err_stack);
610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
611: WHEN FND_API.G_EXC_ERROR THEN
612: IF p_commit = FND_API.G_TRUE THEN
613: ROLLBACK TO add_meter_reading;
614: END IF;

Line 611: WHEN FND_API.G_EXC_ERROR THEN

607:
608: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',
609: p_procedure_name => EAM_DEBUG.G_err_stack);
610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
611: WHEN FND_API.G_EXC_ERROR THEN
612: IF p_commit = FND_API.G_TRUE THEN
613: ROLLBACK TO add_meter_reading;
614: END IF;
615:

Line 612: IF p_commit = FND_API.G_TRUE THEN

608: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',
609: p_procedure_name => EAM_DEBUG.G_err_stack);
610: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
611: WHEN FND_API.G_EXC_ERROR THEN
612: IF p_commit = FND_API.G_TRUE THEN
613: ROLLBACK TO add_meter_reading;
614: END IF;
615:
616: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',

Line 618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

614: END IF;
615:
616: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',
617: p_procedure_name => EAM_DEBUG.G_err_stack);
618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
619: WHEN OTHERS THEN
620: IF p_commit = FND_API.G_TRUE THEN
621: ROLLBACK TO add_meter_reading;
622: END IF;

Line 620: IF p_commit = FND_API.G_TRUE THEN

616: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',
617: p_procedure_name => EAM_DEBUG.G_err_stack);
618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
619: WHEN OTHERS THEN
620: IF p_commit = FND_API.G_TRUE THEN
621: ROLLBACK TO add_meter_reading;
622: END IF;
623:
624: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'EAM_EXECUTION_JSP.ADD_METER_READING',

Line 629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

625: p_procedure_name => EAM_DEBUG.G_err_stack);
626:
627: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MRR_EXCEPTION'
628: ,p_token1 => 'MESSAGE', p_value1 => SQLERRM);
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630:
631: END add_meter_reading;
632:
633: end EAM_METER_READINGS_JSP;