266: if NVL(l_set_of_books_id,0) = 0 then
267: l_error_api_name := 'IMPORT_PREGEN_LINES';
268: fnd_message.set_name('PSP','PSP_PI_NO_PROFILE_FOR_SOB');
269: fnd_msg_pub.add;
270: raise FND_API.G_EXC_UNEXPECTED_ERROR;
271: end if;
272:
273: -- Commented for bug 9857299
274: /*
319: IF (l_currency_count > 1) THEN
320: fnd_message.set_name('PSP', 'PSP_PI_INVALID_CURRENCY');
321: fnd_message.set_token('BATCH_NAME', p_batch_name);
322: fnd_msg_pub.add;
323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
324: END IF;
325:
326: OPEN currency_code_cur;
327: FETCH currency_code_cur INTO g_currency_code;
338:
339: /*************************************************************************************************
340: if g_auto_population ='Y' then
341: Autopop(errbuf, retcode, p_batch_name);
342: IF retcode != FND_API.G_RET_STS_SUCCESS THEN
343: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
344: END IF;
345: end if;
346:
339: /*************************************************************************************************
340: if g_auto_population ='Y' then
341: Autopop(errbuf, retcode, p_batch_name);
342: IF retcode != FND_API.G_RET_STS_SUCCESS THEN
343: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
344: END IF;
345: end if;
346:
347: Modified Procedure Call
360: X_Operating_Unit =>p_operating_unit,
361: X_Gms_Pa_Install => l_gms_pa_install,
362: X_Return_Status =>l_return_status);
363:
364: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
365: -- Included changes for bug fix 2094036, to commit autopop errors as part of inerface errors
366: l_batch_status := 1;
367: IF (l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
368: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
363:
364: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
365: -- Included changes for bug fix 2094036, to commit autopop errors as part of inerface errors
366: l_batch_status := 1;
367: IF (l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
368: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
369: END IF;
370: END IF;
371: end if;
364: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
365: -- Included changes for bug fix 2094036, to commit autopop errors as part of inerface errors
366: l_batch_status := 1;
367: IF (l_return_status = fnd_api.g_ret_sts_unexp_error) THEN
368: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
369: END IF;
370: END IF;
371: end if;
372:
394: if NVL(l_batch_name_count,0) > 0 then
395: fnd_message.set_name('PSP','PSP_PI_INVALID_BATCH_NAME');
396: fnd_message.set_token('PSP_BATCH_NAME',p_batch_name);
397: fnd_msg_pub.add;
398: raise FND_API.G_EXC_UNEXPECTED_ERROR;
399: end if;
400:
401: /* Bug 2007521: Optimization, Run this part only if autopop is OFF */
402: if nvl(g_pregen_autopop,'N') <> 'Y' then
416: X_set_of_books_id => p_set_of_books_id,
417: X_return_status => l_return_status,
418: X_return_code => l_return_code);
419: --dbms_output.PUT_LINE('................4');
420: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
421: l_batch_status := 1;
422: if l_return_code = 'OTHER' then
423: l_error_api_name := 'VALIDATE_PERSON_ID';
424: raise FND_API.G_EXC_UNEXPECTED_ERROR;
420: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
421: l_batch_status := 1;
422: if l_return_code = 'OTHER' then
423: l_error_api_name := 'VALIDATE_PERSON_ID';
424: raise FND_API.G_EXC_UNEXPECTED_ERROR;
425: else
426: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
427: X_error_code => l_return_code,
428: X_return_status => l_return_status);
425: else
426: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
427: X_error_code => l_return_code,
428: X_return_status => l_return_status);
429: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
430: raise FND_API.G_EXC_UNEXPECTED_ERROR;
431: end if;
432: end if;
433: else
426: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
427: X_error_code => l_return_code,
428: X_return_status => l_return_status);
429: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
430: raise FND_API.G_EXC_UNEXPECTED_ERROR;
431: end if;
432: end if;
433: else
434: Validate_Assignment_ID(X_Assignment_ID => g_pregen_rec.assignment_id,
438: X_business_group_id => p_business_group_id,
439: X_set_of_books_id => p_set_of_books_id);
440:
441: --dbms_output.PUT_LINE('................5');
442: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
443: l_batch_status := 1;
444: if l_return_code = 'OTHER' then
445: l_error_api_name := 'VALIDATE_ASSIGNMENT_ID';
446: raise FND_API.G_EXC_UNEXPECTED_ERROR;
442: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
443: l_batch_status := 1;
444: if l_return_code = 'OTHER' then
445: l_error_api_name := 'VALIDATE_ASSIGNMENT_ID';
446: raise FND_API.G_EXC_UNEXPECTED_ERROR;
447: else
448: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
449: X_error_code => l_return_code,
450: X_return_status => l_return_status);
447: else
448: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
449: X_error_code => l_return_code,
450: X_return_status => l_return_status);
451: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
452: raise FND_API.G_EXC_UNEXPECTED_ERROR;
453: end if;
454: end if;
455: else
448: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
449: X_error_code => l_return_code,
450: X_return_status => l_return_status);
451: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
452: raise FND_API.G_EXC_UNEXPECTED_ERROR;
453: end if;
454: end if;
455: else
456: Validate_Payroll_ID(X_Payroll_ID => g_pregen_rec.payroll_id,
461: X_business_group_id => p_business_group_id,
462: X_set_of_books_id => p_set_of_books_id);
463:
464: --dbms_output.PUT_LINE('................6');
465: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
466: l_batch_status := 1;
467: if l_return_code = 'OTHER' then
468: l_error_api_name := 'VALIDATE_PAYROLL_ID';
469: raise FND_API.G_EXC_UNEXPECTED_ERROR;
465: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
466: l_batch_status := 1;
467: if l_return_code = 'OTHER' then
468: l_error_api_name := 'VALIDATE_PAYROLL_ID';
469: raise FND_API.G_EXC_UNEXPECTED_ERROR;
470: else
471: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
472: X_error_code => l_return_code,
473: X_return_status => l_return_status);
470: else
471: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
472: X_error_code => l_return_code,
473: X_return_status => l_return_status);
474: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
475: raise FND_API.G_EXC_UNEXPECTED_ERROR;
476: end if;
477: end if;
478: else
471: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
472: X_error_code => l_return_code,
473: X_return_status => l_return_status);
474: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
475: raise FND_API.G_EXC_UNEXPECTED_ERROR;
476: end if;
477: end if;
478: else
479: Validate_Payroll_Period_ID(X_Payroll_ID => g_pregen_rec.payroll_id,
481: X_Effective_Date => g_pregen_rec.distribution_date,
482: X_return_status => l_return_status,
483: X_return_code => l_return_code);
484: --dbms_output.PUT_LINE('................7');
485: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
486: l_batch_status := 1;
487: if l_return_code = 'OTHER' then
488: l_error_api_name := 'VALIDATE_PAYROLL_PERIOD_ID';
489: raise FND_API.G_EXC_UNEXPECTED_ERROR;
485: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
486: l_batch_status := 1;
487: if l_return_code = 'OTHER' then
488: l_error_api_name := 'VALIDATE_PAYROLL_PERIOD_ID';
489: raise FND_API.G_EXC_UNEXPECTED_ERROR;
490: else
491: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
492: X_error_code => l_return_code,
493: X_return_status => l_return_status);
490: else
491: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
492: X_error_code => l_return_code,
493: X_return_status => l_return_status);
494: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
495: raise FND_API.G_EXC_UNEXPECTED_ERROR;
496: end if;
497: end if;
498: else
491: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
492: X_error_code => l_return_code,
493: X_return_status => l_return_status);
494: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
495: raise FND_API.G_EXC_UNEXPECTED_ERROR;
496: end if;
497: end if;
498: else
499: --For Bug fix 2985061 : adding the validation of DR_CR Flag
500: VALIDATE_DR_CR_FLAG ( X_DR_CR_FLAG => g_pregen_rec.dr_cr_flag,
501: X_return_status => l_return_status,
502: X_return_code => l_return_code);
503:
504: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
505: l_batch_status := 1;
506: IF l_return_code = 'OTHER' THEN
507: l_error_api_name := 'VALIDATE_DR_CR_FLAG';
508: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
504: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
505: l_batch_status := 1;
506: IF l_return_code = 'OTHER' THEN
507: l_error_api_name := 'VALIDATE_DR_CR_FLAG';
508: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
509: ELSE
510: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
511: X_error_code => l_return_code,
512: X_return_status => l_return_status);
509: ELSE
510: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
511: X_error_code => l_return_code,
512: X_return_status => l_return_status);
513: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
514: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
515: END IF;
516: END IF;
517: ELSE
510: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
511: X_error_code => l_return_code,
512: X_return_status => l_return_status);
513: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
514: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
515: END IF;
516: END IF;
517: ELSE
518: --End of Changes for Bug 2985061
519: Validate_Payroll_Source_Code(X_Payroll_Source_Code => g_pregen_rec.source_code,
520: X_return_status => l_return_status,
521: X_return_code => l_return_code);
522: --dbms_output.PUT_LINE('................8');
523: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
524: --dbms_output.PUT_LINE('Entered Failure................8');
525: l_batch_status := 1;
526: if l_return_code = 'OTHER' then
527: l_error_api_name := 'VALIDATE_PAYROLL_SOURCE_CODE';
524: --dbms_output.PUT_LINE('Entered Failure................8');
525: l_batch_status := 1;
526: if l_return_code = 'OTHER' then
527: l_error_api_name := 'VALIDATE_PAYROLL_SOURCE_CODE';
528: raise FND_API.G_EXC_UNEXPECTED_ERROR;
529: else
530: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
531: X_error_code => l_return_code,
532: X_return_status => l_return_status);
529: else
530: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
531: X_error_code => l_return_code,
532: X_return_status => l_return_status);
533: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
534: raise FND_API.G_EXC_UNEXPECTED_ERROR;
535: end if;
536: end if;
537: else
530: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
531: X_error_code => l_return_code,
532: X_return_status => l_return_status);
533: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
534: raise FND_API.G_EXC_UNEXPECTED_ERROR;
535: end if;
536: end if;
537: else
538: Validate_Element_Type_ID(X_Element_Type_ID => g_pregen_rec.element_type_id,
542: x_set_of_books_id => p_set_of_books_id,
543: X_return_status => l_return_status,
544: X_return_code => l_return_code);
545: --dbms_output.PUT_LINE('................9');
546: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
547: l_batch_status := 1;
548: if l_return_code = 'OTHER' then
549: l_error_api_name := 'VALIDATE_ELEMENT_TYPE_ID';
550: raise FND_API.G_EXC_UNEXPECTED_ERROR;
546: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
547: l_batch_status := 1;
548: if l_return_code = 'OTHER' then
549: l_error_api_name := 'VALIDATE_ELEMENT_TYPE_ID';
550: raise FND_API.G_EXC_UNEXPECTED_ERROR;
551: else
552: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
553: X_error_code => l_return_code,
554: X_return_status => l_return_status);
551: else
552: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
553: X_error_code => l_return_code,
554: X_return_status => l_return_status);
555: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
556: raise FND_API.G_EXC_UNEXPECTED_ERROR;
557: end if;
558: end if;
559: elsif g_pregen_rec.gl_code_combination_id IS NULL and
552: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
553: X_error_code => l_return_code,
554: X_return_status => l_return_status);
555: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
556: raise FND_API.G_EXC_UNEXPECTED_ERROR;
557: end if;
558: end if;
559: elsif g_pregen_rec.gl_code_combination_id IS NULL and
560: g_pregen_rec.project_id IS NULL then
562: l_return_code := 'NUL_GLP';
563: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
564: X_error_code => l_return_code,
565: X_return_status => l_return_status);
566: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
567: raise FND_API.G_EXC_UNEXPECTED_ERROR;
568: end if;
569: elsif g_pregen_rec.gl_code_combination_id IS NOT NULL and
570: g_pregen_rec.project_id IS NOT NULL then
563: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
564: X_error_code => l_return_code,
565: X_return_status => l_return_status);
566: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
567: raise FND_API.G_EXC_UNEXPECTED_ERROR;
568: end if;
569: elsif g_pregen_rec.gl_code_combination_id IS NOT NULL and
570: g_pregen_rec.project_id IS NOT NULL then
571: l_batch_status := 1;
572: l_return_code := 'NOT_GLP';
573: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
574: X_error_code => l_return_code,
575: X_return_status => l_return_status);
576: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
577: raise FND_API.G_EXC_UNEXPECTED_ERROR;
578: end if;
579: /* Bug fix 2985061 */
580: elsif g_pregen_rec.gl_code_combination_id IS NOT NULL then
573: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
574: X_error_code => l_return_code,
575: X_return_status => l_return_status);
576: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
577: raise FND_API.G_EXC_UNEXPECTED_ERROR;
578: end if;
579: /* Bug fix 2985061 */
580: elsif g_pregen_rec.gl_code_combination_id IS NOT NULL then
581: validate_gl_cc_id( x_code_combination_id => g_pregen_rec.gl_code_combination_id,
581: validate_gl_cc_id( x_code_combination_id => g_pregen_rec.gl_code_combination_id,
582: x_return_status => l_return_status,
583: x_return_code => l_return_code);
584:
585: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
586: l_batch_status := 1;
587: IF l_return_code = 'OTHER' THEN
588: l_error_api_name := 'VALIDATE_GL_CC_ID';
589: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
585: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
586: l_batch_status := 1;
587: IF l_return_code = 'OTHER' THEN
588: l_error_api_name := 'VALIDATE_GL_CC_ID';
589: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
590: ELSE
591: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
592: X_error_code => l_return_code,
593: X_return_status => l_return_status);
590: ELSE
591: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
592: X_error_code => l_return_code,
593: X_return_status => l_return_status);
594: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
595: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
596: END IF;
597: END IF;
598: END IF;
591: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
592: X_error_code => l_return_code,
593: X_return_status => l_return_status);
594: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
595: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
596: END IF;
597: END IF;
598: END IF;
599:
601: -- elsif NVL(g_pregen_rec.project_id,0) <> 0 then
602: /****** Check for projects is installed or not ***************/
603: if l_gms_pa_install ='NO_PA_GMS' then
604: l_batch_status:=1;
605: l_return_status:= FND_API.G_RET_STS_ERROR;
606: l_return_code:='NO_PA';
607: update_record_with_error(
608: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
609: X_error_code => l_return_code,
607: update_record_with_error(
608: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
609: X_error_code => l_return_code,
610: X_return_status => l_return_status);
611: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
612: raise FND_API.G_EXC_UNEXPECTED_ERROR;
613: end if;
614: else
615: Validate_Project_details(X_Project_ID => g_pregen_rec.project_id,
608: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
609: X_error_code => l_return_code,
610: X_return_status => l_return_status);
611: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
612: raise FND_API.G_EXC_UNEXPECTED_ERROR;
613: end if;
614: else
615: Validate_Project_details(X_Project_ID => g_pregen_rec.project_id,
616: X_task_id => g_pregen_rec.task_id,
625: --dbms_output.PUT_LINE('................10');
626: --dbms_output.PUT_LINE('return status.....' || l_return_status);
627: --dbms_output.PUT_LINE('return code.....' || l_return_code);
628: end if;
629: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
630: -- l_batch_status := 1;
631: if l_return_code = 'OTHER' then
632: l_batch_status := 1; /* 2007521 */
633: l_error_api_name := 'VALIDATE_PROJECTS_DETAILS';
630: -- l_batch_status := 1;
631: if l_return_code = 'OTHER' then
632: l_batch_status := 1; /* 2007521 */
633: l_error_api_name := 'VALIDATE_PROJECTS_DETAILS';
634: raise FND_API.G_EXC_UNEXPECTED_ERROR;
635: else
636: if g_use_pre_gen_suspense = 'Y' then
637: stick_suspense_account( g_pregen_rec.assignment_id,
638: g_pregen_rec.distribution_date,
642: l_return_code,
643: p_business_group_id,
644: p_set_of_books_id,
645: l_return_status);
646: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
647: raise FND_API.G_EXC_UNEXPECTED_ERROR;
648: end if;
649: /* Bug 2007521: moved code into stick suspense a/c
650: update_record_with_valid(X_distribution_interface_id=>
643: p_business_group_id,
644: p_set_of_books_id,
645: l_return_status);
646: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
647: raise FND_API.G_EXC_UNEXPECTED_ERROR;
648: end if;
649: /* Bug 2007521: moved code into stick suspense a/c
650: update_record_with_valid(X_distribution_interface_id=>
651: g_pregen_rec.distribution_interface_id,
649: /* Bug 2007521: moved code into stick suspense a/c
650: update_record_with_valid(X_distribution_interface_id=>
651: g_pregen_rec.distribution_interface_id,
652: X_return_status => l_return_status);
653: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
654: raise FND_API.G_EXC_UNEXPECTED_ERROR;
655: end if; */
656: else
657: l_batch_status := 1;
650: update_record_with_valid(X_distribution_interface_id=>
651: g_pregen_rec.distribution_interface_id,
652: X_return_status => l_return_status);
653: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
654: raise FND_API.G_EXC_UNEXPECTED_ERROR;
655: end if; */
656: else
657: l_batch_status := 1;
658: update_record_with_error(X_distribution_interface_id=>
658: update_record_with_error(X_distribution_interface_id=>
659: g_pregen_rec.distribution_interface_id,
660: X_error_code => l_return_code,
661: X_return_status => l_return_status);
662: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
663: raise FND_API.G_EXC_UNEXPECTED_ERROR;
664: end if;
665: end if;
666: end if;
659: g_pregen_rec.distribution_interface_id,
660: X_error_code => l_return_code,
661: X_return_status => l_return_status);
662: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
663: raise FND_API.G_EXC_UNEXPECTED_ERROR;
664: end if;
665: end if;
666: end if;
667: else
668: ----dbms_output.put_line ('Update record with valid');
669: l_return_code := 0;
670: update_record_with_valid(X_distribution_interface_id=> g_pregen_rec.distribution_interface_id,
671: X_return_status => l_return_status);
672: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
673: raise FND_API.G_EXC_UNEXPECTED_ERROR;
674: end if;
675: end if;
676: else
669: l_return_code := 0;
670: update_record_with_valid(X_distribution_interface_id=> g_pregen_rec.distribution_interface_id,
671: X_return_status => l_return_status);
672: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
673: raise FND_API.G_EXC_UNEXPECTED_ERROR;
674: end if;
675: end if;
676: else
677: ----dbms_output.put_line ('Update record with valid');
677: ----dbms_output.put_line ('Update record with valid');
678: l_return_code := 0;
679: update_record_with_valid(X_distribution_interface_id=> g_pregen_rec.distribution_interface_id,
680: X_return_status => l_return_status);
681: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
682: raise FND_API.G_EXC_UNEXPECTED_ERROR;
683: end if;
684: end if;
685: end if;
678: l_return_code := 0;
679: update_record_with_valid(X_distribution_interface_id=> g_pregen_rec.distribution_interface_id,
680: X_return_status => l_return_status);
681: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
682: raise FND_API.G_EXC_UNEXPECTED_ERROR;
683: end if;
684: end if;
685: end if;
686: end if;
707: fnd_msg_pub.add;
708: -- This comment was added by Chandra to commit records
709: -- in the PSP_DISTRIBUTION_INTERFACE table with the status
710: commit; -- Added by Chandra
711: raise FND_API.G_EXC_UNEXPECTED_ERROR;
712: end if;
713: --For Bug 2096440 : Moved the END IF above , the check for l_batch_status=1 has to be applicable for autopop 'Y' as well as 'N'
714: -- end if; /* Bug 2007521: Optimization */
715: --
811: T.time_period_id = a.time_period_id and
812: susp.organization_account_id(+) = a.suspense_org_account_id;
813: if sql%NOTFOUND then
814: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Error while inserting data');
815: raise FND_API.G_EXC_UNEXPECTED_ERROR;
816: end if;
817: --dbms_output.PUT_LINE('...Crossed First Insert ' );
818: --dbms_output.PUT_LINE('...L_gl_count ' || to_char(l_gl_count) );
819: --dbms_output.PUT_LINE('...L_project_count ' || to_char(l_project_count) );
825: WHERE batch_name = p_batch_name;
826: --dbms_output.PUT_LINE('...Crossed Update ' );
827: if sql%NOTFOUND then
828: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Error while Updating Transfer status ');
829: raise FND_API.G_EXC_UNEXPECTED_ERROR;
830: end if;
831:
832: -- Total up all records by source_code, time_period_id to write into payroll_control table
833:
903: x_currency_code => g_currency_code,
904: x_exchange_rate_type => l_exchange_rate_type);
905: if sql%NOTFOUND then
906: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Error while inserting data in Payroll Controls');
907: raise FND_API.G_EXC_UNEXPECTED_ERROR;
908: end if;
909: --dbms_output.PUT_LINE('...Before Updating control_id in pre gen ' );
910: UPDATE psp_pre_gen_dist_lines
911: SET payroll_control_id = l_control_id
916: set_of_books_id= l_set_of_books_id and
917: business_group_id = p_business_group_id;
918: if sql%NOTFOUND then
919: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Error while updating control_id in pre-gen-dist-lines ');
920: raise FND_API.G_EXC_UNEXPECTED_ERROR;
921: end if;
922:
923: l_ft_source_code := g_for_total_rec.source_code;
924: l_ft_time_period_id := g_for_total_rec.time_period_id;
991: x_exchange_rate_type => l_exchange_rate_type);
992:
993: if sql%NOTFOUND then
994: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Error while inserting data in Payroll Controls');
995: raise FND_API.G_EXC_UNEXPECTED_ERROR;
996: end if;
997: --dbms_output.PUT_LINE('...Before Updating control_id in pre gen ' );
998: UPDATE psp_pre_gen_dist_lines
999: SET payroll_control_id = l_control_id
1004: set_of_books_id= l_set_of_books_id and
1005: business_group_id = p_business_group_id;
1006: if sql%NOTFOUND then
1007: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Error while updating control_id in pre-gen-dist-lines ');
1008: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1009: end if;
1010: close get_for_total_csr;
1011: end if;
1012: errbuf := l_subline_message;
1033: fnd_message.set_name('PSP','PSP_PROGRAM_SUCCESS') ;
1034: fnd_msg_pub.add;
1035:
1036: psp_message_s.print_error(p_mode=>FND_FILE.log,
1037: p_print_header=>FND_API.G_FALSE);
1038: PSP_MESSAGE_S.Print_Success;
1039: return;
1040:
1041: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1037: p_print_header=>FND_API.G_FALSE);
1038: PSP_MESSAGE_S.Print_Success;
1039: return;
1040:
1041: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1042: ----dbms_output.put_line('Unexpected Error...........');
1043: /*
1044: fnd_msg_pub.get(p_msg_index => FND_MSG_PUB.G_FIRST,
1045: p_encoded => FND_API.G_FALSE,
1041: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1042: ----dbms_output.put_line('Unexpected Error...........');
1043: /*
1044: fnd_msg_pub.get(p_msg_index => FND_MSG_PUB.G_FIRST,
1045: p_encoded => FND_API.G_FALSE,
1046: p_data => l_msg_data,
1047: p_msg_index_out => l_msg_count);
1048:
1049: */
1050: errbuf := l_error_api_name || fnd_global.local_chr(10) || l_msg_data || fnd_global.local_chr(10);
1051: retcode := 2;
1052: rollback;
1053: psp_message_s.print_error(p_mode => FND_FILE.LOG,
1054: p_print_header => FND_API.G_TRUE);
1055: return;
1056: WHEN OTHERS then
1057: ----dbms_output.put_line('When others Error...........');
1058: /*
1056: WHEN OTHERS then
1057: ----dbms_output.put_line('When others Error...........');
1058: /*
1059: fnd_msg_pub.get(p_msg_index => FND_MSG_PUB.G_FIRST,
1060: p_encoded => FND_API.G_FALSE,
1061: p_data => l_msg_data,
1062: p_msg_index_out => l_msg_count);
1063:
1064: */
1065: errbuf := l_error_api_name || fnd_global.local_chr(10) || l_msg_data || fnd_global.local_chr(10);
1066: rollback;
1067: retcode := 2;
1068: psp_message_s.print_error(p_mode => FND_FILE.LOG,
1069: p_print_header => FND_API.G_TRUE);
1070: return;
1071: END;
1072: --
1073:
1124: Begin
1125: open check_person_csr;
1126: fetch check_person_csr into l_person_id;
1127: if check_person_csr%NOTFOUND then
1128: x_return_status := FND_API.G_RET_STS_ERROR;
1129: x_return_code := 'INV_PER';
1130: close check_person_csr;
1131: return;
1132: else
1129: x_return_code := 'INV_PER';
1130: close check_person_csr;
1131: return;
1132: else
1133: x_return_status := FND_API.G_RET_STS_SUCCESS;
1134: x_return_code := ' ';
1135: end If;
1136: close check_person_csr;
1137: Exception
1135: end If;
1136: close check_person_csr;
1137: Exception
1138: when no_data_found or too_many_rows then
1139: x_return_status := FND_API.G_RET_STS_ERROR;
1140: x_return_code := 'INV_PER';
1141: close check_person_csr;
1142: return;
1143: when OTHERS then
1141: close check_person_csr;
1142: return;
1143: when OTHERS then
1144: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Person_id : Unexpected Error');
1145: x_return_status := FND_API.G_RET_STS_ERROR;
1146: x_return_code := 'OTHER';
1147: close check_person_csr;
1148: End Validate_Person_ID;
1149:
1172: Begin
1173: open check_assg_csr;
1174: fetch check_assg_csr into l_assignment_id;
1175: if check_assg_csr%NOTFOUND then
1176: x_return_status := FND_API.G_RET_STS_ERROR;
1177: x_return_code := 'INV_ASG';
1178: close check_assg_csr;
1179: return;
1180: else
1177: x_return_code := 'INV_ASG';
1178: close check_assg_csr;
1179: return;
1180: else
1181: x_return_status := FND_API.G_RET_STS_SUCCESS;
1182: x_return_code := ' ';
1183: end If;
1184: close check_assg_csr;
1185:
1184: close check_assg_csr;
1185:
1186: Exception
1187: when no_data_found or too_many_rows then
1188: x_return_status := FND_API.G_RET_STS_ERROR;
1189: x_return_code := 'INV_ASG';
1190: close check_assg_csr;
1191: return;
1192: when OTHERS then
1190: close check_assg_csr;
1191: return;
1192: when OTHERS then
1193: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Assignment_id : Unexpected Error');
1194: x_return_status := FND_API.G_RET_STS_ERROR;
1195: x_return_code := 'OTHER';
1196: close check_assg_csr;
1197: End Validate_Assignment_ID;
1198:
1228: open check_payroll_csr;
1229: fetch check_payroll_csr into l_payroll_id;
1230: if check_payroll_csr%NOTFOUND then
1231: ----dbms_output.put_line('%NOTFOUND');
1232: x_return_status := FND_API.G_RET_STS_ERROR;
1233: x_return_code := 'INV_PID';
1234: close check_payroll_csr;
1235: return;
1236: else
1234: close check_payroll_csr;
1235: return;
1236: else
1237: ----dbms_output.put_line('%SUCCESS');
1238: x_return_status := FND_API.G_RET_STS_SUCCESS;
1239: x_return_code := ' ';
1240: end If;
1241: close check_payroll_csr;
1242: Exception
1241: close check_payroll_csr;
1242: Exception
1243: when no_data_found or too_many_rows then
1244: ----dbms_output.put_line('NO DATA FOUND');
1245: x_return_status := FND_API.G_RET_STS_ERROR;
1246: x_return_code := 'INV_PID';
1247: close check_payroll_csr;
1248: return;
1249: when OTHERS then
1248: return;
1249: when OTHERS then
1250: ----dbms_output.put_line('OTHERS ');
1251: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Payroll_id : Unexpected Error');
1252: x_return_status := FND_API.G_RET_STS_ERROR;
1253: x_return_code := 'OTHER';
1254: close check_payroll_csr;
1255: return;
1256: end;
1277: Begin
1278: open check_period_csr;
1279: fetch check_period_csr into l_period_id;
1280: if check_period_csr%NOTFOUND then
1281: x_return_status := FND_API.G_RET_STS_ERROR;
1282: x_return_code := 'INV_TPI';
1283: close check_period_csr;
1284: return;
1285: else
1282: x_return_code := 'INV_TPI';
1283: close check_period_csr;
1284: return;
1285: else
1286: x_return_status := FND_API.G_RET_STS_SUCCESS;
1287: x_return_code := ' ';
1288: end If;
1289: close check_period_csr;
1290: Exception
1288: end If;
1289: close check_period_csr;
1290: Exception
1291: when no_data_found or too_many_rows then
1292: x_return_status := FND_API.G_RET_STS_ERROR;
1293: x_return_code := 'INV_TPI';
1294: close check_period_csr;
1295: return;
1296: when OTHERS then
1294: close check_period_csr;
1295: return;
1296: when OTHERS then
1297: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Period_id : Unexpected Error');
1298: x_return_status := FND_API.G_RET_STS_ERROR;
1299: x_return_code := 'OTHER';
1300: close check_period_csr;
1301: return;
1302: End Validate_Payroll_Period_ID;
1316: open check_source_csr;
1317: fetch check_source_csr into l_lookup_code;
1318: if check_source_csr%NOTFOUND then
1319: --dbms_output.PUT_LINE('Enter NOTFOUND......8');
1320: x_return_status := FND_API.G_RET_STS_ERROR;
1321: x_return_code := 'INV_SRC';
1322: close check_source_csr;
1323: return;
1324: else
1322: close check_source_csr;
1323: return;
1324: else
1325: --dbms_output.PUT_LINE('Enter Success.....8');
1326: x_return_status := FND_API.G_RET_STS_SUCCESS;
1327: x_return_code := ' ';
1328: end If;
1329: close check_source_csr;
1330: Exception
1329: close check_source_csr;
1330: Exception
1331: when no_data_found or too_many_rows then
1332: --dbms_output.PUT_LINE('Enter Too_many_rows....8');
1333: x_return_status := FND_API.G_RET_STS_ERROR;
1334: x_return_code := 'INV_SRC';
1335: close check_source_csr;
1336: return;
1337: when OTHERS then
1336: return;
1337: when OTHERS then
1338: --dbms_output.PUT_LINE('Enter Too_many_rows....8');
1339: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Payroll_Source_Code : Unexpected Error');
1340: x_return_status := FND_API.G_RET_STS_ERROR;
1341: x_return_code := 'OTHER';
1342: close check_source_csr;
1343: return;
1344: End Validate_Payroll_Source_Code;
1380: Begin
1381: open check_element_csr;
1382: fetch check_element_csr into l_element_id;
1383: if check_element_csr%NOTFOUND then
1384: x_return_status := FND_API.G_RET_STS_ERROR;
1385: x_return_code := 'INV_ELE';
1386: close check_element_csr;
1387: return;
1388: else
1385: x_return_code := 'INV_ELE';
1386: close check_element_csr;
1387: return;
1388: else
1389: x_return_status := FND_API.G_RET_STS_SUCCESS;
1390: x_return_code := ' ';
1391: end If;
1392: close check_element_csr;
1393: Exception
1391: end If;
1392: close check_element_csr;
1393: Exception
1394: when no_data_found or too_many_rows then
1395: x_return_status := FND_API.G_RET_STS_ERROR;
1396: x_return_code := 'INV_ELE';
1397: close check_element_csr;
1398: return;
1399: when OTHERS then
1397: close check_element_csr;
1398: return;
1399: when OTHERS then
1400: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Element_Type_Id : Unexpected Error');
1401: x_return_status := FND_API.G_RET_STS_ERROR;
1402: x_return_code := 'OTHER';
1403: close check_element_csr;
1404: return;
1405: End Validate_Element_Type_ID;
1489:
1490: IF X_GMS_PA_INSTALL IN ('PA_ONLY','PA_GMS') THEN
1491: --- added if condition for 2985061
1492: if x_exp_org_id is null then
1493: x_return_status := FND_API.G_RET_STS_ERROR;
1494: x_return_code := 'NULL_EXP_ORG';
1495: return;
1496: else
1497: pa_transactions_pub.validate_transaction(
1517: ----dbms_output.put_line('x_project_id'|| x_project_id);
1518:
1519:
1520: if l_patc_status is not null then
1521: x_return_status := FND_API.G_RET_STS_ERROR;
1522: ----Commented for Bug 2096440 : Added the following line-
1523: ----Passing l_patc_status as the return code ,which will be passed to stick_suspense_account procedure
1524: ----as suspense_reason_code
1525: -- x_return_code := 'INV_PATC';
1533: /* Commented for bug 2054610
1534: open check_award_csr;
1535: fetch check_award_csr into l_project_id;
1536: if check_award_csr%NOTFOUND then
1537: x_return_status := FND_API.G_RET_STS_ERROR;
1538: x_return_code := 'INV_AI';
1539: close check_award_csr;
1540: return;
1541: else
1538: x_return_code := 'INV_AI';
1539: close check_award_csr;
1540: return;
1541: else
1542: x_return_status := FND_API.G_RET_STS_SUCCESS;
1543: x_return_code := ' ';
1544: end If;
1545: close check_award_csr; */
1546:
1554: 'PSPLDPGB',
1555: l_award_status);
1556:
1557: IF l_award_status IS NOT NULL THEN
1558: x_return_status := FND_API.G_RET_STS_ERROR;
1559: ----Commented for Bug 2096440 : Added the following line-
1560: ----Passing l_award_status as the return code ,which will be passed to stick_suspense_account procedure
1561: ----as suspense_reason_code
1562: --x_return_code := 'INV_PATCAW';
1567: END IF; --End if of PA_GMS , for Bug 2096440
1568: end if; ---2985061
1569: END IF; --For Bug 2096440
1570:
1571: x_return_status := FND_API.G_RET_STS_SUCCESS;
1572: x_return_code := ' ';
1573: /*******************************************************************************
1574: Commented For Bug 2096440
1575:
1576: l_control_num := 5;
1577: open check_exp_type_csr;
1578: fetch check_exp_type_csr into l_exp_type;
1579: if check_exp_type_csr%NOTFOUND then
1580: x_return_status := FND_API.G_RET_STS_ERROR;
1581: x_return_code := 'INV_ET';
1582: close check_exp_type_csr;
1583: return;
1584: else
1581: x_return_code := 'INV_ET';
1582: close check_exp_type_csr;
1583: return;
1584: else
1585: x_return_status := FND_API.G_RET_STS_SUCCESS;
1586: x_return_code := ' ';
1587: end If;
1588: END IF;
1589: IF X_GMS_PA_INSTALL = 'PA_ONLY' THEN
1590: l_control_num := 5;
1591: open check_exp_type_csr1;
1592: fetch check_exp_type_csr1 into l_exp_type;
1593: if check_exp_type_csr1%NOTFOUND then
1594: x_return_status := FND_API.G_RET_STS_ERROR;
1595: x_return_code := 'INV_ET';
1596: close check_exp_type_csr1;
1597: return;
1598: else
1595: x_return_code := 'INV_ET';
1596: close check_exp_type_csr1;
1597: return;
1598: else
1599: x_return_status := FND_API.G_RET_STS_SUCCESS;
1600: x_return_code := ' ';
1601: end If;
1602: EN IF;
1603: END IF;
1606:
1607: EXCEPTION
1608: when OTHERS then
1609: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Validate_Project_Details : Unexpected Error');
1610: x_return_status := FND_API.G_RET_STS_ERROR;
1611: x_return_code := 'OTHER';
1612: /*************************************************************************************
1613: Commenting for bug 2096440
1614: if l_control_num = 1 then
1640: error_code = x_error_code
1641: WHERE distribution_interface_id = x_distribution_interface_id;
1642:
1643: if SQL%NOTFOUND then
1644: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1645: end if;
1646: --dbms_output.PUT_LINE('.....Update Record With Error ');
1647: x_return_status := FND_API.G_RET_STS_SUCCESS;
1648: EXCEPTION
1643: if SQL%NOTFOUND then
1644: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1645: end if;
1646: --dbms_output.PUT_LINE('.....Update Record With Error ');
1647: x_return_status := FND_API.G_RET_STS_SUCCESS;
1648: EXCEPTION
1649: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1650: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Error while updating');
1651: x_return_status := FND_API.G_RET_STS_ERROR;
1645: end if;
1646: --dbms_output.PUT_LINE('.....Update Record With Error ');
1647: x_return_status := FND_API.G_RET_STS_SUCCESS;
1648: EXCEPTION
1649: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1650: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Error while updating');
1651: x_return_status := FND_API.G_RET_STS_ERROR;
1652: WHEN OTHERS then
1653: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Unexpected error');
1647: x_return_status := FND_API.G_RET_STS_SUCCESS;
1648: EXCEPTION
1649: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1650: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Error while updating');
1651: x_return_status := FND_API.G_RET_STS_ERROR;
1652: WHEN OTHERS then
1653: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Unexpected error');
1654: x_return_status := FND_API.G_RET_STS_ERROR;
1655:
1650: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Error while updating');
1651: x_return_status := FND_API.G_RET_STS_ERROR;
1652: WHEN OTHERS then
1653: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_error : Unexpected error');
1654: x_return_status := FND_API.G_RET_STS_ERROR;
1655:
1656: end;
1657: --
1658: ----------------------------------UPDATE_RECORD_WITH_VALID-----------------------------------
1666: error_code = NULL
1667: WHERE distribution_interface_id = x_distribution_interface_id;
1668:
1669: if SQL%NOTFOUND then
1670: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1671: end if;
1672:
1673: x_return_status := FND_API.G_RET_STS_SUCCESS;
1674: EXCEPTION
1669: if SQL%NOTFOUND then
1670: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1671: end if;
1672:
1673: x_return_status := FND_API.G_RET_STS_SUCCESS;
1674: EXCEPTION
1675: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1676: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Error while updating');
1677: x_return_status := FND_API.G_RET_STS_ERROR;
1671: end if;
1672:
1673: x_return_status := FND_API.G_RET_STS_SUCCESS;
1674: EXCEPTION
1675: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1676: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Error while updating');
1677: x_return_status := FND_API.G_RET_STS_ERROR;
1678: WHEN OTHERS then
1679: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Unexpected error');
1673: x_return_status := FND_API.G_RET_STS_SUCCESS;
1674: EXCEPTION
1675: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
1676: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Error while updating');
1677: x_return_status := FND_API.G_RET_STS_ERROR;
1678: WHEN OTHERS then
1679: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Unexpected error');
1680: x_return_status := FND_API.G_RET_STS_ERROR;
1681:
1676: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Error while updating');
1677: x_return_status := FND_API.G_RET_STS_ERROR;
1678: WHEN OTHERS then
1679: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_valid : Unexpected error');
1680: x_return_status := FND_API.G_RET_STS_ERROR;
1681:
1682: end;
1683: --
1684: Function get_least_date(x_time_period_id IN Number,x_person_id IN Number, x_gl_ccid IN Number,
1818: if NVL(l_batch_name_count,0) > 0 then
1819: fnd_message.set_name('PSP','PSP_PI_INVALID_BATCH_NAME');
1820: fnd_message.set_token('PSP_BATCH_NAME',x_batch_name);
1821: fnd_msg_pub.add;
1822: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1823: end if;
1824:
1825: open get_all_from_interface_csr;
1826: LOOP
1839: X_return_code => l_return_code,
1840: X_Business_group_Id => x_business_group_id
1841: );
1842: --dbms_output.PUT_LINE('................4');
1843: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1844: l_batch_status := 1;
1845: if l_return_code = 'OTHER' then
1846: l_error_api_name := 'VALIDATE_PERSON_ID';
1847: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1843: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1844: l_batch_status := 1;
1845: if l_return_code = 'OTHER' then
1846: l_error_api_name := 'VALIDATE_PERSON_ID';
1847: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1848: else
1849: update_record_with_error(
1850: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1851: X_error_code => l_return_code,
1849: update_record_with_error(
1850: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1851: X_error_code => l_return_code,
1852: X_return_status => x_return_status);
1853: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1854: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1855: end if;
1856: end if;
1857: else
1850: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1851: X_error_code => l_return_code,
1852: X_return_status => x_return_status);
1853: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1854: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1855: end if;
1856: end if;
1857: else
1858:
1862: X_Return_Code => l_return_code,
1863: X_Business_Group_Id =>x_business_group_id,
1864: X_Set_of_Books_Id => x_set_of_books_id);
1865: --dbms_output.PUT_LINE('................5');
1866: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1867: l_batch_status := 1;
1868: if l_return_code = 'OTHER' then
1869: l_error_api_name := 'VALIDATE_ASSIGNMENT_ID';
1870: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1866: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1867: l_batch_status := 1;
1868: if l_return_code = 'OTHER' then
1869: l_error_api_name := 'VALIDATE_ASSIGNMENT_ID';
1870: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1871: else
1872: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1873: X_error_code => l_return_code,
1874: X_return_status => x_return_status);
1871: else
1872: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1873: X_error_code => l_return_code,
1874: X_return_status => x_return_status);
1875: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1876: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1877: end if;
1878: end if;
1879:
1872: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1873: X_error_code => l_return_code,
1874: X_return_status => x_return_status);
1875: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1876: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1877: end if;
1878: end if;
1879:
1880: else
1887: X_return_code => l_return_code,
1888: X_business_group_id => x_business_group_id,
1889: X_set_of_books_id => x_set_of_books_id);
1890:
1891: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1892: l_batch_status := 1;
1893: IF l_return_code = 'OTHER' THEN
1894: l_error_api_name := 'VALIDATE_PAYROLL_ID';
1895: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1891: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1892: l_batch_status := 1;
1893: IF l_return_code = 'OTHER' THEN
1894: l_error_api_name := 'VALIDATE_PAYROLL_ID';
1895: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1896: ELSE
1897: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1898: X_error_code => l_return_code,
1899: X_return_status => x_return_status);
1896: ELSE
1897: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1898: X_error_code => l_return_code,
1899: X_return_status => x_return_status);
1900: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1901: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1902: END IF;
1903: END IF;
1904: ELSE
1897: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1898: X_error_code => l_return_code,
1899: X_return_status => x_return_status);
1900: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1901: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1902: END IF;
1903: END IF;
1904: ELSE
1905: --End of Changes for Bug 2616807
1908: X_Effective_Date => g_pregen_rec.distribution_date,
1909: X_return_status => x_return_status,
1910: X_return_code => l_return_code);
1911: --dbms_output.PUT_LINE('................7');
1912: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1913: l_batch_status := 1;
1914: if l_return_code = 'OTHER' then
1915: l_error_api_name := 'VALIDATE_PAYROLL_PERIOD_ID';
1916: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1912: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1913: l_batch_status := 1;
1914: if l_return_code = 'OTHER' then
1915: l_error_api_name := 'VALIDATE_PAYROLL_PERIOD_ID';
1916: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1917: else
1918: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1919: X_error_code => l_return_code,
1920: X_return_status => x_return_status);
1917: else
1918: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1919: X_error_code => l_return_code,
1920: X_return_status => x_return_status);
1921: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1922: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1923: end if;
1924: end if;
1925: else
1918: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1919: X_error_code => l_return_code,
1920: X_return_status => x_return_status);
1921: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1922: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1923: end if;
1924: end if;
1925: else
1926: --For Bug fix 2985061 : adding the validation of DR_CR Flag
1928: VALIDATE_DR_CR_FLAG ( X_DR_CR_FLAG => g_pregen_rec.dr_cr_flag,
1929: X_return_status => x_return_status,
1930: X_return_code => l_return_code);
1931:
1932: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1933: l_batch_status := 1;
1934: IF l_return_code = 'OTHER' THEN
1935: l_error_api_name := 'VALIDATE_DR_CR_FLAG';
1936: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1932: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1933: l_batch_status := 1;
1934: IF l_return_code = 'OTHER' THEN
1935: l_error_api_name := 'VALIDATE_DR_CR_FLAG';
1936: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1937: ELSE
1938: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1939: X_error_code => l_return_code,
1940: X_return_status => x_return_status);
1937: ELSE
1938: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1939: X_error_code => l_return_code,
1940: X_return_status => x_return_status);
1941: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1942: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1943: END IF;
1944: END IF;
1945: ELSE
1938: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1939: X_error_code => l_return_code,
1940: X_return_status => x_return_status);
1941: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1942: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1943: END IF;
1944: END IF;
1945: ELSE
1946: --End of Changes for Bug 2985061
1949: Validate_Payroll_Source_Code(X_Payroll_Source_Code => g_pregen_rec.source_code,
1950: X_return_status => x_return_status,
1951: X_return_code => l_return_code);
1952:
1953: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1954: l_batch_status := 1;
1955: IF l_return_code = 'OTHER' THEN
1956: l_error_api_name := 'VALIDATE_PAYROLL_SOURCE_CODE';
1957: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1953: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1954: l_batch_status := 1;
1955: IF l_return_code = 'OTHER' THEN
1956: l_error_api_name := 'VALIDATE_PAYROLL_SOURCE_CODE';
1957: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1958: ELSE
1959: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1960: X_error_code => l_return_code,
1961: X_return_status => x_return_status);
1958: ELSE
1959: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1960: X_error_code => l_return_code,
1961: X_return_status => x_return_status);
1962: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1963: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1964: END IF;
1965: END IF;
1966: ELSE
1959: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1960: X_error_code => l_return_code,
1961: X_return_status => x_return_status);
1962: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1963: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1964: END IF;
1965: END IF;
1966: ELSE
1967: --End of Changes for Bug 2616807
1972: x_set_of_books_id => x_set_of_books_id,
1973: X_return_status => x_return_status,
1974: X_return_code => l_return_code);
1975: --dbms_output.PUT_LINE('................9');
1976: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1977: l_batch_status := 1;
1978: if l_return_code = 'OTHER' then
1979: l_error_api_name := 'VALIDATE_ELEMENT_TYPE_ID';
1980: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1976: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1977: l_batch_status := 1;
1978: if l_return_code = 'OTHER' then
1979: l_error_api_name := 'VALIDATE_ELEMENT_TYPE_ID';
1980: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1981: else
1982: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1983: X_error_code => l_return_code,
1984: X_return_status => x_return_status);
1981: else
1982: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1983: X_error_code => l_return_code,
1984: X_return_status => x_return_status);
1985: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1986: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1987: end if;
1988: end if;
1989:
1982: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1983: X_error_code => l_return_code,
1984: X_return_status => x_return_status);
1985: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1986: raise FND_API.G_EXC_UNEXPECTED_ERROR;
1987: end if;
1988: end if;
1989:
1990: elsif g_pregen_rec.gl_code_combination_id IS NULL and
1994: update_record_with_error(
1995: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1996: X_error_code => l_return_code,
1997: X_return_status => x_return_status);
1998: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1999: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2000: end if;
2001: elsif g_pregen_rec.gl_code_combination_id IS NOT NULL and
2002: g_pregen_rec.project_id IS NOT NULL then
1995: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
1996: X_error_code => l_return_code,
1997: X_return_status => x_return_status);
1998: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
1999: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2000: end if;
2001: elsif g_pregen_rec.gl_code_combination_id IS NOT NULL and
2002: g_pregen_rec.project_id IS NOT NULL then
2003: l_batch_status := 1;
2006: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2007: X_error_code => l_return_code,
2008: X_return_status => x_return_status);
2009:
2010: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2011: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2012: end if;
2013:
2014: elsif g_pregen_rec.project_id is not null then /* Bug fix 2985061 */
2007: X_error_code => l_return_code,
2008: X_return_status => x_return_status);
2009:
2010: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2011: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2012: end if;
2013:
2014: elsif g_pregen_rec.project_id is not null then /* Bug fix 2985061 */
2015: hr_utility.trace('project_id is not null');
2023:
2024:
2025: if x_gms_pa_install ='NO_PA_GMS' then
2026: l_batch_status:=1;
2027: x_return_status:= FND_API.G_RET_STS_ERROR;
2028: l_return_code:='NO_PA';
2029: update_record_with_error(
2030: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2031: X_error_code => l_return_code,
2029: update_record_with_error(
2030: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2031: X_error_code => l_return_code,
2032: X_return_status => x_return_status);
2033: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2034: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2035: end if;
2036:
2037:
2030: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2031: X_error_code => l_return_code,
2032: X_return_status => x_return_status);
2033: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2034: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2035: end if;
2036:
2037:
2038:
2052: --dbms_output.PUT_LINE('return status.....' || l_return_status);
2053: --dbms_output.PUT_LINE('return code.....' || l_return_code);
2054:
2055: end if;
2056: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2057: --- l_batch_status := 1; /* Bug 2007521 */
2058: if l_return_code = 'OTHER' then
2059: l_error_api_name := 'VALIDATE_PROJECTS_DETAILS';
2060: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2056: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2057: --- l_batch_status := 1; /* Bug 2007521 */
2058: if l_return_code = 'OTHER' then
2059: l_error_api_name := 'VALIDATE_PROJECTS_DETAILS';
2060: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2061: else
2062: if g_use_pre_gen_suspense = 'Y' then
2063: stick_suspense_account( g_pregen_rec.assignment_id,
2064: g_pregen_rec.distribution_date,
2068: l_return_code,
2069: x_business_group_id,
2070: x_set_of_books_id,
2071: x_return_status);
2072: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2073: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2074: end if;
2075: /* Bug 2007521: moved code into stick suspense a/c
2076: update_record_with_valid(X_distribution_interface_id=>
2069: x_business_group_id,
2070: x_set_of_books_id,
2071: x_return_status);
2072: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2073: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2074: end if;
2075: /* Bug 2007521: moved code into stick suspense a/c
2076: update_record_with_valid(X_distribution_interface_id=>
2077: g_pregen_rec.distribution_interface_id,
2075: /* Bug 2007521: moved code into stick suspense a/c
2076: update_record_with_valid(X_distribution_interface_id=>
2077: g_pregen_rec.distribution_interface_id,
2078: X_return_status => l_return_status);
2079: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2080: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2081: end if; */
2082: else
2083: l_batch_status := 1;
2076: update_record_with_valid(X_distribution_interface_id=>
2077: g_pregen_rec.distribution_interface_id,
2078: X_return_status => l_return_status);
2079: if l_return_status <> FND_API.G_RET_STS_SUCCESS then
2080: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2081: end if; */
2082: else
2083: l_batch_status := 1;
2084: update_record_with_error(
2085: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2086: X_error_code => l_return_code,
2087: X_return_status => x_return_status);
2088:
2089: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2090: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2091: end if;
2092: end if;
2093: end if;
2086: X_error_code => l_return_code,
2087: X_return_status => x_return_status);
2088:
2089: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2090: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2091: end if;
2092: end if;
2093: end if;
2094: else
2110: ret_expenditure_type => l_new_expenditure_type,
2111: ret_gl_code_combination_id => l_new_gl_code_combination_id,
2112: retcode => l_autopop_status);
2113:
2114: IF l_autopop_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2115: l_batch_status := 1;
2116: l_return_code := 'AUTOPOP_EXP_ERR';
2117: update_record_with_error(X_distribution_interface_id =>
2118: g_pregen_rec.distribution_interface_id,
2117: update_record_with_error(X_distribution_interface_id =>
2118: g_pregen_rec.distribution_interface_id,
2119: X_error_code => l_return_code,
2120: X_return_status => x_return_status);
2121: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2122: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2123: end if;
2124: ELSIF l_autopop_status = FND_API.G_RET_STS_ERROR THEN
2125: /********Will not populate distribution interface table if autopop returns no value
2118: g_pregen_rec.distribution_interface_id,
2119: X_error_code => l_return_code,
2120: X_return_status => x_return_status);
2121: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2122: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2123: end if;
2124: ELSIF l_autopop_status = FND_API.G_RET_STS_ERROR THEN
2125: /********Will not populate distribution interface table if autopop returns no value
2126: ******** as it is not considered an error condition.
2120: X_return_status => x_return_status);
2121: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2122: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2123: end if;
2124: ELSIF l_autopop_status = FND_API.G_RET_STS_ERROR THEN
2125: /********Will not populate distribution interface table if autopop returns no value
2126: ******** as it is not considered an error condition.
2127: l_return_code := 'AUTOPOP_NO_VAL';
2128: update_record_with_error(X_distribution_interface_id =>
2128: update_record_with_error(X_distribution_interface_id =>
2129: g_pregen_rec.distribution_interface_id,
2130: X_error_code => l_return_code,
2131: X_return_status => x_return_status);
2132: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2133: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2134: end if;
2135: *********************************************************/
2136:
2129: g_pregen_rec.distribution_interface_id,
2130: X_error_code => l_return_code,
2131: X_return_status => x_return_status);
2132: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2133: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2134: end if;
2135: *********************************************************/
2136:
2137: l_return_code := 0;
2137: l_return_code := 0;
2138: update_record_with_valid(X_distribution_interface_id =>
2139: g_pregen_rec.distribution_interface_id,
2140: X_return_status => x_return_status);
2141: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2142: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2143: end if;
2144: ELSIF l_autopop_status = FND_API.G_RET_STS_SUCCESS THEN
2145: update_record_with_exp(X_distribution_interface_id =>
2138: update_record_with_valid(X_distribution_interface_id =>
2139: g_pregen_rec.distribution_interface_id,
2140: X_return_status => x_return_status);
2141: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2142: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2143: end if;
2144: ELSIF l_autopop_status = FND_API.G_RET_STS_SUCCESS THEN
2145: update_record_with_exp(X_distribution_interface_id =>
2146: g_pregen_rec.distribution_interface_id,
2140: X_return_status => x_return_status);
2141: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2142: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2143: end if;
2144: ELSIF l_autopop_status = FND_API.G_RET_STS_SUCCESS THEN
2145: update_record_with_exp(X_distribution_interface_id =>
2146: g_pregen_rec.distribution_interface_id,
2147: X_expenditure_type => l_new_expenditure_type,
2148: X_return_status => x_return_status);
2145: update_record_with_exp(X_distribution_interface_id =>
2146: g_pregen_rec.distribution_interface_id,
2147: X_expenditure_type => l_new_expenditure_type,
2148: X_return_status => x_return_status);
2149: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2150: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2151: end if;
2152: /* Introduced validation for Bug 2007521 */
2153: Validate_Project_details(X_Project_ID => g_pregen_rec.project_id,
2146: g_pregen_rec.distribution_interface_id,
2147: X_expenditure_type => l_new_expenditure_type,
2148: X_return_status => x_return_status);
2149: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2150: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2151: end if;
2152: /* Introduced validation for Bug 2007521 */
2153: Validate_Project_details(X_Project_ID => g_pregen_rec.project_id,
2154: X_task_id => g_pregen_rec.task_id,
2160: X_Effective_date => g_pregen_rec.distribution_date,
2161: X_return_status => x_return_status,
2162: X_return_code => l_return_code);
2163:
2164: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2165: if l_return_code = 'OTHER' then
2166: l_error_api_name := 'VALIDATE_PROJECTS_DETAILS';
2167: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2168: else
2163:
2164: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2165: if l_return_code = 'OTHER' then
2166: l_error_api_name := 'VALIDATE_PROJECTS_DETAILS';
2167: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2168: else
2169: if g_use_pre_gen_suspense = 'Y' then
2170: /* stick suspense, also makes Valid and puts in error code Bug 2007521 */
2171: stick_suspense_account( g_pregen_rec.assignment_id,
2176: l_return_code,
2177: x_business_group_id,
2178: x_set_of_books_id,
2179: x_return_status);
2180: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2181: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2182: end if;
2183: else
2184: l_batch_status := 1;
2177: x_business_group_id,
2178: x_set_of_books_id,
2179: x_return_status);
2180: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2181: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2182: end if;
2183: else
2184: l_batch_status := 1;
2185: update_record_with_error(
2185: update_record_with_error(
2186: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2187: X_error_code => l_return_code,
2188: X_return_status => x_return_status);
2189: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2190: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2191: end if;
2192: end if;
2193: end if;
2186: X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2187: X_error_code => l_return_code,
2188: X_return_status => x_return_status);
2189: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2190: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2191: end if;
2192: end if;
2193: end if;
2194: else
2196: l_return_code := 0;
2197: update_record_with_valid(X_distribution_interface_id =>
2198: g_pregen_rec.distribution_interface_id,
2199: X_return_status => x_return_status);
2200: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2201: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2202: end if;
2203: end if;
2204: END IF;
2197: update_record_with_valid(X_distribution_interface_id =>
2198: g_pregen_rec.distribution_interface_id,
2199: X_return_status => x_return_status);
2200: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2201: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2202: end if;
2203: end if;
2204: END IF;
2205: END IF;
2208: validate_gl_cc_id( x_code_combination_id => g_pregen_rec.gl_code_combination_id,
2209: x_return_status => x_return_status,
2210: x_return_code => l_return_code);
2211:
2212: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2213: l_batch_status := 1;
2214: IF l_return_code = 'OTHER' THEN
2215: l_error_api_name := 'VALIDATE_GL_CC_ID';
2216: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2212: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2213: l_batch_status := 1;
2214: IF l_return_code = 'OTHER' THEN
2215: l_error_api_name := 'VALIDATE_GL_CC_ID';
2216: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2217: ELSE
2218: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2219: X_error_code => l_return_code,
2220: X_return_status => x_return_status);
2217: ELSE
2218: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2219: X_error_code => l_return_code,
2220: X_return_status => x_return_status);
2221: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2222: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2223: END IF;
2224: END IF;
2225: END IF;
2218: update_record_with_error(X_distribution_interface_id => g_pregen_rec.distribution_interface_id,
2219: X_error_code => l_return_code,
2220: X_return_status => x_return_status);
2221: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2222: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2223: END IF;
2224: END IF;
2225: END IF;
2226: -- Call Auto-Population for a new GL Code Combination Id that has a new Natural Account.
2240: ret_expenditure_type => l_new_expenditure_type,
2241: ret_gl_code_combination_id => l_new_gl_code_combination_id,
2242: retcode => l_autopop_status);
2243:
2244: IF l_autopop_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2245: l_batch_status := 1;
2246: l_return_code := 'AUTOPOP_NA_ERR';
2247: update_record_with_error(X_distribution_interface_id =>
2248: g_pregen_rec.distribution_interface_id,
2247: update_record_with_error(X_distribution_interface_id =>
2248: g_pregen_rec.distribution_interface_id,
2249: X_error_code => l_return_code,
2250: X_return_status => x_return_status);
2251: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2252: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2253: end if;
2254: ELSIF l_autopop_status = FND_API.G_RET_STS_ERROR THEN
2255:
2248: g_pregen_rec.distribution_interface_id,
2249: X_error_code => l_return_code,
2250: X_return_status => x_return_status);
2251: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2252: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2253: end if;
2254: ELSIF l_autopop_status = FND_API.G_RET_STS_ERROR THEN
2255:
2256: /********Will not populate distribution interface table if autopop returns no value
2250: X_return_status => x_return_status);
2251: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2252: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2253: end if;
2254: ELSIF l_autopop_status = FND_API.G_RET_STS_ERROR THEN
2255:
2256: /********Will not populate distribution interface table if autopop returns no value
2257: ******** as it is not considered an error condition.
2258: l_return_code := 'AUTOPOP_NO_VAL';
2259: update_record_with_error(X_distribution_interface_id =>
2260: g_pregen_rec.distribution_interface_id,
2261: X_error_code => l_return_code,
2262: X_return_status => x_return_status);
2263: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2264: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2265: end if;
2266: ******************************************************/
2267: l_return_code := 0;
2260: g_pregen_rec.distribution_interface_id,
2261: X_error_code => l_return_code,
2262: X_return_status => x_return_status);
2263: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2264: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2265: end if;
2266: ******************************************************/
2267: l_return_code := 0;
2268: update_record_with_valid(X_distribution_interface_id =>
2267: l_return_code := 0;
2268: update_record_with_valid(X_distribution_interface_id =>
2269: g_pregen_rec.distribution_interface_id,
2270: X_return_status => x_return_status);
2271: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2272: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2273: end if;
2274: ELSIF l_autopop_status = FND_API.G_RET_STS_SUCCESS THEN
2275: ----dbms_output.put_line ('Update record with valid');
2268: update_record_with_valid(X_distribution_interface_id =>
2269: g_pregen_rec.distribution_interface_id,
2270: X_return_status => x_return_status);
2271: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2272: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2273: end if;
2274: ELSIF l_autopop_status = FND_API.G_RET_STS_SUCCESS THEN
2275: ----dbms_output.put_line ('Update record with valid');
2276: l_return_code := 0;
2270: X_return_status => x_return_status);
2271: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2272: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2273: end if;
2274: ELSIF l_autopop_status = FND_API.G_RET_STS_SUCCESS THEN
2275: ----dbms_output.put_line ('Update record with valid');
2276: l_return_code := 0;
2277: update_record_with_valid(X_distribution_interface_id =>
2278: g_pregen_rec.distribution_interface_id,
2276: l_return_code := 0;
2277: update_record_with_valid(X_distribution_interface_id =>
2278: g_pregen_rec.distribution_interface_id,
2279: X_return_status => x_return_status);
2280: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2281: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2282: end if;
2283:
2284: update_record_with_na(X_distribution_interface_id =>
2277: update_record_with_valid(X_distribution_interface_id =>
2278: g_pregen_rec.distribution_interface_id,
2279: X_return_status => x_return_status);
2280: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2281: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2282: end if;
2283:
2284: update_record_with_na(X_distribution_interface_id =>
2285: g_pregen_rec.distribution_interface_id,
2284: update_record_with_na(X_distribution_interface_id =>
2285: g_pregen_rec.distribution_interface_id,
2286: X_gl_code_combination_id => l_new_gl_code_combination_id,
2287: X_return_status => x_return_status);
2288: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2289: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2290: end if;
2291: END IF;
2292: END IF;
2285: g_pregen_rec.distribution_interface_id,
2286: X_gl_code_combination_id => l_new_gl_code_combination_id,
2287: X_return_status => x_return_status);
2288: if x_return_status <> FND_API.G_RET_STS_SUCCESS then
2289: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2290: end if;
2291: END IF;
2292: END IF;
2293: end if;
2323: end if;
2324:
2325: fnd_message.set_name('PSP','PSP_BATCH_HAS_ERRORS');
2326: fnd_msg_pub.add;
2327: x_return_status:=FND_API.G_RET_STS_ERROR;
2328: else
2329: x_return_status:= FND_API.G_RET_STS_SUCCESS;
2330: end if;
2331: -- commit; Commented COMMIT for bug fix 2094036, error reason codes get commited in main procedure.
2325: fnd_message.set_name('PSP','PSP_BATCH_HAS_ERRORS');
2326: fnd_msg_pub.add;
2327: x_return_status:=FND_API.G_RET_STS_ERROR;
2328: else
2329: x_return_status:= FND_API.G_RET_STS_SUCCESS;
2330: end if;
2331: -- commit; Commented COMMIT for bug fix 2094036, error reason codes get commited in main procedure.
2332: return;
2333: EXCEPTION
2335: close get_all_from_interface_csr;
2336: FND_MESSAGE.SET_NAME('PSP','PSP_LD_NO_TRANS');
2337: l_subline_message := fnd_message.get;
2338: -- errbuf := SUBSTR(l_error_api_name ||fnd_global.local_chr(10) || l_subline_message,1,230);
2339: x_return_status:= FND_API.G_RET_STS_SUCCESS;
2340: return;
2341:
2342: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2343: ----dbms_output.put_line('Unexpected Error...........');
2338: -- errbuf := SUBSTR(l_error_api_name ||fnd_global.local_chr(10) || l_subline_message,1,230);
2339: x_return_status:= FND_API.G_RET_STS_SUCCESS;
2340: return;
2341:
2342: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2343: ----dbms_output.put_line('Unexpected Error...........');
2344: /*******************************************************************************************************
2345: fnd_msg_pub.get(p_msg_index => FND_MSG_PUB.G_FIRST,
2346: p_encoded => FND_API.G_FALSE,
2342: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2343: ----dbms_output.put_line('Unexpected Error...........');
2344: /*******************************************************************************************************
2345: fnd_msg_pub.get(p_msg_index => FND_MSG_PUB.G_FIRST,
2346: p_encoded => FND_API.G_FALSE,
2347: p_data => l_msg_data,
2348: p_msg_index_out => l_msg_count);
2349:
2350: Printed from Message Stack
2350: Printed from Message Stack
2351: **********************************************************************************************************/
2352: -- errbuf := SUBSTR(l_error_api_name || fnd_global.local_chr(10) || l_msg_data || fnd_global.local_chr(10),1,230);
2353: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Autopop-Unexpected Error');
2354: x_return_status:= FND_API.G_RET_STS_UNEXP_ERROR;
2355:
2356: rollback;
2357: return;
2358: WHEN OTHERS then
2359: ----dbms_output.put_line('When others Error...........');
2360:
2361: /*********************************************************************************************************
2362: fnd_msg_pub.get(p_msg_index => FND_MSG_PUB.G_FIRST,
2363: p_encoded => FND_API.G_FALSE,
2364: p_data => l_msg_data,
2365: p_msg_index_out => l_msg_count);
2366: -- errbuf := SUBSTR(l_error_api_name || fnd_global.local_chr(10) || l_msg_data || fnd_global.local_chr(10),1,230);
2367:
2368: printed from mesasge stack
2369: **********************************************************************************************************/
2370: rollback;
2371: fnd_msg_pub.add_exc_msg('PSP_PREGEN','Autopop-Error');
2372: x_return_status := FND_API.G_RET_STS_ERROR;
2373: --- x_retcode := 2;
2374: return;
2375: END Autopop;
2376:
2388: SET expenditure_type = X_expenditure_type
2389: WHERE distribution_interface_id = X_distribution_interface_id;
2390:
2391: if SQL%NOTFOUND then
2392: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2393: end if;
2394:
2395: x_return_status := FND_API.G_RET_STS_SUCCESS;
2396: EXCEPTION
2391: if SQL%NOTFOUND then
2392: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2393: end if;
2394:
2395: x_return_status := FND_API.G_RET_STS_SUCCESS;
2396: EXCEPTION
2397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2398: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Error while updating');
2399: x_return_status := FND_API.G_RET_STS_ERROR;
2393: end if;
2394:
2395: x_return_status := FND_API.G_RET_STS_SUCCESS;
2396: EXCEPTION
2397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2398: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Error while updating');
2399: x_return_status := FND_API.G_RET_STS_ERROR;
2400: WHEN OTHERS then
2401: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Unexpected error');
2395: x_return_status := FND_API.G_RET_STS_SUCCESS;
2396: EXCEPTION
2397: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2398: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Error while updating');
2399: x_return_status := FND_API.G_RET_STS_ERROR;
2400: WHEN OTHERS then
2401: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Unexpected error');
2402: x_return_status := FND_API.G_RET_STS_ERROR;
2403:
2398: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Error while updating');
2399: x_return_status := FND_API.G_RET_STS_ERROR;
2400: WHEN OTHERS then
2401: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_exp : Unexpected error');
2402: x_return_status := FND_API.G_RET_STS_ERROR;
2403:
2404: end;
2405:
2406: --
2416: SET gl_code_combination_id = X_gl_code_combination_id
2417: WHERE distribution_interface_id = X_distribution_interface_id;
2418:
2419: if SQL%NOTFOUND then
2420: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2421: end if;
2422:
2423: x_return_status := FND_API.G_RET_STS_SUCCESS;
2424: EXCEPTION
2419: if SQL%NOTFOUND then
2420: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2421: end if;
2422:
2423: x_return_status := FND_API.G_RET_STS_SUCCESS;
2424: EXCEPTION
2425: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2426: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Error while updating');
2427: x_return_status := FND_API.G_RET_STS_ERROR;
2421: end if;
2422:
2423: x_return_status := FND_API.G_RET_STS_SUCCESS;
2424: EXCEPTION
2425: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2426: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Error while updating');
2427: x_return_status := FND_API.G_RET_STS_ERROR;
2428: WHEN OTHERS then
2429: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Unexpected error');
2423: x_return_status := FND_API.G_RET_STS_SUCCESS;
2424: EXCEPTION
2425: WHEN FND_API.G_EXC_UNEXPECTED_ERROR then
2426: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Error while updating');
2427: x_return_status := FND_API.G_RET_STS_ERROR;
2428: WHEN OTHERS then
2429: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Unexpected error');
2430: x_return_status := FND_API.G_RET_STS_ERROR;
2431:
2426: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Error while updating');
2427: x_return_status := FND_API.G_RET_STS_ERROR;
2428: WHEN OTHERS then
2429: fnd_msg_pub.add_exc_msg('PSP_PREGEN','update_record_with_na : Unexpected error');
2430: x_return_status := FND_API.G_RET_STS_ERROR;
2431:
2432: end;
2433:
2434: ---================================= GET_SUSPENSE_ACCOUNT ===================
2590: ||' p_payroll_date => '||p_effective_date
2591: ||' p_set_of_books_id => '||p_set_of_books_id
2592: ||' p_business_group_id => '||p_business_group_id);*/
2593:
2594: if (l_auto_pop_status = FND_API.G_RET_STS_UNEXP_ERROR) or
2595: (l_auto_pop_status = FND_API.G_RET_STS_ERROR) then
2596: if l_auto_pop_status = FND_API.G_RET_STS_UNEXP_ERROR then
2597: if l_acct_type ='N' then
2598: l_auto_status := 'AUTO_POP_NA_ERROR';
2591: ||' p_set_of_books_id => '||p_set_of_books_id
2592: ||' p_business_group_id => '||p_business_group_id);*/
2593:
2594: if (l_auto_pop_status = FND_API.G_RET_STS_UNEXP_ERROR) or
2595: (l_auto_pop_status = FND_API.G_RET_STS_ERROR) then
2596: if l_auto_pop_status = FND_API.G_RET_STS_UNEXP_ERROR then
2597: if l_acct_type ='N' then
2598: l_auto_status := 'AUTO_POP_NA_ERROR';
2599: else
2592: ||' p_business_group_id => '||p_business_group_id);*/
2593:
2594: if (l_auto_pop_status = FND_API.G_RET_STS_UNEXP_ERROR) or
2595: (l_auto_pop_status = FND_API.G_RET_STS_ERROR) then
2596: if l_auto_pop_status = FND_API.G_RET_STS_UNEXP_ERROR then
2597: if l_acct_type ='N' then
2598: l_auto_status := 'AUTO_POP_NA_ERROR';
2599: else
2600: l_auto_status :='AUTO_POP_EXP_ERROR';
2598: l_auto_status := 'AUTO_POP_NA_ERROR';
2599: else
2600: l_auto_status :='AUTO_POP_EXP_ERROR';
2601: end if;
2602: elsif l_auto_pop_status = FND_API.G_RET_STS_ERROR then
2603: l_auto_status := 'AUTO_POP_NO_VALUE';
2604: end if;
2605: open get_asg_details;
2606: fetch get_asg_details into l_employee_name, l_assignment_number, l_element_type, l_auto_org_name;
2631: fnd_message.set_token('CHARGING_ACCOUNT',l_account);
2632: fnd_message.set_token('AUTOPOP_ERROR',l_auto_status);
2633: fnd_message.set_token('EFF_DATE',p_effective_date);
2634: fnd_msg_pub.add;
2635: x_return_status := fnd_api.g_ret_sts_unexp_error;
2636: else
2637: x_suspense_auto_glccid := l_new_glccid;
2638: x_suspense_auto_exp_type := l_new_exp_type;
2639: suspense_rec.gl_code_combination_id := x_suspense_auto_glccid;
2652: X_Effective_date => p_effective_date,
2653: X_return_status => v_return_status,
2654: X_return_code => v_return_code);
2655:
2656: if v_return_status <> FND_API.G_RET_STS_SUCCESS then
2657: if v_return_code = 'OTHER' then
2658: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2659: else
2660: raise SUSPENSE_AC_INVALID; /* should raise functional fatal error 2007521 */
2654: X_return_code => v_return_code);
2655:
2656: if v_return_status <> FND_API.G_RET_STS_SUCCESS then
2657: if v_return_code = 'OTHER' then
2658: raise FND_API.G_EXC_UNEXPECTED_ERROR;
2659: else
2660: raise SUSPENSE_AC_INVALID; /* should raise functional fatal error 2007521 */
2661: end if;
2662: end if;
2661: end if;
2662: end if;
2663: end if;
2664:
2665: x_return_status := FND_API.G_RET_STS_SUCCESS;
2666: end if;
2667: x_suspense_account := suspense_rec.organization_account_id;
2668: EXCEPTION
2669: WHEN NO_PROFILE_EXISTS THEN
2668: EXCEPTION
2669: WHEN NO_PROFILE_EXISTS THEN
2670: fnd_message.set_name('PSP','PSP_NO_PROFILE_EXISTS');
2671: fnd_msg_pub.add;
2672: x_return_status := fnd_api.g_ret_sts_unexp_error;
2673:
2674: WHEN NO_VAL_DATE_MATCHES THEN
2675: fnd_message.set_name('PSP','PSP_NO_VAL_DATE_MATCHES');
2676: fnd_message.set_token('ORG_NAME',p_organization_name);
2675: fnd_message.set_name('PSP','PSP_NO_VAL_DATE_MATCHES');
2676: fnd_message.set_token('ORG_NAME',p_organization_name);
2677: fnd_message.set_token('PAYROLL_DATE',p_effective_date);
2678: fnd_msg_pub.add;
2679: x_return_status := fnd_api.g_ret_sts_unexp_error;
2680:
2681: WHEN NO_GLOBAL_ACCT_EXISTS THEN
2682: fnd_message.set_name('PSP','PSP_NO_GLOBAL_ACCT_EXISTS');
2683: fnd_message.set_token('ORG_NAME',p_organization_name);
2682: fnd_message.set_name('PSP','PSP_NO_GLOBAL_ACCT_EXISTS');
2683: fnd_message.set_token('ORG_NAME',p_organization_name);
2684: fnd_message.set_token('PAYROLL_DATE',p_effective_date);
2685: fnd_msg_pub.add;
2686: x_return_status := fnd_api.g_ret_sts_unexp_error;
2687:
2688: WHEN SUSPENSE_AC_INVALID THEN
2689: /* Following added for bug 2514611 */
2690: OPEN employee_name_cur;
2694: fnd_message.set_token('ORG_NAME',p_organization_name);
2695: fnd_message.set_token('PATC_STATUS',v_return_code);
2696: fnd_message.set_token('EMPLOYEE_NAME',l_employee_name); --Bug 2514611
2697: fnd_msg_pub.add;
2698: x_return_status := fnd_api.g_ret_sts_unexp_error;
2699:
2700: WHEN OTHERS THEN
2701: if org_suspense_cur%isopen then
2702: close org_suspense_cur;
2704: if org_suspense_cur2%isopen then
2705: close org_suspense_cur2;
2706: end if;
2707: fnd_msg_pub.add_exc_msg('PSP_PREGEN','GET_SUSPENSE_ACCOUNT');
2708: x_return_status := fnd_api.g_ret_sts_unexp_error;
2709: END;
2710: ---================================= STICK_SUSPENSE_ACCOUNT ===================
2711: /* Bug fix 2007521: Created this procedure.
2712: Sticks suspense account for Pre-Gen line with invalid POETA account. */
2759: v_suspense_account,
2760: v_return_status,
2761: l_suspense_auto_glccid,
2762: l_suspense_auto_exp_type);
2763: if v_return_status <> FND_API.G_RET_STS_SUCCESS then
2764: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2765: end if;
2766:
2767: update psp_distribution_interface
2760: v_return_status,
2761: l_suspense_auto_glccid,
2762: l_suspense_auto_exp_type);
2763: if v_return_status <> FND_API.G_RET_STS_SUCCESS then
2764: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2765: end if;
2766:
2767: update psp_distribution_interface
2768: set suspense_org_account_id = v_suspense_account,
2772: suspense_auto_exp_type = l_suspense_auto_exp_type
2773: where distribution_interface_id = p_distribution_interface_id;
2774: close org_name_cur;
2775: end if;
2776: p_return_status := FND_API.G_RET_STS_SUCCESS;
2777: EXCEPTION
2778: When ASSIGN_ORG_NOT_FOUND then
2779: fnd_msg_pub.add_exc_msg('PSP_PREGEN','STICK_SUSPENSE_ACCOUNT-(Assign ORG)');
2780: p_return_status := fnd_api.g_ret_sts_unexp_error;
2776: p_return_status := FND_API.G_RET_STS_SUCCESS;
2777: EXCEPTION
2778: When ASSIGN_ORG_NOT_FOUND then
2779: fnd_msg_pub.add_exc_msg('PSP_PREGEN','STICK_SUSPENSE_ACCOUNT-(Assign ORG)');
2780: p_return_status := fnd_api.g_ret_sts_unexp_error;
2781: When others then
2782: if org_name_cur%isopen then
2783: close org_name_cur;
2784: end if;
2782: if org_name_cur%isopen then
2783: close org_name_cur;
2784: end if;
2785: fnd_msg_pub.add_exc_msg('PSP_PREGEN','STICK_SUSPENSE_ACCOUNT');
2786: p_return_status := fnd_api.g_ret_sts_unexp_error;
2787: END;
2788:
2789: /* Bug fix 2985061: Created this procedure.
2790: If Cr_Dr_Flag in the psp_distribution_interface table is not in ('C','D') then throw Exception */
2793: X_return_status OUT NOCOPY varchar2,
2794: X_return_code OUT NOCOPY varchar2) IS
2795: BEGIN
2796: if (X_DR_CR_FLAG = 'D') or (X_DR_CR_FLAG = 'C') then
2797: x_return_status := FND_API.G_RET_STS_SUCCESS;
2798: x_return_code := ' ';
2799: else
2800: x_return_status := FND_API.G_RET_STS_ERROR;
2801: x_return_code := 'INV_D_C';
2796: if (X_DR_CR_FLAG = 'D') or (X_DR_CR_FLAG = 'C') then
2797: x_return_status := FND_API.G_RET_STS_SUCCESS;
2798: x_return_code := ' ';
2799: else
2800: x_return_status := FND_API.G_RET_STS_ERROR;
2801: x_return_code := 'INV_D_C';
2802: end if;
2803: EXCEPTION
2804: when OTHERS then
2802: end if;
2803: EXCEPTION
2804: when OTHERS then
2805: fnd_msg_pub.add_exc_msg('PSP_PREGEN','VALIDATE_DR_CR_FLAG : Unexpected Error');
2806: x_return_status := FND_API.G_RET_STS_ERROR;
2807: x_return_code := 'OTHER';
2808: return;
2809: END VALIDATE_DR_CR_FLAG;
2810:
2822: BEGIN
2823: open check_code_combination_csr;
2824: fetch check_code_combination_csr into l_code_combination_id;
2825: if check_code_combination_csr%NOTFOUND then
2826: x_return_status := FND_API.G_RET_STS_ERROR;
2827: x_return_code := 'INV_GLC';
2828: close check_code_combination_csr;
2829: return;
2830: else
2827: x_return_code := 'INV_GLC';
2828: close check_code_combination_csr;
2829: return;
2830: else
2831: x_return_status := FND_API.G_RET_STS_SUCCESS;
2832: x_return_code := ' ';
2833: end If;
2834: close check_code_combination_csr;
2835: Exception
2833: end If;
2834: close check_code_combination_csr;
2835: Exception
2836: when no_data_found or too_many_rows then
2837: x_return_status := FND_API.G_RET_STS_ERROR;
2838: x_return_code := 'INV_GLC';
2839: close check_code_combination_csr;
2840: return;
2841: when OTHERS then
2839: close check_code_combination_csr;
2840: return;
2841: when OTHERS then
2842: fnd_msg_pub.add_exc_msg('PSP_PREGEN','VALIDATE_GL_CODE_COMBINATION_ID : Unexpected Error');
2843: x_return_status := FND_API.G_RET_STS_ERROR;
2844: x_return_code := 'OTHER';
2845: close check_code_combination_csr;
2846: return;
2847: End VALIDATE_GL_CC_ID;