530: )
531: IS
532: BEGIN
533: IF( (p_ou_query_rec.instance_ou_id IS NOT NULL)
534: AND (p_ou_query_rec.instance_ou_id <> FND_API.G_MISS_NUM)) THEN
535: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':instance_ou_id', p_ou_query_rec.instance_ou_id);
536: END IF;
537:
538: IF( (p_ou_query_rec.instance_id IS NOT NULL)
535: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':instance_ou_id', p_ou_query_rec.instance_ou_id);
536: END IF;
537:
538: IF( (p_ou_query_rec.instance_id IS NOT NULL)
539: AND (p_ou_query_rec.instance_id <> FND_API.G_MISS_NUM)) THEN
540: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':instance_id', p_ou_query_rec.instance_id);
541: END IF;
542:
543: IF( (p_ou_query_rec.operating_unit_id IS NOT NULL)
540: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':instance_id', p_ou_query_rec.instance_id);
541: END IF;
542:
543: IF( (p_ou_query_rec.operating_unit_id IS NOT NULL)
544: AND (p_ou_query_rec.operating_unit_id<> FND_API.G_MISS_NUM)) THEN
545: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':operating_unit_id', p_ou_query_rec.operating_unit_id);
546: END IF;
547:
548: IF( (p_ou_query_rec.relationship_type_code IS NOT NULL)
545: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':operating_unit_id', p_ou_query_rec.operating_unit_id);
546: END IF;
547:
548: IF( (p_ou_query_rec.relationship_type_code IS NOT NULL)
549: AND (p_ou_query_rec.relationship_type_code <> FND_API.G_MISS_CHAR)) THEN
550: DBMS_SQL.BIND_VARIABLE(p_cur_get_ou, ':relationship_type_code', p_ou_query_rec.relationship_type_code);
551: END IF;
552:
553: END Bind_ou_variable;
571: -- Assign null at the start
572: x_where_clause := '';
573:
574: IF (( p_ou_query_rec.instance_ou_id IS NOT NULL) AND
575: (p_ou_query_rec.instance_ou_id <> FND_API.G_MISS_NUM)) THEN
576: x_where_clause := ' instance_ou_id = :instance_ou_id ';
577: ELSIF ( p_ou_query_rec.instance_ou_id IS NULL) THEN
578: x_where_clause := ' instance_ou_id IS NULL ';
579: END IF;
578: x_where_clause := ' instance_ou_id IS NULL ';
579: END IF;
580:
581: IF ((p_ou_query_rec.instance_id IS NOT NULL) AND
582: (p_ou_query_rec.instance_id <> FND_API.G_MISS_NUM)) THEN
583: IF x_where_clause IS NULL THEN
584: x_where_clause := ' instance_id = :instance_id ';
585: ELSE
586: x_where_clause := x_where_clause||' AND '||' instance_id = :instance_id ';
593: END IF;
594: END IF;
595:
596: IF ((p_ou_query_rec.operating_unit_id IS NOT NULL) AND
597: (p_ou_query_rec.operating_unit_id <> FND_API.G_MISS_NUM)) THEN
598: IF x_where_clause IS NULL THEN
599: x_where_clause := ' operating_unit_id = :operating_unit_id ';
600: ELSE
601: x_where_clause := x_where_clause||' AND '||' operating_unit_id = :operating_unit_id ';
608: END IF;
609: END IF ;
610:
611: IF ((p_ou_query_rec.relationship_type_code IS NOT NULL) AND
612: (p_ou_query_rec.relationship_type_code <> FND_API.G_MISS_CHAR)) THEN
613:
614: IF x_where_clause IS NULL THEN
615: x_where_clause := ' relationship_type_code = :relationship_type_code ';
616: ELSE
675: -- Standard Start of API savepoint
676: SAVEPOINT create_organization_unit;
677:
678: -- Standard call to check for call compatibility.
679: IF NOT FND_API.Compatible_API_Call (l_api_version,
680: p_api_version,
681: l_api_name ,
682: g_pkg_name)
683: THEN
680: p_api_version,
681: l_api_name ,
682: g_pkg_name)
683: THEN
684: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
685: END IF;
686:
687:
688: -- Initialize message list if p_init_msg_list is set to TRUE.
685: END IF;
686:
687:
688: -- Initialize message list if p_init_msg_list is set to TRUE.
689: IF FND_API.to_Boolean( p_init_msg_list ) THEN
690: FND_MSG_PUB.initialize;
691: END IF;
692:
693:
691: END IF;
692:
693:
694: -- Initialize API return status to success
695: x_return_status := FND_API.G_RET_STS_SUCCESS;
696:
697:
698: -- Check the profile option debug_level for debug message reporting
699: l_debug_level:=fnd_profile.value('CSI_DEBUG_LEVEL');
721: --
722: -- Initialize the Instance count
723: --
724: IF p_ou_count_rec.ou_count IS NULL OR
725: p_ou_count_rec.ou_count = FND_API.G_MISS_NUM THEN
726: p_ou_count_rec.ou_count := 0;
727: END IF;
728: --
729: IF p_ou_count_rec.lookup_count IS NULL OR
726: p_ou_count_rec.ou_count := 0;
727: END IF;
728: --
729: IF p_ou_count_rec.lookup_count IS NULL OR
730: p_ou_count_rec.lookup_count = FND_API.G_MISS_NUM THEN
731: p_ou_count_rec.lookup_count := 0;
732: END IF;
733: --
734: -- Verify if instance id is ok
731: p_ou_count_rec.lookup_count := 0;
732: END IF;
733: --
734: -- Verify if instance id is ok
735: IF p_called_from_grp <> FND_API.G_TRUE THEN
736: IF NOT(csi_org_unit_vld_pvt.Is_valid_instance_id
737: (p_org_unit_rec.instance_id,
738: 'INSERT')) THEN
739: RAISE FND_API.G_EXC_ERROR;
735: IF p_called_from_grp <> FND_API.G_TRUE THEN
736: IF NOT(csi_org_unit_vld_pvt.Is_valid_instance_id
737: (p_org_unit_rec.instance_id,
738: 'INSERT')) THEN
739: RAISE FND_API.G_EXC_ERROR;
740: END IF;
741: END IF;
742: --
743: --validation for the operating unit id
743: --validation for the operating unit id
744: l_valid_flag := 'Y';
745: l_exists_flag := 'N';
746: IF p_org_unit_rec.operating_unit_id IS NOT NULL AND
747: p_org_unit_rec.operating_unit_id <> FND_API.G_MISS_NUM THEN
748: IF p_ou_id_tbl.count > 0 then
749: FOR ou_count IN p_ou_id_tbl.FIRST .. p_ou_id_tbl.LAST
750: LOOP
751: IF p_ou_id_tbl(ou_count).ou_id = p_org_unit_rec.operating_unit_id
759: IF l_valid_flag <> 'Y' THEN
760: FND_MESSAGE.SET_NAME('CSI','CSI_API_INVALID_OPERATING_UNIT');
761: FND_MESSAGE.SET_TOKEN('OPERATING_UNIT',p_org_unit_rec.operating_unit_id);
762: FND_MSG_PUB.Add;
763: RAISE fnd_api.g_exc_error;
764: END IF;
765: END IF;
766: --
767: IF l_exists_flag <> 'Y' THEN
769: p_ou_id_tbl(p_ou_count_rec.ou_count).ou_id := p_org_unit_rec.operating_unit_id;
770: IF NOT(csi_org_unit_vld_pvt.Is_valid_operating_unit_id
771: (p_org_unit_rec.operating_unit_id)) THEN
772: p_ou_id_tbl(p_ou_count_rec.ou_count).valid_flag := 'N';
773: RAISE fnd_api.g_exc_error;
774: ELSE
775: p_ou_id_tbl(p_ou_count_rec.ou_count).valid_flag := 'Y';
776: END IF;
777: END IF;
778: ELSE
779: FND_MESSAGE.SET_NAME('CSI','CSI_API_INVALID_OPERATING_UNIT');
780: FND_MESSAGE.SET_TOKEN('OPERATING_UNIT',p_org_unit_rec.operating_unit_id);
781: FND_MSG_PUB.Add;
782: RAISE fnd_api.g_exc_error;
783: END IF;
784: --
785: -- Check start effective date
786: IF p_called_from_grp <> FND_API.G_TRUE THEN
782: RAISE fnd_api.g_exc_error;
783: END IF;
784: --
785: -- Check start effective date
786: IF p_called_from_grp <> FND_API.G_TRUE THEN
787: IF NOT(csi_org_unit_vld_pvt.Is_StartDate_Valid
788: (p_org_unit_rec.ACTIVE_START_DATE,
789: p_org_unit_rec.ACTIVE_END_DATE ,
790: p_org_unit_rec.INSTANCE_ID )) THEN
787: IF NOT(csi_org_unit_vld_pvt.Is_StartDate_Valid
788: (p_org_unit_rec.ACTIVE_START_DATE,
789: p_org_unit_rec.ACTIVE_END_DATE ,
790: p_org_unit_rec.INSTANCE_ID )) THEN
791: RAISE FND_API.G_EXC_ERROR;
792: END IF;
793: END IF;
794:
795: -- Check end effective date
792: END IF;
793: END IF;
794:
795: -- Check end effective date
796: IF p_called_from_grp <> FND_API.G_TRUE THEN
797: IF p_org_unit_rec.ACTIVE_END_DATE is NOT NULL THEN
798: IF NOT(csi_org_unit_vld_pvt.Is_EndDate_Valid
799: (p_org_unit_rec.ACTIVE_START_DATE,
800: p_org_unit_rec.ACTIVE_END_DATE ,
800: p_org_unit_rec.ACTIVE_END_DATE ,
801: p_org_unit_rec.INSTANCE_ID ,
802: p_org_unit_rec.INSTANCE_OU_ID,
803: p_txn_rec.TRANSACTION_ID)) THEN
804: RAISE FND_API.G_EXC_ERROR;
805: END IF;
806: END IF;
807: END IF;
808: --
809: --validation for the relationship type code
810: l_valid_flag := 'Y';
811: l_exists_flag := 'N';
812: IF ((p_org_unit_rec.relationship_type_code IS NOT NULL) AND
813: (p_org_unit_rec.relationship_type_code <> FND_API.G_MISS_CHAR)) THEN
814: IF p_lookup_tbl.count > 0 THEN
815: FOR lookup_count IN p_lookup_tbl.FIRST .. p_lookup_tbl.LAST
816: LOOP
817: IF p_lookup_tbl(lookup_count).lookup_code = p_org_unit_rec.relationship_type_code THEN
824: if l_valid_flag <> 'Y' then
825: FND_MESSAGE.SET_NAME('CSI','CSI_API_INVALID_REL_TYPE_CODE');
826: FND_MESSAGE.SET_TOKEN('RELATIONSHIP_TYPE_CODE',p_org_unit_rec.relationship_type_code);
827: FND_MSG_PUB.Add;
828: RAISE fnd_api.g_exc_error;
829: end if;
830: End if;
831: --
832: IF l_exists_flag <> 'Y' THEN
834: p_lookup_tbl(p_ou_count_rec.lookup_count).lookup_code := p_org_unit_rec.relationship_type_code;
835: IF NOT(csi_org_unit_vld_pvt.Is_valid_rel_type_code
836: (p_org_unit_rec.relationship_type_code)) THEN
837: p_lookup_tbl(p_ou_count_rec.lookup_count).valid_flag := 'N';
838: RAISE FND_API.G_EXC_ERROR;
839: ELSE
840: p_lookup_tbl(p_ou_count_rec.lookup_count).valid_flag := 'Y';
841: END IF;
842: END IF;
843: END IF;
844: --
845: -- Added by sk for bug 2232880.
846: l_record_found := FALSE;
847: IF ( (p_called_from_grp <> FND_API.G_TRUE) AND
848: (p_org_unit_rec.instance_ou_id IS NULL OR
849: p_org_unit_rec.instance_ou_id = fnd_api.g_miss_num) )
850: THEN
851: BEGIN
845: -- Added by sk for bug 2232880.
846: l_record_found := FALSE;
847: IF ( (p_called_from_grp <> FND_API.G_TRUE) AND
848: (p_org_unit_rec.instance_ou_id IS NULL OR
849: p_org_unit_rec.instance_ou_id = fnd_api.g_miss_num) )
850: THEN
851: BEGIN
852: SELECT instance_ou_id,
853: object_version_number
867: END IF;
868:
869: IF l_record_found
870: THEN
871: IF p_org_unit_rec.active_end_date = fnd_api.g_miss_date
872: THEN
873: p_org_unit_rec.active_end_date := NULL;
874: END IF;
875: csi_organization_unit_pvt.update_organization_unit
873: p_org_unit_rec.active_end_date := NULL;
874: END IF;
875: csi_organization_unit_pvt.update_organization_unit
876: ( p_api_version => p_api_version
877: ,p_commit => fnd_api.g_false
878: ,p_init_msg_list => p_init_msg_list
879: ,p_validation_level => p_validation_level
880: ,p_org_unit_rec => p_org_unit_rec
881: ,p_txn_rec => p_txn_rec
886: ,p_ou_count_rec => l_ou_count_rec
887: ,p_ou_id_tbl => l_ou_id_tbl
888: );
889:
890: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
891: l_msg_index := 1;
892: l_msg_count := x_msg_count;
893: WHILE l_msg_count > 0 LOOP
894: x_msg_data := FND_MSG_PUB.GET
892: l_msg_count := x_msg_count;
893: WHILE l_msg_count > 0 LOOP
894: x_msg_data := FND_MSG_PUB.GET
895: ( l_msg_index,
896: FND_API.G_FALSE );
897:
898: csi_gen_utility_pvt.put_line( ' Failed Pvt:update_organization_unit..');
899: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
900: l_msg_index := l_msg_index + 1;
899: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
900: l_msg_index := l_msg_index + 1;
901: l_msg_count := l_msg_count - 1;
902: END LOOP;
903: RAISE FND_API.G_EXC_ERROR;
904: END IF;
905: ELSE
906: -- If the instance_ou_id passed is null then generate from sequence
907: -- and check if the value exists . If exists then generate again from the sequence
906: -- If the instance_ou_id passed is null then generate from sequence
907: -- and check if the value exists . If exists then generate again from the sequence
908: -- till we get a value that does not exist
909: IF l_instance_ou_id IS NULL OR
910: l_instance_ou_id = FND_API.G_MISS_NUM THEN
911: l_instance_ou_id := csi_org_unit_vld_pvt.get_instance_ou_id;
912: p_org_unit_rec.instance_ou_id := l_instance_ou_id;
913: WHILE NOT(csi_org_unit_vld_pvt.Is_valid_instance_ou_id
914: (l_instance_ou_id))
919: ELSE
920: -- Validate instance_ou_id
921: IF NOT(csi_org_unit_vld_pvt.Is_valid_instance_ou_id
922: (p_org_unit_rec.instance_ou_id)) THEN
923: RAISE FND_API.G_EXC_ERROR;
924: END IF;
925: END IF;
926: --
927: -- Validate alternate_pk_exists
924: END IF;
925: END IF;
926: --
927: -- Validate alternate_pk_exists
928: IF p_called_from_grp <> FND_API.G_TRUE THEN
929: IF NOT (csi_org_unit_vld_pvt.Alternate_PK_exists
930: (p_org_unit_rec.instance_id
931: ,p_org_unit_rec.operating_unit_id
932: ,p_org_unit_rec.relationship_type_code
930: (p_org_unit_rec.instance_id
931: ,p_org_unit_rec.operating_unit_id
932: ,p_org_unit_rec.relationship_type_code
933: )) THEN
934: RAISE FND_API.G_EXC_ERROR;
935: END IF;
936: END IF;
937: --
938: -- End addition by sk for bug 2232880.
936: END IF;
937: --
938: -- End addition by sk for bug 2232880.
939: -- Create a row in csi_i_org_assignments table
940: IF p_called_from_grp <> FND_API.G_TRUE THEN
941: CSI_I_ORG_ASSIGNMENTS_PKG.Insert_Row(
942: l_instance_ou_id
943: ,p_org_unit_rec.instance_id
944: ,p_org_unit_rec.operating_unit_id
974: -- Call create_transaction to create txn log
975: CSI_TRANSACTIONS_PVT.Create_transaction
976: (
977: p_api_version => p_api_version
978: ,p_commit => fnd_api.g_false
979: ,p_init_msg_list => p_init_msg_list
980: ,p_validation_level => p_validation_level
981: ,p_Success_If_Exists_Flag => 'Y'
982: ,p_transaction_rec => p_txn_rec
984: ,x_msg_count => x_msg_count
985: ,x_msg_data => x_msg_data
986: );
987:
988: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
989: l_msg_index := 1;
990: l_msg_count := x_msg_count;
991: WHILE l_msg_count > 0 LOOP
992: x_msg_data := FND_MSG_PUB.GET
990: l_msg_count := x_msg_count;
991: WHILE l_msg_count > 0 LOOP
992: x_msg_data := FND_MSG_PUB.GET
993: (l_msg_index,
994: FND_API.G_FALSE );
995:
996: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
997: l_msg_index := l_msg_index + 1;
998: l_msg_count := l_msg_count - 1;
996: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
997: l_msg_index := l_msg_index + 1;
998: l_msg_count := l_msg_count - 1;
999: END LOOP;
1000: RAISE FND_API.G_EXC_ERROR;
1001: END IF;
1002:
1003:
1004: -- Get a unique org_assignment history number from the sequence
1061: END IF; -- called from grp check
1062:
1063: END IF; -- Added by sk for bug 2232880.
1064: -- Standard check of p_commit
1065: IF FND_API.To_Boolean( p_commit ) THEN
1066: COMMIT WORK;
1067: END IF;
1068: -- End of API body
1069: -- Standard call to get message count and if count is get message info.
1074:
1075:
1076: EXCEPTION
1077:
1078: WHEN FND_API.G_EXC_ERROR THEN
1079: ROLLBACK TO create_organization_unit;
1080: x_return_status := FND_API.G_RET_STS_ERROR ;
1081: FND_MSG_PUB.Count_And_Get
1082: ( p_count => x_msg_count,
1076: EXCEPTION
1077:
1078: WHEN FND_API.G_EXC_ERROR THEN
1079: ROLLBACK TO create_organization_unit;
1080: x_return_status := FND_API.G_RET_STS_ERROR ;
1081: FND_MSG_PUB.Count_And_Get
1082: ( p_count => x_msg_count,
1083: p_data => x_msg_data
1084: );
1082: ( p_count => x_msg_count,
1083: p_data => x_msg_data
1084: );
1085:
1086: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1087: ROLLBACK TO create_organization_unit;
1088: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1089: FND_MSG_PUB.Count_And_Get
1090: ( p_count => x_msg_count,
1084: );
1085:
1086: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1087: ROLLBACK TO create_organization_unit;
1088: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1089: FND_MSG_PUB.Count_And_Get
1090: ( p_count => x_msg_count,
1091: p_data => x_msg_data
1092: );
1092: );
1093:
1094: WHEN OTHERS THEN
1095: ROLLBACK TO create_organization_unit;
1096: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1097:
1098: IF FND_MSG_PUB.Check_Msg_Level
1099: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1100: THEN
1212: -- Standard Start of API savepoint
1213: SAVEPOINT update_organization_unit;
1214:
1215: -- Standard call to check for call compatibility.
1216: IF NOT FND_API.Compatible_API_Call (l_api_version,
1217: p_api_version,
1218: l_api_name ,
1219: g_pkg_name)
1220: THEN
1217: p_api_version,
1218: l_api_name ,
1219: g_pkg_name)
1220: THEN
1221: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1222: END IF;
1223:
1224: -- Initialize message list if p_init_msg_list is set to TRUE.
1225: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1221: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1222: END IF;
1223:
1224: -- Initialize message list if p_init_msg_list is set to TRUE.
1225: IF FND_API.to_Boolean( p_init_msg_list ) THEN
1226: FND_MSG_PUB.initialize;
1227: END IF;
1228:
1229: -- Initialize API return status to success
1226: FND_MSG_PUB.initialize;
1227: END IF;
1228:
1229: -- Initialize API return status to success
1230: x_return_status := FND_API.G_RET_STS_SUCCESS;
1231:
1232: -- Check the profile option debug_level for debug message reporting
1233: l_debug_level:=fnd_profile.value('CSI_DEBUG_LEVEL');
1234:
1254: --
1255: -- Initialize the Instance count
1256: --
1257: IF p_ou_count_rec.ou_count IS NULL OR
1258: p_ou_count_rec.ou_count = FND_API.G_MISS_NUM THEN
1259: p_ou_count_rec.ou_count := 0;
1260: END IF;
1261: --
1262: IF p_ou_count_rec.lookup_count IS NULL OR
1259: p_ou_count_rec.ou_count := 0;
1260: END IF;
1261: --
1262: IF p_ou_count_rec.lookup_count IS NULL OR
1263: p_ou_count_rec.lookup_count = FND_API.G_MISS_NUM THEN
1264: p_ou_count_rec.lookup_count := 0;
1265: END IF;
1266: --
1267: -- Validate instance_ou_id
1267: -- Validate instance_ou_id
1268: IF NOT(csi_org_unit_vld_pvt.Val_and_get_inst_ou_id
1269: (p_org_unit_rec.instance_ou_id,
1270: l_org_unit_rec)) THEN
1271: RAISE FND_API.G_EXC_ERROR;
1272: END IF;
1273:
1274: -- Validate object_version_number
1275: IF NOT(csi_org_unit_vld_pvt.Is_valid_obj_ver_num
1275: IF NOT(csi_org_unit_vld_pvt.Is_valid_obj_ver_num
1276: (p_org_unit_rec.object_version_number
1277: ,l_org_unit_rec.object_version_number
1278: )) THEN
1279: RAISE FND_API.G_EXC_ERROR;
1280: END IF;
1281:
1282: -- Validate if the instance is updatable
1283: IF NOT(csi_org_unit_vld_pvt.Is_Updatable(
1282: -- Validate if the instance is updatable
1283: IF NOT(csi_org_unit_vld_pvt.Is_Updatable(
1284: l_org_unit_rec.active_end_date,
1285: p_org_unit_rec.active_end_date)) THEN
1286: RAISE FND_API.G_EXC_ERROR;
1287: END IF;
1288:
1289: -- Validate instance id for which the update is related to
1290: IF NOT(csi_org_unit_vld_pvt.Is_Valid_instance_id
1293: )) THEN
1294: -- Check if it is an expire operation
1295: IF NOT(csi_org_unit_vld_pvt.Is_Expire_Op
1296: (p_org_unit_rec)) THEN
1297: RAISE FND_API.G_EXC_ERROR;
1298: END IF;
1299: END IF;
1300:
1301: -- Validate instance id
1298: END IF;
1299: END IF;
1300:
1301: -- Validate instance id
1302: IF ( p_org_unit_rec.instance_id <> FND_API.G_MISS_NUM ) THEN
1303: IF NOT(csi_org_unit_vld_pvt.Val_inst_id_for_update
1304: (p_org_unit_rec.instance_id
1305: ,l_org_unit_rec.instance_id
1306: )) THEN
1303: IF NOT(csi_org_unit_vld_pvt.Val_inst_id_for_update
1304: (p_org_unit_rec.instance_id
1305: ,l_org_unit_rec.instance_id
1306: )) THEN
1307: RAISE FND_API.G_EXC_ERROR;
1308: END IF;
1309: END IF;
1310:
1311: --
1312: --validation for the operating unit id
1313: l_valid_flag := 'Y';
1314: l_exists_flag := 'N';
1315: IF p_org_unit_rec.operating_unit_id IS NOT NULL AND
1316: p_org_unit_rec.operating_unit_id <> FND_API.G_MISS_NUM THEN
1317: IF p_ou_id_tbl.count > 0 THEN
1318: FOR ou_count in p_ou_id_tbl.FIRST .. p_ou_id_tbl.LAST
1319: LOOP
1320: IF p_ou_id_tbl(ou_count).ou_id = p_org_unit_rec.operating_unit_id
1328: IF l_valid_flag <> 'Y' THEN
1329: FND_MESSAGE.SET_NAME('CSI','CSI_API_INVALID_OPERATING_UNIT');
1330: FND_MESSAGE.SET_TOKEN('OPERATING_UNIT',p_org_unit_rec.operating_unit_id);
1331: FND_MSG_PUB.Add;
1332: RAISE fnd_api.g_exc_error;
1333: END IF;
1334: END IF;
1335: --
1336: IF l_exists_flag <> 'Y' THEN
1338: p_ou_id_tbl(p_ou_count_rec.ou_count).ou_id := p_org_unit_rec.operating_unit_id;
1339: IF NOT(csi_org_unit_vld_pvt.Is_valid_operating_unit_id
1340: (p_org_unit_rec.operating_unit_id)) THEN
1341: p_ou_id_tbl(p_ou_count_rec.ou_count).valid_flag := 'N';
1342: RAISE fnd_api.g_exc_error;
1343: ELSE
1344: p_ou_id_tbl(p_ou_count_rec.ou_count).valid_flag := 'Y';
1345: END IF;
1346: END IF;
1351: --validation for the relationship type code
1352: l_valid_flag := 'Y';
1353: l_exists_flag := 'N';
1354: IF ((p_org_unit_rec.relationship_type_code IS NOT NULL) AND
1355: (p_org_unit_rec.relationship_type_code <> FND_API.G_MISS_CHAR)) THEN
1356: IF p_lookup_tbl.count > 0 THEN
1357: FOR lookup_count in p_lookup_tbl.FIRST .. p_lookup_tbl.LAST
1358: LOOP
1359: IF p_lookup_tbl(lookup_count).lookup_code = p_org_unit_rec.relationship_type_code THEN
1366: IF l_valid_flag <> 'Y' THEN
1367: FND_MESSAGE.SET_NAME('CSI','CSI_API_INVALID_REL_TYPE_CODE');
1368: FND_MESSAGE.SET_TOKEN('RELATIONSHIP_TYPE_CODE',p_org_unit_rec.relationship_type_code);
1369: FND_MSG_PUB.Add;
1370: RAISE fnd_api.g_exc_error;
1371: END IF;
1372: END IF;
1373: --
1374: IF l_exists_flag <> 'Y' THEN
1376: p_lookup_tbl(p_ou_count_rec.lookup_count).lookup_code := p_org_unit_rec.relationship_type_code;
1377: IF NOT(csi_org_unit_vld_pvt.Is_valid_rel_type_code
1378: (p_org_unit_rec.relationship_type_code)) THEN
1379: p_lookup_tbl(p_ou_count_rec.lookup_count).valid_flag := 'N';
1380: RAISE FND_API.G_EXC_ERROR;
1381: ELSE
1382: p_lookup_tbl(p_ou_count_rec.lookup_count).valid_flag := 'Y';
1383: END IF;
1384: END IF;
1384: END IF;
1385: END IF;
1386: --
1387: -- Verify start effective date
1388: IF ( p_org_unit_rec.active_start_date <> FND_API.G_MISS_DATE) THEN
1389: IF (p_org_unit_rec.active_start_date <> l_org_unit_rec.active_start_date) THEN
1390: l_start_date := p_org_unit_rec.ACTIVE_START_DATE;
1391: IF NOT(csi_org_unit_vld_pvt.Is_StartDate_Valid
1392: (l_start_date,
1391: IF NOT(csi_org_unit_vld_pvt.Is_StartDate_Valid
1392: (l_start_date,
1393: p_org_unit_rec.ACTIVE_END_DATE ,
1394: p_org_unit_rec.INSTANCE_ID )) THEN
1395: RAISE FND_API.G_EXC_ERROR;
1396: END IF;
1397:
1398: END IF;
1399: END IF;
1398: END IF;
1399: END IF;
1400:
1401: -- Verify end effective date
1402: IF ( p_org_unit_rec.active_end_date <> FND_API.G_MISS_DATE) THEN
1403: IF p_org_unit_rec.active_end_date is NOT NULL THEN
1404: IF g_expire_flag <> 'Y' THEN
1405: IF NOT(csi_org_unit_vld_pvt.Is_EndDate_Valid
1406: (p_org_unit_rec.ACTIVE_START_DATE,
1407: p_org_unit_rec.ACTIVE_END_DATE,
1408: p_org_unit_rec.INSTANCE_ID ,
1409: p_org_unit_rec.INSTANCE_OU_ID,
1410: p_txn_rec.TRANSACTION_ID)) THEN
1411: RAISE FND_API.G_EXC_ERROR;
1412: END IF;
1413: END IF;
1414: END IF;
1415: END IF;
1415: END IF;
1416: -- srramakr Bug 3918188
1417: -- Validate alternate_pk_exists
1418: IF p_org_unit_rec.operating_unit_id IS NULL OR
1419: p_org_unit_rec.operating_unit_id = FND_API.G_MISS_NUM THEN
1420: l_operating_unit_id := l_org_unit_rec.operating_unit_id;
1421: ELSE
1422: l_operating_unit_id := p_org_unit_rec.operating_unit_id;
1423: END IF;
1422: l_operating_unit_id := p_org_unit_rec.operating_unit_id;
1423: END IF;
1424: --
1425: IF p_org_unit_rec.relationship_type_code IS NULL OR
1426: p_org_unit_rec.relationship_type_code = FND_API.G_MISS_CHAR THEN
1427: l_rel_type_code := l_org_unit_rec.relationship_type_code;
1428: ELSE
1429: l_rel_type_code := p_org_unit_rec.relationship_type_code;
1430: END IF;
1434: ,p_operating_unit_id => l_operating_unit_id
1435: ,p_relationship_type_code => l_rel_type_code
1436: ,p_instance_ou_id => p_org_unit_rec.INSTANCE_OU_ID
1437: )) THEN
1438: RAISE FND_API.G_EXC_ERROR;
1439: END IF;
1440: -- End of 3918188
1441: -- Validate alternate_pk_exists
1442: /**** IF (p_org_unit_rec.operating_unit_id IS NULL) AND
1445: (l_org_unit_rec.instance_id
1446: ,l_org_unit_rec.operating_unit_id
1447: ,l_org_unit_rec.relationship_type_code
1448: )) THEN
1449: RAISE FND_API.G_EXC_ERROR;
1450: END IF;
1451: ELSIF (p_org_unit_rec.operating_unit_id IS NULL) AND
1452: (p_org_unit_rec.relationship_type_code IS NOT NULL) THEN
1453: IF NOT (csi_org_unit_vld_pvt.Alternate_PK_exists
1454: (l_org_unit_rec.instance_id
1455: ,l_org_unit_rec.operating_unit_id
1456: ,p_org_unit_rec.relationship_type_code
1457: )) THEN
1458: RAISE FND_API.G_EXC_ERROR;
1459: END IF;
1460: ELSIF (p_org_unit_rec.operating_unit_id IS NOT NULL) AND
1461: (p_org_unit_rec.relationship_type_code IS NULL) THEN
1462: IF NOT (csi_org_unit_vld_pvt.Alternate_PK_exists
1463: (l_org_unit_rec.instance_id
1464: ,p_org_unit_rec.operating_unit_id
1465: ,l_org_unit_rec.relationship_type_code
1466: )) THEN
1467: RAISE FND_API.G_EXC_ERROR;
1468: END IF;
1469: END IF;
1470: *****/
1471: -- Get the new object version number
1494: ,p_org_unit_rec.attribute12
1495: ,p_org_unit_rec.attribute13
1496: ,p_org_unit_rec.attribute14
1497: ,p_org_unit_rec.attribute15
1498: ,fnd_api.g_miss_num -- fnd_global.user_id
1499: ,fnd_api.g_miss_date
1500: ,fnd_global.user_id
1501: ,sysdate
1502: ,fnd_global.user_id
1495: ,p_org_unit_rec.attribute13
1496: ,p_org_unit_rec.attribute14
1497: ,p_org_unit_rec.attribute15
1498: ,fnd_api.g_miss_num -- fnd_global.user_id
1499: ,fnd_api.g_miss_date
1500: ,fnd_global.user_id
1501: ,sysdate
1502: ,fnd_global.user_id
1503: ,l_org_unit_rec.object_version_number
1506: -- Call create_transaction to create txn log
1507: CSI_TRANSACTIONS_PVT.Create_transaction
1508: (
1509: p_api_version => p_api_version
1510: ,p_commit => fnd_api.g_false
1511: ,p_init_msg_list => p_init_msg_list
1512: ,p_validation_level => p_validation_level
1513: ,p_Success_If_Exists_Flag => 'Y'
1514: ,P_transaction_rec => p_txn_rec
1516: ,x_msg_count => x_msg_count
1517: ,x_msg_data => x_msg_data
1518: );
1519:
1520: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
1521: l_msg_index := 1;
1522: l_msg_count := x_msg_count;
1523: WHILE l_msg_count > 0 LOOP
1524: x_msg_data := FND_MSG_PUB.GET
1522: l_msg_count := x_msg_count;
1523: WHILE l_msg_count > 0 LOOP
1524: x_msg_data := FND_MSG_PUB.GET
1525: (l_msg_index,
1526: FND_API.G_FALSE );
1527:
1528: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
1529: l_msg_index := l_msg_index + 1;
1530: l_msg_count := l_msg_count - 1;
1528: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
1529: l_msg_index := l_msg_index + 1;
1530: l_msg_count := l_msg_count - 1;
1531: END LOOP;
1532: RAISE FND_API.G_EXC_ERROR;
1533: END IF;
1534:
1535: -- Get a unique org_assignment history number from the sequence
1536: l_csi_i_org_assign_h_id := csi_org_unit_vld_pvt.get_cis_i_org_assign_h_id;
1537:
1538: -- Get full dump frequency from CSI_INSTALL_PARAMETERS
1539: l_dump_frequency := csi_org_unit_vld_pvt.get_full_dump_frequency;
1540: IF l_dump_frequency IS NULL THEN
1541: RAISE FND_API.G_EXC_ERROR;
1542: END IF;
1543: -- Grab the input record in a temporary record
1544: l_temp_org_unit_rec := p_org_unit_rec;
1545:
1557: IF l_org_hist_csr.full_dump_flag = 'Y'
1558: THEN
1559: csi_i_org_assignments_h_pkg.update_row(
1560: p_instance_ou_history_id => l_org_hist_id ,
1561: p_instance_ou_id => fnd_api.g_miss_num ,
1562: p_transaction_id => fnd_api.g_miss_num ,
1563: p_old_operating_unit_id => fnd_api.g_miss_num ,
1564: p_new_operating_unit_id => l_temp_org_unit_rec.operating_unit_id ,
1565: p_old_relationship_type_code => fnd_api.g_miss_char ,
1558: THEN
1559: csi_i_org_assignments_h_pkg.update_row(
1560: p_instance_ou_history_id => l_org_hist_id ,
1561: p_instance_ou_id => fnd_api.g_miss_num ,
1562: p_transaction_id => fnd_api.g_miss_num ,
1563: p_old_operating_unit_id => fnd_api.g_miss_num ,
1564: p_new_operating_unit_id => l_temp_org_unit_rec.operating_unit_id ,
1565: p_old_relationship_type_code => fnd_api.g_miss_char ,
1566: p_new_relationship_type_code => l_temp_org_unit_rec.relationship_type_code,
1559: csi_i_org_assignments_h_pkg.update_row(
1560: p_instance_ou_history_id => l_org_hist_id ,
1561: p_instance_ou_id => fnd_api.g_miss_num ,
1562: p_transaction_id => fnd_api.g_miss_num ,
1563: p_old_operating_unit_id => fnd_api.g_miss_num ,
1564: p_new_operating_unit_id => l_temp_org_unit_rec.operating_unit_id ,
1565: p_old_relationship_type_code => fnd_api.g_miss_char ,
1566: p_new_relationship_type_code => l_temp_org_unit_rec.relationship_type_code,
1567: p_old_active_start_date => fnd_api.g_miss_date ,
1561: p_instance_ou_id => fnd_api.g_miss_num ,
1562: p_transaction_id => fnd_api.g_miss_num ,
1563: p_old_operating_unit_id => fnd_api.g_miss_num ,
1564: p_new_operating_unit_id => l_temp_org_unit_rec.operating_unit_id ,
1565: p_old_relationship_type_code => fnd_api.g_miss_char ,
1566: p_new_relationship_type_code => l_temp_org_unit_rec.relationship_type_code,
1567: p_old_active_start_date => fnd_api.g_miss_date ,
1568: p_new_active_start_date => l_temp_org_unit_rec.active_start_date ,
1569: p_old_active_end_date => fnd_api.g_miss_date ,
1563: p_old_operating_unit_id => fnd_api.g_miss_num ,
1564: p_new_operating_unit_id => l_temp_org_unit_rec.operating_unit_id ,
1565: p_old_relationship_type_code => fnd_api.g_miss_char ,
1566: p_new_relationship_type_code => l_temp_org_unit_rec.relationship_type_code,
1567: p_old_active_start_date => fnd_api.g_miss_date ,
1568: p_new_active_start_date => l_temp_org_unit_rec.active_start_date ,
1569: p_old_active_end_date => fnd_api.g_miss_date ,
1570: p_new_active_end_date => l_temp_org_unit_rec.active_end_date ,
1571: p_old_context => fnd_api.g_miss_char ,
1565: p_old_relationship_type_code => fnd_api.g_miss_char ,
1566: p_new_relationship_type_code => l_temp_org_unit_rec.relationship_type_code,
1567: p_old_active_start_date => fnd_api.g_miss_date ,
1568: p_new_active_start_date => l_temp_org_unit_rec.active_start_date ,
1569: p_old_active_end_date => fnd_api.g_miss_date ,
1570: p_new_active_end_date => l_temp_org_unit_rec.active_end_date ,
1571: p_old_context => fnd_api.g_miss_char ,
1572: p_new_context => l_temp_org_unit_rec.context ,
1573: p_old_attribute1 => fnd_api.g_miss_char ,
1567: p_old_active_start_date => fnd_api.g_miss_date ,
1568: p_new_active_start_date => l_temp_org_unit_rec.active_start_date ,
1569: p_old_active_end_date => fnd_api.g_miss_date ,
1570: p_new_active_end_date => l_temp_org_unit_rec.active_end_date ,
1571: p_old_context => fnd_api.g_miss_char ,
1572: p_new_context => l_temp_org_unit_rec.context ,
1573: p_old_attribute1 => fnd_api.g_miss_char ,
1574: p_new_attribute1 => l_temp_org_unit_rec.attribute1 ,
1575: p_old_attribute2 => fnd_api.g_miss_char ,
1569: p_old_active_end_date => fnd_api.g_miss_date ,
1570: p_new_active_end_date => l_temp_org_unit_rec.active_end_date ,
1571: p_old_context => fnd_api.g_miss_char ,
1572: p_new_context => l_temp_org_unit_rec.context ,
1573: p_old_attribute1 => fnd_api.g_miss_char ,
1574: p_new_attribute1 => l_temp_org_unit_rec.attribute1 ,
1575: p_old_attribute2 => fnd_api.g_miss_char ,
1576: p_new_attribute2 => l_temp_org_unit_rec.attribute2 ,
1577: p_old_attribute3 => fnd_api.g_miss_char ,
1571: p_old_context => fnd_api.g_miss_char ,
1572: p_new_context => l_temp_org_unit_rec.context ,
1573: p_old_attribute1 => fnd_api.g_miss_char ,
1574: p_new_attribute1 => l_temp_org_unit_rec.attribute1 ,
1575: p_old_attribute2 => fnd_api.g_miss_char ,
1576: p_new_attribute2 => l_temp_org_unit_rec.attribute2 ,
1577: p_old_attribute3 => fnd_api.g_miss_char ,
1578: p_new_attribute3 => l_temp_org_unit_rec.attribute3 ,
1579: p_old_attribute4 => fnd_api.g_miss_char ,
1573: p_old_attribute1 => fnd_api.g_miss_char ,
1574: p_new_attribute1 => l_temp_org_unit_rec.attribute1 ,
1575: p_old_attribute2 => fnd_api.g_miss_char ,
1576: p_new_attribute2 => l_temp_org_unit_rec.attribute2 ,
1577: p_old_attribute3 => fnd_api.g_miss_char ,
1578: p_new_attribute3 => l_temp_org_unit_rec.attribute3 ,
1579: p_old_attribute4 => fnd_api.g_miss_char ,
1580: p_new_attribute4 => l_temp_org_unit_rec.attribute4 ,
1581: p_old_attribute5 => fnd_api.g_miss_char ,
1575: p_old_attribute2 => fnd_api.g_miss_char ,
1576: p_new_attribute2 => l_temp_org_unit_rec.attribute2 ,
1577: p_old_attribute3 => fnd_api.g_miss_char ,
1578: p_new_attribute3 => l_temp_org_unit_rec.attribute3 ,
1579: p_old_attribute4 => fnd_api.g_miss_char ,
1580: p_new_attribute4 => l_temp_org_unit_rec.attribute4 ,
1581: p_old_attribute5 => fnd_api.g_miss_char ,
1582: p_new_attribute5 => l_temp_org_unit_rec.attribute5 ,
1583: p_old_attribute6 => fnd_api.g_miss_char ,
1577: p_old_attribute3 => fnd_api.g_miss_char ,
1578: p_new_attribute3 => l_temp_org_unit_rec.attribute3 ,
1579: p_old_attribute4 => fnd_api.g_miss_char ,
1580: p_new_attribute4 => l_temp_org_unit_rec.attribute4 ,
1581: p_old_attribute5 => fnd_api.g_miss_char ,
1582: p_new_attribute5 => l_temp_org_unit_rec.attribute5 ,
1583: p_old_attribute6 => fnd_api.g_miss_char ,
1584: p_new_attribute6 => l_temp_org_unit_rec.attribute6 ,
1585: p_old_attribute7 => fnd_api.g_miss_char ,
1579: p_old_attribute4 => fnd_api.g_miss_char ,
1580: p_new_attribute4 => l_temp_org_unit_rec.attribute4 ,
1581: p_old_attribute5 => fnd_api.g_miss_char ,
1582: p_new_attribute5 => l_temp_org_unit_rec.attribute5 ,
1583: p_old_attribute6 => fnd_api.g_miss_char ,
1584: p_new_attribute6 => l_temp_org_unit_rec.attribute6 ,
1585: p_old_attribute7 => fnd_api.g_miss_char ,
1586: p_new_attribute7 => l_temp_org_unit_rec.attribute7 ,
1587: p_old_attribute8 => fnd_api.g_miss_char ,
1581: p_old_attribute5 => fnd_api.g_miss_char ,
1582: p_new_attribute5 => l_temp_org_unit_rec.attribute5 ,
1583: p_old_attribute6 => fnd_api.g_miss_char ,
1584: p_new_attribute6 => l_temp_org_unit_rec.attribute6 ,
1585: p_old_attribute7 => fnd_api.g_miss_char ,
1586: p_new_attribute7 => l_temp_org_unit_rec.attribute7 ,
1587: p_old_attribute8 => fnd_api.g_miss_char ,
1588: p_new_attribute8 => l_temp_org_unit_rec.attribute8 ,
1589: p_old_attribute9 => fnd_api.g_miss_char ,
1583: p_old_attribute6 => fnd_api.g_miss_char ,
1584: p_new_attribute6 => l_temp_org_unit_rec.attribute6 ,
1585: p_old_attribute7 => fnd_api.g_miss_char ,
1586: p_new_attribute7 => l_temp_org_unit_rec.attribute7 ,
1587: p_old_attribute8 => fnd_api.g_miss_char ,
1588: p_new_attribute8 => l_temp_org_unit_rec.attribute8 ,
1589: p_old_attribute9 => fnd_api.g_miss_char ,
1590: p_new_attribute9 => l_temp_org_unit_rec.attribute9 ,
1591: p_old_attribute10 => fnd_api.g_miss_char ,
1585: p_old_attribute7 => fnd_api.g_miss_char ,
1586: p_new_attribute7 => l_temp_org_unit_rec.attribute7 ,
1587: p_old_attribute8 => fnd_api.g_miss_char ,
1588: p_new_attribute8 => l_temp_org_unit_rec.attribute8 ,
1589: p_old_attribute9 => fnd_api.g_miss_char ,
1590: p_new_attribute9 => l_temp_org_unit_rec.attribute9 ,
1591: p_old_attribute10 => fnd_api.g_miss_char ,
1592: p_new_attribute10 => l_temp_org_unit_rec.attribute10 ,
1593: p_old_attribute11 => fnd_api.g_miss_char ,
1587: p_old_attribute8 => fnd_api.g_miss_char ,
1588: p_new_attribute8 => l_temp_org_unit_rec.attribute8 ,
1589: p_old_attribute9 => fnd_api.g_miss_char ,
1590: p_new_attribute9 => l_temp_org_unit_rec.attribute9 ,
1591: p_old_attribute10 => fnd_api.g_miss_char ,
1592: p_new_attribute10 => l_temp_org_unit_rec.attribute10 ,
1593: p_old_attribute11 => fnd_api.g_miss_char ,
1594: p_new_attribute11 => l_temp_org_unit_rec.attribute11 ,
1595: p_old_attribute12 => fnd_api.g_miss_char ,
1589: p_old_attribute9 => fnd_api.g_miss_char ,
1590: p_new_attribute9 => l_temp_org_unit_rec.attribute9 ,
1591: p_old_attribute10 => fnd_api.g_miss_char ,
1592: p_new_attribute10 => l_temp_org_unit_rec.attribute10 ,
1593: p_old_attribute11 => fnd_api.g_miss_char ,
1594: p_new_attribute11 => l_temp_org_unit_rec.attribute11 ,
1595: p_old_attribute12 => fnd_api.g_miss_char ,
1596: p_new_attribute12 => l_temp_org_unit_rec.attribute12 ,
1597: p_old_attribute13 => fnd_api.g_miss_char ,
1591: p_old_attribute10 => fnd_api.g_miss_char ,
1592: p_new_attribute10 => l_temp_org_unit_rec.attribute10 ,
1593: p_old_attribute11 => fnd_api.g_miss_char ,
1594: p_new_attribute11 => l_temp_org_unit_rec.attribute11 ,
1595: p_old_attribute12 => fnd_api.g_miss_char ,
1596: p_new_attribute12 => l_temp_org_unit_rec.attribute12 ,
1597: p_old_attribute13 => fnd_api.g_miss_char ,
1598: p_new_attribute13 => l_temp_org_unit_rec.attribute13 ,
1599: p_old_attribute14 => fnd_api.g_miss_char ,
1593: p_old_attribute11 => fnd_api.g_miss_char ,
1594: p_new_attribute11 => l_temp_org_unit_rec.attribute11 ,
1595: p_old_attribute12 => fnd_api.g_miss_char ,
1596: p_new_attribute12 => l_temp_org_unit_rec.attribute12 ,
1597: p_old_attribute13 => fnd_api.g_miss_char ,
1598: p_new_attribute13 => l_temp_org_unit_rec.attribute13 ,
1599: p_old_attribute14 => fnd_api.g_miss_char ,
1600: p_new_attribute14 => l_temp_org_unit_rec.attribute14 ,
1601: p_old_attribute15 => fnd_api.g_miss_char ,
1595: p_old_attribute12 => fnd_api.g_miss_char ,
1596: p_new_attribute12 => l_temp_org_unit_rec.attribute12 ,
1597: p_old_attribute13 => fnd_api.g_miss_char ,
1598: p_new_attribute13 => l_temp_org_unit_rec.attribute13 ,
1599: p_old_attribute14 => fnd_api.g_miss_char ,
1600: p_new_attribute14 => l_temp_org_unit_rec.attribute14 ,
1601: p_old_attribute15 => fnd_api.g_miss_char ,
1602: p_new_attribute15 => l_temp_org_unit_rec.attribute15 ,
1603: p_full_dump_flag => fnd_api.g_miss_char ,
1597: p_old_attribute13 => fnd_api.g_miss_char ,
1598: p_new_attribute13 => l_temp_org_unit_rec.attribute13 ,
1599: p_old_attribute14 => fnd_api.g_miss_char ,
1600: p_new_attribute14 => l_temp_org_unit_rec.attribute14 ,
1601: p_old_attribute15 => fnd_api.g_miss_char ,
1602: p_new_attribute15 => l_temp_org_unit_rec.attribute15 ,
1603: p_full_dump_flag => fnd_api.g_miss_char ,
1604: p_created_by => fnd_api.g_miss_num, -- fnd_global.user_id ,
1605: p_creation_date => fnd_api.g_miss_date ,
1599: p_old_attribute14 => fnd_api.g_miss_char ,
1600: p_new_attribute14 => l_temp_org_unit_rec.attribute14 ,
1601: p_old_attribute15 => fnd_api.g_miss_char ,
1602: p_new_attribute15 => l_temp_org_unit_rec.attribute15 ,
1603: p_full_dump_flag => fnd_api.g_miss_char ,
1604: p_created_by => fnd_api.g_miss_num, -- fnd_global.user_id ,
1605: p_creation_date => fnd_api.g_miss_date ,
1606: p_last_updated_by => fnd_global.user_id ,
1607: p_last_update_date => sysdate ,
1600: p_new_attribute14 => l_temp_org_unit_rec.attribute14 ,
1601: p_old_attribute15 => fnd_api.g_miss_char ,
1602: p_new_attribute15 => l_temp_org_unit_rec.attribute15 ,
1603: p_full_dump_flag => fnd_api.g_miss_char ,
1604: p_created_by => fnd_api.g_miss_num, -- fnd_global.user_id ,
1605: p_creation_date => fnd_api.g_miss_date ,
1606: p_last_updated_by => fnd_global.user_id ,
1607: p_last_update_date => sysdate ,
1608: p_last_update_login => fnd_global.user_id ,
1601: p_old_attribute15 => fnd_api.g_miss_char ,
1602: p_new_attribute15 => l_temp_org_unit_rec.attribute15 ,
1603: p_full_dump_flag => fnd_api.g_miss_char ,
1604: p_created_by => fnd_api.g_miss_num, -- fnd_global.user_id ,
1605: p_creation_date => fnd_api.g_miss_date ,
1606: p_last_updated_by => fnd_global.user_id ,
1607: p_last_update_date => sysdate ,
1608: p_last_update_login => fnd_global.user_id ,
1609: p_object_version_number => fnd_api.g_miss_num );
1605: p_creation_date => fnd_api.g_miss_date ,
1606: p_last_updated_by => fnd_global.user_id ,
1607: p_last_update_date => sysdate ,
1608: p_last_update_login => fnd_global.user_id ,
1609: p_object_version_number => fnd_api.g_miss_num );
1610:
1611: ELSE
1612:
1613: IF ( l_org_hist_csr.old_operating_unit_id IS NULL
1612:
1613: IF ( l_org_hist_csr.old_operating_unit_id IS NULL
1614: AND l_org_hist_csr.new_operating_unit_id IS NULL ) THEN
1615: IF ( l_temp_org_unit_rec.operating_unit_id = l_org_unit_rec.operating_unit_id )
1616: OR ( l_temp_org_unit_rec.operating_unit_id = fnd_api.g_miss_num ) THEN
1617: l_org_hist_csr.old_operating_unit_id := NULL;
1618: l_org_hist_csr.new_operating_unit_id := NULL;
1619: ELSE
1620: l_org_hist_csr.old_operating_unit_id := fnd_api.g_miss_num;
1616: OR ( l_temp_org_unit_rec.operating_unit_id = fnd_api.g_miss_num ) THEN
1617: l_org_hist_csr.old_operating_unit_id := NULL;
1618: l_org_hist_csr.new_operating_unit_id := NULL;
1619: ELSE
1620: l_org_hist_csr.old_operating_unit_id := fnd_api.g_miss_num;
1621: l_org_hist_csr.new_operating_unit_id := l_temp_org_unit_rec.operating_unit_id;
1622: END IF;
1623: ELSE
1624: l_org_hist_csr.old_operating_unit_id := fnd_api.g_miss_num;
1620: l_org_hist_csr.old_operating_unit_id := fnd_api.g_miss_num;
1621: l_org_hist_csr.new_operating_unit_id := l_temp_org_unit_rec.operating_unit_id;
1622: END IF;
1623: ELSE
1624: l_org_hist_csr.old_operating_unit_id := fnd_api.g_miss_num;
1625: l_org_hist_csr.new_operating_unit_id := l_temp_org_unit_rec.operating_unit_id;
1626: END IF;
1627: --
1628: IF ( l_org_hist_csr.old_relationship_type_code IS NULL
1627: --
1628: IF ( l_org_hist_csr.old_relationship_type_code IS NULL
1629: AND l_org_hist_csr.new_relationship_type_code IS NULL ) THEN
1630: IF ( l_temp_org_unit_rec.relationship_type_code = l_org_unit_rec.relationship_type_code )
1631: OR ( l_temp_org_unit_rec.relationship_type_code = fnd_api.g_miss_char ) THEN
1632: l_org_hist_csr.old_relationship_type_code := NULL;
1633: l_org_hist_csr.new_relationship_type_code := NULL;
1634: ELSE
1635: l_org_hist_csr.old_relationship_type_code := fnd_api.g_miss_char;
1631: OR ( l_temp_org_unit_rec.relationship_type_code = fnd_api.g_miss_char ) THEN
1632: l_org_hist_csr.old_relationship_type_code := NULL;
1633: l_org_hist_csr.new_relationship_type_code := NULL;
1634: ELSE
1635: l_org_hist_csr.old_relationship_type_code := fnd_api.g_miss_char;
1636: l_org_hist_csr.new_relationship_type_code := l_temp_org_unit_rec.relationship_type_code;
1637: END IF;
1638: ELSE
1639: l_org_hist_csr.old_relationship_type_code := fnd_api.g_miss_char;
1635: l_org_hist_csr.old_relationship_type_code := fnd_api.g_miss_char;
1636: l_org_hist_csr.new_relationship_type_code := l_temp_org_unit_rec.relationship_type_code;
1637: END IF;
1638: ELSE
1639: l_org_hist_csr.old_relationship_type_code := fnd_api.g_miss_char;
1640: l_org_hist_csr.new_relationship_type_code := l_temp_org_unit_rec.relationship_type_code;
1641: END IF;
1642: --
1643: IF ( l_org_hist_csr.old_active_start_date IS NULL
1642: --
1643: IF ( l_org_hist_csr.old_active_start_date IS NULL
1644: AND l_org_hist_csr.new_active_start_date IS NULL ) THEN
1645: IF ( l_temp_org_unit_rec.active_start_date = l_org_unit_rec.active_start_date )
1646: OR ( l_temp_org_unit_rec.active_start_date = fnd_api.g_miss_date ) THEN
1647: l_org_hist_csr.old_active_start_date := NULL;
1648: l_org_hist_csr.new_active_start_date := NULL;
1649: ELSE
1650: l_org_hist_csr.old_active_start_date := fnd_api.g_miss_date;
1646: OR ( l_temp_org_unit_rec.active_start_date = fnd_api.g_miss_date ) THEN
1647: l_org_hist_csr.old_active_start_date := NULL;
1648: l_org_hist_csr.new_active_start_date := NULL;
1649: ELSE
1650: l_org_hist_csr.old_active_start_date := fnd_api.g_miss_date;
1651: l_org_hist_csr.new_active_start_date := l_temp_org_unit_rec.active_start_date;
1652: END IF;
1653: ELSE
1654: l_org_hist_csr.old_active_start_date := fnd_api.g_miss_date;
1650: l_org_hist_csr.old_active_start_date := fnd_api.g_miss_date;
1651: l_org_hist_csr.new_active_start_date := l_temp_org_unit_rec.active_start_date;
1652: END IF;
1653: ELSE
1654: l_org_hist_csr.old_active_start_date := fnd_api.g_miss_date;
1655: l_org_hist_csr.new_active_start_date := l_temp_org_unit_rec.active_start_date;
1656: END IF;
1657: --
1658: IF ( l_org_hist_csr.old_active_end_date IS NULL
1657: --
1658: IF ( l_org_hist_csr.old_active_end_date IS NULL
1659: AND l_org_hist_csr.new_active_end_date IS NULL ) THEN
1660: IF ( l_temp_org_unit_rec.active_end_date = l_org_unit_rec.active_end_date )
1661: OR ( l_temp_org_unit_rec.active_end_date = fnd_api.g_miss_date ) THEN
1662: l_org_hist_csr.old_active_end_date := NULL;
1663: l_org_hist_csr.new_active_end_date := NULL;
1664: ELSE
1665: l_org_hist_csr.old_active_end_date := fnd_api.g_miss_date;
1661: OR ( l_temp_org_unit_rec.active_end_date = fnd_api.g_miss_date ) THEN
1662: l_org_hist_csr.old_active_end_date := NULL;
1663: l_org_hist_csr.new_active_end_date := NULL;
1664: ELSE
1665: l_org_hist_csr.old_active_end_date := fnd_api.g_miss_date;
1666: l_org_hist_csr.new_active_end_date := l_temp_org_unit_rec.active_end_date;
1667: END IF;
1668: ELSE
1669: l_org_hist_csr.old_active_end_date := fnd_api.g_miss_date;
1665: l_org_hist_csr.old_active_end_date := fnd_api.g_miss_date;
1666: l_org_hist_csr.new_active_end_date := l_temp_org_unit_rec.active_end_date;
1667: END IF;
1668: ELSE
1669: l_org_hist_csr.old_active_end_date := fnd_api.g_miss_date;
1670: l_org_hist_csr.new_active_end_date := l_temp_org_unit_rec.active_end_date;
1671: END IF;
1672: --
1673: IF ( l_org_hist_csr.old_context IS NULL
1672: --
1673: IF ( l_org_hist_csr.old_context IS NULL
1674: AND l_org_hist_csr.new_context IS NULL ) THEN
1675: IF ( l_temp_org_unit_rec.context = l_org_unit_rec.context )
1676: OR ( l_temp_org_unit_rec.context = fnd_api.g_miss_char ) THEN
1677: l_org_hist_csr.old_context := NULL;
1678: l_org_hist_csr.new_context := NULL;
1679: ELSE
1680: l_org_hist_csr.old_context := fnd_api.g_miss_char;
1676: OR ( l_temp_org_unit_rec.context = fnd_api.g_miss_char ) THEN
1677: l_org_hist_csr.old_context := NULL;
1678: l_org_hist_csr.new_context := NULL;
1679: ELSE
1680: l_org_hist_csr.old_context := fnd_api.g_miss_char;
1681: l_org_hist_csr.new_context := l_temp_org_unit_rec.context;
1682: END IF;
1683: ELSE
1684: l_org_hist_csr.old_context := fnd_api.g_miss_char;
1680: l_org_hist_csr.old_context := fnd_api.g_miss_char;
1681: l_org_hist_csr.new_context := l_temp_org_unit_rec.context;
1682: END IF;
1683: ELSE
1684: l_org_hist_csr.old_context := fnd_api.g_miss_char;
1685: l_org_hist_csr.new_context := l_temp_org_unit_rec.context;
1686: END IF;
1687: --
1688: IF ( l_org_hist_csr.old_attribute1 IS NULL
1687: --
1688: IF ( l_org_hist_csr.old_attribute1 IS NULL
1689: AND l_org_hist_csr.new_attribute1 IS NULL ) THEN
1690: IF ( l_temp_org_unit_rec.attribute1 = l_org_unit_rec.attribute1 )
1691: OR ( l_temp_org_unit_rec.attribute1 = fnd_api.g_miss_char ) THEN
1692: l_org_hist_csr.old_attribute1 := NULL;
1693: l_org_hist_csr.new_attribute1 := NULL;
1694: ELSE
1695: l_org_hist_csr.old_attribute1 := fnd_api.g_miss_char;
1691: OR ( l_temp_org_unit_rec.attribute1 = fnd_api.g_miss_char ) THEN
1692: l_org_hist_csr.old_attribute1 := NULL;
1693: l_org_hist_csr.new_attribute1 := NULL;
1694: ELSE
1695: l_org_hist_csr.old_attribute1 := fnd_api.g_miss_char;
1696: l_org_hist_csr.new_attribute1 := l_temp_org_unit_rec.attribute1;
1697: END IF;
1698: ELSE
1699: l_org_hist_csr.old_attribute1 := fnd_api.g_miss_char;
1695: l_org_hist_csr.old_attribute1 := fnd_api.g_miss_char;
1696: l_org_hist_csr.new_attribute1 := l_temp_org_unit_rec.attribute1;
1697: END IF;
1698: ELSE
1699: l_org_hist_csr.old_attribute1 := fnd_api.g_miss_char;
1700: l_org_hist_csr.new_attribute1 := l_temp_org_unit_rec.attribute1;
1701: END IF;
1702: --
1703: IF ( l_org_hist_csr.old_attribute2 IS NULL
1702: --
1703: IF ( l_org_hist_csr.old_attribute2 IS NULL
1704: AND l_org_hist_csr.new_attribute2 IS NULL ) THEN
1705: IF ( l_temp_org_unit_rec.attribute2 = l_org_unit_rec.attribute2 )
1706: OR ( l_temp_org_unit_rec.attribute2 = fnd_api.g_miss_char ) THEN
1707: l_org_hist_csr.old_attribute2 := NULL;
1708: l_org_hist_csr.new_attribute2 := NULL;
1709: ELSE
1710: l_org_hist_csr.old_attribute2 := fnd_api.g_miss_char;
1706: OR ( l_temp_org_unit_rec.attribute2 = fnd_api.g_miss_char ) THEN
1707: l_org_hist_csr.old_attribute2 := NULL;
1708: l_org_hist_csr.new_attribute2 := NULL;
1709: ELSE
1710: l_org_hist_csr.old_attribute2 := fnd_api.g_miss_char;
1711: l_org_hist_csr.new_attribute2 := l_temp_org_unit_rec.attribute2;
1712: END IF;
1713: ELSE
1714: l_org_hist_csr.old_attribute2 := fnd_api.g_miss_char;
1710: l_org_hist_csr.old_attribute2 := fnd_api.g_miss_char;
1711: l_org_hist_csr.new_attribute2 := l_temp_org_unit_rec.attribute2;
1712: END IF;
1713: ELSE
1714: l_org_hist_csr.old_attribute2 := fnd_api.g_miss_char;
1715: l_org_hist_csr.new_attribute2 := l_temp_org_unit_rec.attribute2;
1716: END IF;
1717: --
1718: IF ( l_org_hist_csr.old_attribute3 IS NULL
1717: --
1718: IF ( l_org_hist_csr.old_attribute3 IS NULL
1719: AND l_org_hist_csr.new_attribute3 IS NULL ) THEN
1720: IF ( l_temp_org_unit_rec.attribute3 = l_org_unit_rec.attribute3 )
1721: OR ( l_temp_org_unit_rec.attribute3 = fnd_api.g_miss_char ) THEN
1722: l_org_hist_csr.old_attribute3 := NULL;
1723: l_org_hist_csr.new_attribute3 := NULL;
1724: ELSE
1725: l_org_hist_csr.old_attribute3 := fnd_api.g_miss_char;
1721: OR ( l_temp_org_unit_rec.attribute3 = fnd_api.g_miss_char ) THEN
1722: l_org_hist_csr.old_attribute3 := NULL;
1723: l_org_hist_csr.new_attribute3 := NULL;
1724: ELSE
1725: l_org_hist_csr.old_attribute3 := fnd_api.g_miss_char;
1726: l_org_hist_csr.new_attribute3 := l_temp_org_unit_rec.attribute3;
1727: END IF;
1728: ELSE
1729: l_org_hist_csr.old_attribute3 := fnd_api.g_miss_char;
1725: l_org_hist_csr.old_attribute3 := fnd_api.g_miss_char;
1726: l_org_hist_csr.new_attribute3 := l_temp_org_unit_rec.attribute3;
1727: END IF;
1728: ELSE
1729: l_org_hist_csr.old_attribute3 := fnd_api.g_miss_char;
1730: l_org_hist_csr.new_attribute3 := l_temp_org_unit_rec.attribute3;
1731: END IF;
1732: --
1733: IF ( l_org_hist_csr.old_attribute4 IS NULL
1732: --
1733: IF ( l_org_hist_csr.old_attribute4 IS NULL
1734: AND l_org_hist_csr.new_attribute4 IS NULL ) THEN
1735: IF ( l_temp_org_unit_rec.attribute4 = l_org_unit_rec.attribute4 )
1736: OR ( l_temp_org_unit_rec.attribute4 = fnd_api.g_miss_char ) THEN
1737: l_org_hist_csr.old_attribute4 := NULL;
1738: l_org_hist_csr.new_attribute4 := NULL;
1739: ELSE
1740: l_org_hist_csr.old_attribute4 := fnd_api.g_miss_char;
1736: OR ( l_temp_org_unit_rec.attribute4 = fnd_api.g_miss_char ) THEN
1737: l_org_hist_csr.old_attribute4 := NULL;
1738: l_org_hist_csr.new_attribute4 := NULL;
1739: ELSE
1740: l_org_hist_csr.old_attribute4 := fnd_api.g_miss_char;
1741: l_org_hist_csr.new_attribute4 := l_temp_org_unit_rec.attribute4;
1742: END IF;
1743: ELSE
1744: l_org_hist_csr.old_attribute4 := fnd_api.g_miss_char;
1740: l_org_hist_csr.old_attribute4 := fnd_api.g_miss_char;
1741: l_org_hist_csr.new_attribute4 := l_temp_org_unit_rec.attribute4;
1742: END IF;
1743: ELSE
1744: l_org_hist_csr.old_attribute4 := fnd_api.g_miss_char;
1745: l_org_hist_csr.new_attribute4 := l_temp_org_unit_rec.attribute4;
1746: END IF;
1747: --
1748: IF ( l_org_hist_csr.old_attribute5 IS NULL
1747: --
1748: IF ( l_org_hist_csr.old_attribute5 IS NULL
1749: AND l_org_hist_csr.new_attribute5 IS NULL ) THEN
1750: IF ( l_temp_org_unit_rec.attribute5 = l_org_unit_rec.attribute5 )
1751: OR ( l_temp_org_unit_rec.attribute5 = fnd_api.g_miss_char ) THEN
1752: l_org_hist_csr.old_attribute5 := NULL;
1753: l_org_hist_csr.new_attribute5 := NULL;
1754: ELSE
1755: l_org_hist_csr.old_attribute5 := fnd_api.g_miss_char;
1751: OR ( l_temp_org_unit_rec.attribute5 = fnd_api.g_miss_char ) THEN
1752: l_org_hist_csr.old_attribute5 := NULL;
1753: l_org_hist_csr.new_attribute5 := NULL;
1754: ELSE
1755: l_org_hist_csr.old_attribute5 := fnd_api.g_miss_char;
1756: l_org_hist_csr.new_attribute5 := l_temp_org_unit_rec.attribute5;
1757: END IF;
1758: ELSE
1759: l_org_hist_csr.old_attribute5 := fnd_api.g_miss_char;
1755: l_org_hist_csr.old_attribute5 := fnd_api.g_miss_char;
1756: l_org_hist_csr.new_attribute5 := l_temp_org_unit_rec.attribute5;
1757: END IF;
1758: ELSE
1759: l_org_hist_csr.old_attribute5 := fnd_api.g_miss_char;
1760: l_org_hist_csr.new_attribute5 := l_temp_org_unit_rec.attribute5;
1761: END IF;
1762: --
1763: IF ( l_org_hist_csr.old_attribute6 IS NULL
1762: --
1763: IF ( l_org_hist_csr.old_attribute6 IS NULL
1764: AND l_org_hist_csr.new_attribute6 IS NULL ) THEN
1765: IF ( l_temp_org_unit_rec.attribute6 = l_org_unit_rec.attribute6 )
1766: OR ( l_temp_org_unit_rec.attribute6 = fnd_api.g_miss_char ) THEN
1767: l_org_hist_csr.old_attribute6 := NULL;
1768: l_org_hist_csr.new_attribute6 := NULL;
1769: ELSE
1770: l_org_hist_csr.old_attribute6 := fnd_api.g_miss_char;
1766: OR ( l_temp_org_unit_rec.attribute6 = fnd_api.g_miss_char ) THEN
1767: l_org_hist_csr.old_attribute6 := NULL;
1768: l_org_hist_csr.new_attribute6 := NULL;
1769: ELSE
1770: l_org_hist_csr.old_attribute6 := fnd_api.g_miss_char;
1771: l_org_hist_csr.new_attribute6 := l_temp_org_unit_rec.attribute6;
1772: END IF;
1773: ELSE
1774: l_org_hist_csr.old_attribute6 := fnd_api.g_miss_char;
1770: l_org_hist_csr.old_attribute6 := fnd_api.g_miss_char;
1771: l_org_hist_csr.new_attribute6 := l_temp_org_unit_rec.attribute6;
1772: END IF;
1773: ELSE
1774: l_org_hist_csr.old_attribute6 := fnd_api.g_miss_char;
1775: l_org_hist_csr.new_attribute6 := l_temp_org_unit_rec.attribute6;
1776: END IF;
1777: --
1778: IF ( l_org_hist_csr.old_attribute7 IS NULL
1777: --
1778: IF ( l_org_hist_csr.old_attribute7 IS NULL
1779: AND l_org_hist_csr.new_attribute7 IS NULL ) THEN
1780: IF ( l_temp_org_unit_rec.attribute7 = l_org_unit_rec.attribute7 )
1781: OR ( l_temp_org_unit_rec.attribute7 = fnd_api.g_miss_char ) THEN
1782: l_org_hist_csr.old_attribute7 := NULL;
1783: l_org_hist_csr.new_attribute7 := NULL;
1784: ELSE
1785: l_org_hist_csr.old_attribute7 := fnd_api.g_miss_char;
1781: OR ( l_temp_org_unit_rec.attribute7 = fnd_api.g_miss_char ) THEN
1782: l_org_hist_csr.old_attribute7 := NULL;
1783: l_org_hist_csr.new_attribute7 := NULL;
1784: ELSE
1785: l_org_hist_csr.old_attribute7 := fnd_api.g_miss_char;
1786: l_org_hist_csr.new_attribute7 := l_temp_org_unit_rec.attribute7;
1787: END IF;
1788: ELSE
1789: l_org_hist_csr.old_attribute7 := fnd_api.g_miss_char;
1785: l_org_hist_csr.old_attribute7 := fnd_api.g_miss_char;
1786: l_org_hist_csr.new_attribute7 := l_temp_org_unit_rec.attribute7;
1787: END IF;
1788: ELSE
1789: l_org_hist_csr.old_attribute7 := fnd_api.g_miss_char;
1790: l_org_hist_csr.new_attribute7 := l_temp_org_unit_rec.attribute7;
1791: END IF;
1792: --
1793: IF ( l_org_hist_csr.old_attribute8 IS NULL
1792: --
1793: IF ( l_org_hist_csr.old_attribute8 IS NULL
1794: AND l_org_hist_csr.new_attribute8 IS NULL ) THEN
1795: IF ( l_temp_org_unit_rec.attribute8 = l_org_unit_rec.attribute8 )
1796: OR ( l_temp_org_unit_rec.attribute8 = fnd_api.g_miss_char ) THEN
1797: l_org_hist_csr.old_attribute8 := NULL;
1798: l_org_hist_csr.new_attribute8 := NULL;
1799: ELSE
1800: l_org_hist_csr.old_attribute8 := fnd_api.g_miss_char;
1796: OR ( l_temp_org_unit_rec.attribute8 = fnd_api.g_miss_char ) THEN
1797: l_org_hist_csr.old_attribute8 := NULL;
1798: l_org_hist_csr.new_attribute8 := NULL;
1799: ELSE
1800: l_org_hist_csr.old_attribute8 := fnd_api.g_miss_char;
1801: l_org_hist_csr.new_attribute8 := l_temp_org_unit_rec.attribute8;
1802: END IF;
1803: ELSE
1804: l_org_hist_csr.old_attribute8 := fnd_api.g_miss_char;
1800: l_org_hist_csr.old_attribute8 := fnd_api.g_miss_char;
1801: l_org_hist_csr.new_attribute8 := l_temp_org_unit_rec.attribute8;
1802: END IF;
1803: ELSE
1804: l_org_hist_csr.old_attribute8 := fnd_api.g_miss_char;
1805: l_org_hist_csr.new_attribute8 := l_temp_org_unit_rec.attribute8;
1806: END IF;
1807: --
1808: IF ( l_org_hist_csr.old_attribute9 IS NULL
1807: --
1808: IF ( l_org_hist_csr.old_attribute9 IS NULL
1809: AND l_org_hist_csr.new_attribute9 IS NULL ) THEN
1810: IF ( l_temp_org_unit_rec.attribute9 = l_org_unit_rec.attribute9 )
1811: OR ( l_temp_org_unit_rec.attribute9 = fnd_api.g_miss_char ) THEN
1812: l_org_hist_csr.old_attribute9 := NULL;
1813: l_org_hist_csr.new_attribute9 := NULL;
1814: ELSE
1815: l_org_hist_csr.old_attribute9 := fnd_api.g_miss_char;
1811: OR ( l_temp_org_unit_rec.attribute9 = fnd_api.g_miss_char ) THEN
1812: l_org_hist_csr.old_attribute9 := NULL;
1813: l_org_hist_csr.new_attribute9 := NULL;
1814: ELSE
1815: l_org_hist_csr.old_attribute9 := fnd_api.g_miss_char;
1816: l_org_hist_csr.new_attribute9 := l_temp_org_unit_rec.attribute9;
1817: END IF;
1818: ELSE
1819: l_org_hist_csr.old_attribute9 := fnd_api.g_miss_char;
1815: l_org_hist_csr.old_attribute9 := fnd_api.g_miss_char;
1816: l_org_hist_csr.new_attribute9 := l_temp_org_unit_rec.attribute9;
1817: END IF;
1818: ELSE
1819: l_org_hist_csr.old_attribute9 := fnd_api.g_miss_char;
1820: l_org_hist_csr.new_attribute9 := l_temp_org_unit_rec.attribute9;
1821: END IF;
1822: --
1823: IF ( l_org_hist_csr.old_attribute10 IS NULL
1822: --
1823: IF ( l_org_hist_csr.old_attribute10 IS NULL
1824: AND l_org_hist_csr.new_attribute10 IS NULL ) THEN
1825: IF ( l_temp_org_unit_rec.attribute10 = l_org_unit_rec.attribute10 )
1826: OR ( l_temp_org_unit_rec.attribute10 = fnd_api.g_miss_char ) THEN
1827: l_org_hist_csr.old_attribute10 := NULL;
1828: l_org_hist_csr.new_attribute10 := NULL;
1829: ELSE
1830: l_org_hist_csr.old_attribute10 := fnd_api.g_miss_char;
1826: OR ( l_temp_org_unit_rec.attribute10 = fnd_api.g_miss_char ) THEN
1827: l_org_hist_csr.old_attribute10 := NULL;
1828: l_org_hist_csr.new_attribute10 := NULL;
1829: ELSE
1830: l_org_hist_csr.old_attribute10 := fnd_api.g_miss_char;
1831: l_org_hist_csr.new_attribute10 := l_temp_org_unit_rec.attribute10;
1832: END IF;
1833: ELSE
1834: l_org_hist_csr.old_attribute10 := fnd_api.g_miss_char;
1830: l_org_hist_csr.old_attribute10 := fnd_api.g_miss_char;
1831: l_org_hist_csr.new_attribute10 := l_temp_org_unit_rec.attribute10;
1832: END IF;
1833: ELSE
1834: l_org_hist_csr.old_attribute10 := fnd_api.g_miss_char;
1835: l_org_hist_csr.new_attribute10 := l_temp_org_unit_rec.attribute10;
1836: END IF;
1837: --
1838: IF ( l_org_hist_csr.old_attribute11 IS NULL
1837: --
1838: IF ( l_org_hist_csr.old_attribute11 IS NULL
1839: AND l_org_hist_csr.new_attribute11 IS NULL ) THEN
1840: IF ( l_temp_org_unit_rec.attribute11 = l_org_unit_rec.attribute11 )
1841: OR ( l_temp_org_unit_rec.attribute11 = fnd_api.g_miss_char ) THEN
1842: l_org_hist_csr.old_attribute11 := NULL;
1843: l_org_hist_csr.new_attribute11 := NULL;
1844: ELSE
1845: l_org_hist_csr.old_attribute11 := fnd_api.g_miss_char;
1841: OR ( l_temp_org_unit_rec.attribute11 = fnd_api.g_miss_char ) THEN
1842: l_org_hist_csr.old_attribute11 := NULL;
1843: l_org_hist_csr.new_attribute11 := NULL;
1844: ELSE
1845: l_org_hist_csr.old_attribute11 := fnd_api.g_miss_char;
1846: l_org_hist_csr.new_attribute11 := l_temp_org_unit_rec.attribute11;
1847: END IF;
1848: ELSE
1849: l_org_hist_csr.old_attribute11 := fnd_api.g_miss_char;
1845: l_org_hist_csr.old_attribute11 := fnd_api.g_miss_char;
1846: l_org_hist_csr.new_attribute11 := l_temp_org_unit_rec.attribute11;
1847: END IF;
1848: ELSE
1849: l_org_hist_csr.old_attribute11 := fnd_api.g_miss_char;
1850: l_org_hist_csr.new_attribute11 := l_temp_org_unit_rec.attribute11;
1851: END IF;
1852: --
1853: IF ( l_org_hist_csr.old_attribute12 IS NULL
1852: --
1853: IF ( l_org_hist_csr.old_attribute12 IS NULL
1854: AND l_org_hist_csr.new_attribute12 IS NULL ) THEN
1855: IF ( l_temp_org_unit_rec.attribute12 = l_org_unit_rec.attribute12 )
1856: OR ( l_temp_org_unit_rec.attribute12 = fnd_api.g_miss_char ) THEN
1857: l_org_hist_csr.old_attribute12 := NULL;
1858: l_org_hist_csr.new_attribute12 := NULL;
1859: ELSE
1860: l_org_hist_csr.old_attribute12 := fnd_api.g_miss_char;
1856: OR ( l_temp_org_unit_rec.attribute12 = fnd_api.g_miss_char ) THEN
1857: l_org_hist_csr.old_attribute12 := NULL;
1858: l_org_hist_csr.new_attribute12 := NULL;
1859: ELSE
1860: l_org_hist_csr.old_attribute12 := fnd_api.g_miss_char;
1861: l_org_hist_csr.new_attribute12 := l_temp_org_unit_rec.attribute12;
1862: END IF;
1863: ELSE
1864: l_org_hist_csr.old_attribute12 := fnd_api.g_miss_char;
1860: l_org_hist_csr.old_attribute12 := fnd_api.g_miss_char;
1861: l_org_hist_csr.new_attribute12 := l_temp_org_unit_rec.attribute12;
1862: END IF;
1863: ELSE
1864: l_org_hist_csr.old_attribute12 := fnd_api.g_miss_char;
1865: l_org_hist_csr.new_attribute12 := l_temp_org_unit_rec.attribute12;
1866: END IF;
1867: --
1868: IF ( l_org_hist_csr.old_attribute13 IS NULL
1867: --
1868: IF ( l_org_hist_csr.old_attribute13 IS NULL
1869: AND l_org_hist_csr.new_attribute13 IS NULL ) THEN
1870: IF ( l_temp_org_unit_rec.attribute13 = l_org_unit_rec.attribute13 )
1871: OR ( l_temp_org_unit_rec.attribute13 = fnd_api.g_miss_char ) THEN
1872: l_org_hist_csr.old_attribute13 := NULL;
1873: l_org_hist_csr.new_attribute13 := NULL;
1874: ELSE
1875: l_org_hist_csr.old_attribute13 := fnd_api.g_miss_char;
1871: OR ( l_temp_org_unit_rec.attribute13 = fnd_api.g_miss_char ) THEN
1872: l_org_hist_csr.old_attribute13 := NULL;
1873: l_org_hist_csr.new_attribute13 := NULL;
1874: ELSE
1875: l_org_hist_csr.old_attribute13 := fnd_api.g_miss_char;
1876: l_org_hist_csr.new_attribute13 := l_temp_org_unit_rec.attribute13;
1877: END IF;
1878: ELSE
1879: l_org_hist_csr.old_attribute13 := fnd_api.g_miss_char;
1875: l_org_hist_csr.old_attribute13 := fnd_api.g_miss_char;
1876: l_org_hist_csr.new_attribute13 := l_temp_org_unit_rec.attribute13;
1877: END IF;
1878: ELSE
1879: l_org_hist_csr.old_attribute13 := fnd_api.g_miss_char;
1880: l_org_hist_csr.new_attribute13 := l_temp_org_unit_rec.attribute13;
1881: END IF;
1882: --
1883: IF ( l_org_hist_csr.old_attribute14 IS NULL
1882: --
1883: IF ( l_org_hist_csr.old_attribute14 IS NULL
1884: AND l_org_hist_csr.new_attribute14 IS NULL ) THEN
1885: IF ( l_temp_org_unit_rec.attribute14 = l_org_unit_rec.attribute14 )
1886: OR ( l_temp_org_unit_rec.attribute14 = fnd_api.g_miss_char ) THEN
1887: l_org_hist_csr.old_attribute14 := NULL;
1888: l_org_hist_csr.new_attribute14 := NULL;
1889: ELSE
1890: l_org_hist_csr.old_attribute14 := fnd_api.g_miss_char;
1886: OR ( l_temp_org_unit_rec.attribute14 = fnd_api.g_miss_char ) THEN
1887: l_org_hist_csr.old_attribute14 := NULL;
1888: l_org_hist_csr.new_attribute14 := NULL;
1889: ELSE
1890: l_org_hist_csr.old_attribute14 := fnd_api.g_miss_char;
1891: l_org_hist_csr.new_attribute14 := l_temp_org_unit_rec.attribute14;
1892: END IF;
1893: ELSE
1894: l_org_hist_csr.old_attribute14 := fnd_api.g_miss_char;
1890: l_org_hist_csr.old_attribute14 := fnd_api.g_miss_char;
1891: l_org_hist_csr.new_attribute14 := l_temp_org_unit_rec.attribute14;
1892: END IF;
1893: ELSE
1894: l_org_hist_csr.old_attribute14 := fnd_api.g_miss_char;
1895: l_org_hist_csr.new_attribute14 := l_temp_org_unit_rec.attribute14;
1896: END IF;
1897: --
1898: IF ( l_org_hist_csr.old_attribute15 IS NULL
1897: --
1898: IF ( l_org_hist_csr.old_attribute15 IS NULL
1899: AND l_org_hist_csr.new_attribute15 IS NULL ) THEN
1900: IF ( l_temp_org_unit_rec.attribute15 = l_org_unit_rec.attribute15 )
1901: OR ( l_temp_org_unit_rec.attribute15 = fnd_api.g_miss_char ) THEN
1902: l_org_hist_csr.old_attribute15 := NULL;
1903: l_org_hist_csr.new_attribute15 := NULL;
1904: ELSE
1905: l_org_hist_csr.old_attribute15 := fnd_api.g_miss_char;
1901: OR ( l_temp_org_unit_rec.attribute15 = fnd_api.g_miss_char ) THEN
1902: l_org_hist_csr.old_attribute15 := NULL;
1903: l_org_hist_csr.new_attribute15 := NULL;
1904: ELSE
1905: l_org_hist_csr.old_attribute15 := fnd_api.g_miss_char;
1906: l_org_hist_csr.new_attribute15 := l_temp_org_unit_rec.attribute15;
1907: END IF;
1908: ELSE
1909: l_org_hist_csr.old_attribute15 := fnd_api.g_miss_char;
1905: l_org_hist_csr.old_attribute15 := fnd_api.g_miss_char;
1906: l_org_hist_csr.new_attribute15 := l_temp_org_unit_rec.attribute15;
1907: END IF;
1908: ELSE
1909: l_org_hist_csr.old_attribute15 := fnd_api.g_miss_char;
1910: l_org_hist_csr.new_attribute15 := l_temp_org_unit_rec.attribute15;
1911: END IF;
1912: --
1913:
1912: --
1913:
1914: csi_i_org_assignments_h_pkg.update_row(
1915: p_instance_ou_history_id => l_org_hist_id ,
1916: p_instance_ou_id => fnd_api.g_miss_num ,
1917: p_transaction_id => fnd_api.g_miss_num ,
1918: p_old_operating_unit_id => l_org_hist_csr.old_operating_unit_id ,
1919: p_new_operating_unit_id => l_org_hist_csr.new_operating_unit_id ,
1920: p_old_relationship_type_code => l_org_hist_csr.old_relationship_type_code ,
1913:
1914: csi_i_org_assignments_h_pkg.update_row(
1915: p_instance_ou_history_id => l_org_hist_id ,
1916: p_instance_ou_id => fnd_api.g_miss_num ,
1917: p_transaction_id => fnd_api.g_miss_num ,
1918: p_old_operating_unit_id => l_org_hist_csr.old_operating_unit_id ,
1919: p_new_operating_unit_id => l_org_hist_csr.new_operating_unit_id ,
1920: p_old_relationship_type_code => l_org_hist_csr.old_relationship_type_code ,
1921: p_new_relationship_type_code => l_org_hist_csr.new_relationship_type_code,
1954: p_old_attribute14 => l_org_hist_csr.old_attribute14 ,
1955: p_new_attribute14 => l_org_hist_csr.new_attribute14 ,
1956: p_old_attribute15 => l_org_hist_csr.old_attribute15 ,
1957: p_new_attribute15 => l_org_hist_csr.new_attribute15 ,
1958: p_full_dump_flag => fnd_api.g_miss_char ,
1959: p_created_by => fnd_api.g_miss_num ,
1960: p_creation_date => fnd_api.g_miss_date ,
1961: p_last_updated_by => fnd_global.user_id ,
1962: p_last_update_date => sysdate ,
1955: p_new_attribute14 => l_org_hist_csr.new_attribute14 ,
1956: p_old_attribute15 => l_org_hist_csr.old_attribute15 ,
1957: p_new_attribute15 => l_org_hist_csr.new_attribute15 ,
1958: p_full_dump_flag => fnd_api.g_miss_char ,
1959: p_created_by => fnd_api.g_miss_num ,
1960: p_creation_date => fnd_api.g_miss_date ,
1961: p_last_updated_by => fnd_global.user_id ,
1962: p_last_update_date => sysdate ,
1963: p_last_update_login => fnd_global.user_id ,
1956: p_old_attribute15 => l_org_hist_csr.old_attribute15 ,
1957: p_new_attribute15 => l_org_hist_csr.new_attribute15 ,
1958: p_full_dump_flag => fnd_api.g_miss_char ,
1959: p_created_by => fnd_api.g_miss_num ,
1960: p_creation_date => fnd_api.g_miss_date ,
1961: p_last_updated_by => fnd_global.user_id ,
1962: p_last_update_date => sysdate ,
1963: p_last_update_login => fnd_global.user_id ,
1964: p_object_version_number => fnd_api.g_miss_num );
1960: p_creation_date => fnd_api.g_miss_date ,
1961: p_last_updated_by => fnd_global.user_id ,
1962: p_last_update_date => sysdate ,
1963: p_last_update_login => fnd_global.user_id ,
1964: p_object_version_number => fnd_api.g_miss_num );
1965: END IF;
1966: EXCEPTION
1967: WHEN NO_DATA_FOUND THEN
1968:
1970:
1971: l_dump_frequency_flag := 'Y';
1972: -- Grab the input record in a temporary record
1973: l_temp_org_unit_rec := p_org_unit_rec;
1974: IF (p_org_unit_rec.OPERATING_UNIT_ID = FND_API.G_MISS_NUM) THEN
1975: l_temp_org_unit_rec.OPERATING_UNIT_ID := l_org_unit_rec.OPERATING_UNIT_ID;
1976: END IF;
1977:
1978: IF (p_org_unit_rec.RELATIONSHIP_TYPE_CODE = FND_API.G_MISS_CHAR) THEN
1974: IF (p_org_unit_rec.OPERATING_UNIT_ID = FND_API.G_MISS_NUM) THEN
1975: l_temp_org_unit_rec.OPERATING_UNIT_ID := l_org_unit_rec.OPERATING_UNIT_ID;
1976: END IF;
1977:
1978: IF (p_org_unit_rec.RELATIONSHIP_TYPE_CODE = FND_API.G_MISS_CHAR) THEN
1979: l_temp_org_unit_rec.RELATIONSHIP_TYPE_CODE := l_org_unit_rec.RELATIONSHIP_TYPE_CODE;
1980: END IF;
1981:
1982: IF (p_org_unit_rec.ACTIVE_START_DATE = FND_API.G_MISS_DATE) THEN
1978: IF (p_org_unit_rec.RELATIONSHIP_TYPE_CODE = FND_API.G_MISS_CHAR) THEN
1979: l_temp_org_unit_rec.RELATIONSHIP_TYPE_CODE := l_org_unit_rec.RELATIONSHIP_TYPE_CODE;
1980: END IF;
1981:
1982: IF (p_org_unit_rec.ACTIVE_START_DATE = FND_API.G_MISS_DATE) THEN
1983: l_temp_org_unit_rec.ACTIVE_START_DATE := l_org_unit_rec.ACTIVE_START_DATE;
1984: END IF;
1985:
1986: IF (p_org_unit_rec.ACTIVE_END_DATE = FND_API.G_MISS_DATE) THEN
1982: IF (p_org_unit_rec.ACTIVE_START_DATE = FND_API.G_MISS_DATE) THEN
1983: l_temp_org_unit_rec.ACTIVE_START_DATE := l_org_unit_rec.ACTIVE_START_DATE;
1984: END IF;
1985:
1986: IF (p_org_unit_rec.ACTIVE_END_DATE = FND_API.G_MISS_DATE) THEN
1987: l_temp_org_unit_rec.ACTIVE_END_DATE := l_org_unit_rec.ACTIVE_END_DATE;
1988: END IF;
1989:
1990: IF (p_org_unit_rec.CONTEXT = FND_API.G_MISS_CHAR) THEN
1986: IF (p_org_unit_rec.ACTIVE_END_DATE = FND_API.G_MISS_DATE) THEN
1987: l_temp_org_unit_rec.ACTIVE_END_DATE := l_org_unit_rec.ACTIVE_END_DATE;
1988: END IF;
1989:
1990: IF (p_org_unit_rec.CONTEXT = FND_API.G_MISS_CHAR) THEN
1991: l_temp_org_unit_rec.CONTEXT := l_org_unit_rec.CONTEXT;
1992: END IF;
1993:
1994: IF (p_org_unit_rec.ATTRIBUTE1 = FND_API.G_MISS_CHAR) THEN
1990: IF (p_org_unit_rec.CONTEXT = FND_API.G_MISS_CHAR) THEN
1991: l_temp_org_unit_rec.CONTEXT := l_org_unit_rec.CONTEXT;
1992: END IF;
1993:
1994: IF (p_org_unit_rec.ATTRIBUTE1 = FND_API.G_MISS_CHAR) THEN
1995: l_temp_org_unit_rec.ATTRIBUTE1 := l_org_unit_rec.ATTRIBUTE1;
1996: END IF;
1997:
1998: IF (p_org_unit_rec.ATTRIBUTE2 = FND_API.G_MISS_CHAR) THEN
1994: IF (p_org_unit_rec.ATTRIBUTE1 = FND_API.G_MISS_CHAR) THEN
1995: l_temp_org_unit_rec.ATTRIBUTE1 := l_org_unit_rec.ATTRIBUTE1;
1996: END IF;
1997:
1998: IF (p_org_unit_rec.ATTRIBUTE2 = FND_API.G_MISS_CHAR) THEN
1999: l_temp_org_unit_rec.ATTRIBUTE2 := l_org_unit_rec.ATTRIBUTE2;
2000: END IF;
2001:
2002: IF (p_org_unit_rec.ATTRIBUTE3 = FND_API.G_MISS_CHAR) THEN
1998: IF (p_org_unit_rec.ATTRIBUTE2 = FND_API.G_MISS_CHAR) THEN
1999: l_temp_org_unit_rec.ATTRIBUTE2 := l_org_unit_rec.ATTRIBUTE2;
2000: END IF;
2001:
2002: IF (p_org_unit_rec.ATTRIBUTE3 = FND_API.G_MISS_CHAR) THEN
2003: l_temp_org_unit_rec.ATTRIBUTE3 := l_org_unit_rec.ATTRIBUTE3;
2004: END IF;
2005:
2006: IF (p_org_unit_rec.ATTRIBUTE4 = FND_API.G_MISS_CHAR) THEN
2002: IF (p_org_unit_rec.ATTRIBUTE3 = FND_API.G_MISS_CHAR) THEN
2003: l_temp_org_unit_rec.ATTRIBUTE3 := l_org_unit_rec.ATTRIBUTE3;
2004: END IF;
2005:
2006: IF (p_org_unit_rec.ATTRIBUTE4 = FND_API.G_MISS_CHAR) THEN
2007: l_temp_org_unit_rec.ATTRIBUTE4 := l_org_unit_rec.ATTRIBUTE4;
2008: END IF;
2009:
2010: IF (p_org_unit_rec.ATTRIBUTE5 = FND_API.G_MISS_CHAR) THEN
2006: IF (p_org_unit_rec.ATTRIBUTE4 = FND_API.G_MISS_CHAR) THEN
2007: l_temp_org_unit_rec.ATTRIBUTE4 := l_org_unit_rec.ATTRIBUTE4;
2008: END IF;
2009:
2010: IF (p_org_unit_rec.ATTRIBUTE5 = FND_API.G_MISS_CHAR) THEN
2011: l_temp_org_unit_rec.ATTRIBUTE5 := l_org_unit_rec.ATTRIBUTE5;
2012: END IF;
2013:
2014: IF (p_org_unit_rec.ATTRIBUTE6 = FND_API.G_MISS_CHAR) THEN
2010: IF (p_org_unit_rec.ATTRIBUTE5 = FND_API.G_MISS_CHAR) THEN
2011: l_temp_org_unit_rec.ATTRIBUTE5 := l_org_unit_rec.ATTRIBUTE5;
2012: END IF;
2013:
2014: IF (p_org_unit_rec.ATTRIBUTE6 = FND_API.G_MISS_CHAR) THEN
2015: l_temp_org_unit_rec.ATTRIBUTE6 := l_org_unit_rec.ATTRIBUTE6;
2016: END IF;
2017:
2018: IF (p_org_unit_rec.ATTRIBUTE7 = FND_API.G_MISS_CHAR) THEN
2014: IF (p_org_unit_rec.ATTRIBUTE6 = FND_API.G_MISS_CHAR) THEN
2015: l_temp_org_unit_rec.ATTRIBUTE6 := l_org_unit_rec.ATTRIBUTE6;
2016: END IF;
2017:
2018: IF (p_org_unit_rec.ATTRIBUTE7 = FND_API.G_MISS_CHAR) THEN
2019: l_temp_org_unit_rec.ATTRIBUTE7 := l_org_unit_rec.ATTRIBUTE7;
2020: END IF;
2021:
2022: IF (p_org_unit_rec.ATTRIBUTE8 = FND_API.G_MISS_CHAR) THEN
2018: IF (p_org_unit_rec.ATTRIBUTE7 = FND_API.G_MISS_CHAR) THEN
2019: l_temp_org_unit_rec.ATTRIBUTE7 := l_org_unit_rec.ATTRIBUTE7;
2020: END IF;
2021:
2022: IF (p_org_unit_rec.ATTRIBUTE8 = FND_API.G_MISS_CHAR) THEN
2023: l_temp_org_unit_rec.ATTRIBUTE8 := l_org_unit_rec.ATTRIBUTE8;
2024: END IF;
2025:
2026: IF (p_org_unit_rec.ATTRIBUTE9 = FND_API.G_MISS_CHAR) THEN
2022: IF (p_org_unit_rec.ATTRIBUTE8 = FND_API.G_MISS_CHAR) THEN
2023: l_temp_org_unit_rec.ATTRIBUTE8 := l_org_unit_rec.ATTRIBUTE8;
2024: END IF;
2025:
2026: IF (p_org_unit_rec.ATTRIBUTE9 = FND_API.G_MISS_CHAR) THEN
2027: l_temp_org_unit_rec.ATTRIBUTE9 := l_org_unit_rec.ATTRIBUTE9;
2028: END IF;
2029:
2030: IF (p_org_unit_rec.ATTRIBUTE10 = FND_API.G_MISS_CHAR) THEN
2026: IF (p_org_unit_rec.ATTRIBUTE9 = FND_API.G_MISS_CHAR) THEN
2027: l_temp_org_unit_rec.ATTRIBUTE9 := l_org_unit_rec.ATTRIBUTE9;
2028: END IF;
2029:
2030: IF (p_org_unit_rec.ATTRIBUTE10 = FND_API.G_MISS_CHAR) THEN
2031: l_temp_org_unit_rec.ATTRIBUTE10 := l_org_unit_rec.ATTRIBUTE10;
2032: END IF;
2033:
2034: IF (p_org_unit_rec.ATTRIBUTE11 = FND_API.G_MISS_CHAR) THEN
2030: IF (p_org_unit_rec.ATTRIBUTE10 = FND_API.G_MISS_CHAR) THEN
2031: l_temp_org_unit_rec.ATTRIBUTE10 := l_org_unit_rec.ATTRIBUTE10;
2032: END IF;
2033:
2034: IF (p_org_unit_rec.ATTRIBUTE11 = FND_API.G_MISS_CHAR) THEN
2035: l_temp_org_unit_rec.ATTRIBUTE11 := l_org_unit_rec.ATTRIBUTE11;
2036: END IF;
2037:
2038: IF (p_org_unit_rec.ATTRIBUTE12 = FND_API.G_MISS_CHAR) THEN
2034: IF (p_org_unit_rec.ATTRIBUTE11 = FND_API.G_MISS_CHAR) THEN
2035: l_temp_org_unit_rec.ATTRIBUTE11 := l_org_unit_rec.ATTRIBUTE11;
2036: END IF;
2037:
2038: IF (p_org_unit_rec.ATTRIBUTE12 = FND_API.G_MISS_CHAR) THEN
2039: l_temp_org_unit_rec.ATTRIBUTE12 := l_org_unit_rec.ATTRIBUTE12;
2040: END IF;
2041:
2042: IF (p_org_unit_rec.ATTRIBUTE13 = FND_API.G_MISS_CHAR) THEN
2038: IF (p_org_unit_rec.ATTRIBUTE12 = FND_API.G_MISS_CHAR) THEN
2039: l_temp_org_unit_rec.ATTRIBUTE12 := l_org_unit_rec.ATTRIBUTE12;
2040: END IF;
2041:
2042: IF (p_org_unit_rec.ATTRIBUTE13 = FND_API.G_MISS_CHAR) THEN
2043: l_temp_org_unit_rec.ATTRIBUTE13 := l_org_unit_rec.ATTRIBUTE13;
2044: END IF;
2045:
2046: IF (p_org_unit_rec.ATTRIBUTE14 = FND_API.G_MISS_CHAR) THEN
2042: IF (p_org_unit_rec.ATTRIBUTE13 = FND_API.G_MISS_CHAR) THEN
2043: l_temp_org_unit_rec.ATTRIBUTE13 := l_org_unit_rec.ATTRIBUTE13;
2044: END IF;
2045:
2046: IF (p_org_unit_rec.ATTRIBUTE14 = FND_API.G_MISS_CHAR) THEN
2047: l_temp_org_unit_rec.ATTRIBUTE14 := l_org_unit_rec.ATTRIBUTE14;
2048: END IF;
2049:
2050: IF (p_org_unit_rec.ATTRIBUTE15 = FND_API.G_MISS_CHAR) THEN
2046: IF (p_org_unit_rec.ATTRIBUTE14 = FND_API.G_MISS_CHAR) THEN
2047: l_temp_org_unit_rec.ATTRIBUTE14 := l_org_unit_rec.ATTRIBUTE14;
2048: END IF;
2049:
2050: IF (p_org_unit_rec.ATTRIBUTE15 = FND_API.G_MISS_CHAR) THEN
2051: l_temp_org_unit_rec.ATTRIBUTE15 := l_org_unit_rec.ATTRIBUTE15;
2052: END IF;
2053:
2054: -- Create a row in csi_i_org_assignment history table
2108: ELSE
2109:
2110: l_dump_frequency_flag := 'N';
2111:
2112: IF (p_org_unit_rec.operating_unit_id = fnd_api.g_miss_num) OR
2113: NVL(p_org_unit_rec.operating_unit_id, fnd_api.g_miss_num) = NVL(l_org_unit_rec.operating_unit_id, fnd_api.g_miss_num) THEN
2114: l_org_units_hist_rec.old_operating_unit_id := NULL;
2115: l_org_units_hist_rec.new_operating_unit_id := NULL;
2116: ELSIF
2109:
2110: l_dump_frequency_flag := 'N';
2111:
2112: IF (p_org_unit_rec.operating_unit_id = fnd_api.g_miss_num) OR
2113: NVL(p_org_unit_rec.operating_unit_id, fnd_api.g_miss_num) = NVL(l_org_unit_rec.operating_unit_id, fnd_api.g_miss_num) THEN
2114: l_org_units_hist_rec.old_operating_unit_id := NULL;
2115: l_org_units_hist_rec.new_operating_unit_id := NULL;
2116: ELSIF
2117: NVL(l_org_unit_rec.operating_unit_id,fnd_api.g_miss_num) <> NVL(p_org_unit_rec.operating_unit_id,fnd_api.g_miss_num) THEN
2113: NVL(p_org_unit_rec.operating_unit_id, fnd_api.g_miss_num) = NVL(l_org_unit_rec.operating_unit_id, fnd_api.g_miss_num) THEN
2114: l_org_units_hist_rec.old_operating_unit_id := NULL;
2115: l_org_units_hist_rec.new_operating_unit_id := NULL;
2116: ELSIF
2117: NVL(l_org_unit_rec.operating_unit_id,fnd_api.g_miss_num) <> NVL(p_org_unit_rec.operating_unit_id,fnd_api.g_miss_num) THEN
2118: l_org_units_hist_rec.old_operating_unit_id := l_org_unit_rec.operating_unit_id ;
2119: l_org_units_hist_rec.new_operating_unit_id := p_org_unit_rec.operating_unit_id ;
2120: END IF;
2121: --
2118: l_org_units_hist_rec.old_operating_unit_id := l_org_unit_rec.operating_unit_id ;
2119: l_org_units_hist_rec.new_operating_unit_id := p_org_unit_rec.operating_unit_id ;
2120: END IF;
2121: --
2122: IF (p_org_unit_rec.relationship_type_code = fnd_api.g_miss_char) OR
2123: NVL(p_org_unit_rec.relationship_type_code, fnd_api.g_miss_char) = NVL(l_org_unit_rec.relationship_type_code, fnd_api.g_miss_char) THEN
2124: l_org_units_hist_rec.old_relationship_type_code := NULL;
2125: l_org_units_hist_rec.new_relationship_type_code := NULL;
2126: ELSIF
2119: l_org_units_hist_rec.new_operating_unit_id := p_org_unit_rec.operating_unit_id ;
2120: END IF;
2121: --
2122: IF (p_org_unit_rec.relationship_type_code = fnd_api.g_miss_char) OR
2123: NVL(p_org_unit_rec.relationship_type_code, fnd_api.g_miss_char) = NVL(l_org_unit_rec.relationship_type_code, fnd_api.g_miss_char) THEN
2124: l_org_units_hist_rec.old_relationship_type_code := NULL;
2125: l_org_units_hist_rec.new_relationship_type_code := NULL;
2126: ELSIF
2127: NVL(l_org_unit_rec.relationship_type_code,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.relationship_type_code,fnd_api.g_miss_char) THEN
2123: NVL(p_org_unit_rec.relationship_type_code, fnd_api.g_miss_char) = NVL(l_org_unit_rec.relationship_type_code, fnd_api.g_miss_char) THEN
2124: l_org_units_hist_rec.old_relationship_type_code := NULL;
2125: l_org_units_hist_rec.new_relationship_type_code := NULL;
2126: ELSIF
2127: NVL(l_org_unit_rec.relationship_type_code,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.relationship_type_code,fnd_api.g_miss_char) THEN
2128: l_org_units_hist_rec.old_relationship_type_code := l_org_unit_rec.relationship_type_code ;
2129: l_org_units_hist_rec.new_relationship_type_code := p_org_unit_rec.relationship_type_code ;
2130: END IF;
2131: --
2128: l_org_units_hist_rec.old_relationship_type_code := l_org_unit_rec.relationship_type_code ;
2129: l_org_units_hist_rec.new_relationship_type_code := p_org_unit_rec.relationship_type_code ;
2130: END IF;
2131: --
2132: IF (p_org_unit_rec.active_start_date = fnd_api.g_miss_date) OR
2133: NVL(p_org_unit_rec.active_start_date, fnd_api.g_miss_date) = NVL(l_org_unit_rec.active_start_date, fnd_api.g_miss_date) THEN
2134: l_org_units_hist_rec.old_active_start_date := NULL;
2135: l_org_units_hist_rec.new_active_start_date := NULL;
2136: ELSIF
2129: l_org_units_hist_rec.new_relationship_type_code := p_org_unit_rec.relationship_type_code ;
2130: END IF;
2131: --
2132: IF (p_org_unit_rec.active_start_date = fnd_api.g_miss_date) OR
2133: NVL(p_org_unit_rec.active_start_date, fnd_api.g_miss_date) = NVL(l_org_unit_rec.active_start_date, fnd_api.g_miss_date) THEN
2134: l_org_units_hist_rec.old_active_start_date := NULL;
2135: l_org_units_hist_rec.new_active_start_date := NULL;
2136: ELSIF
2137: NVL(l_org_unit_rec.active_start_date,fnd_api.g_miss_date) <> NVL(p_org_unit_rec.active_start_date,fnd_api.g_miss_date) THEN
2133: NVL(p_org_unit_rec.active_start_date, fnd_api.g_miss_date) = NVL(l_org_unit_rec.active_start_date, fnd_api.g_miss_date) THEN
2134: l_org_units_hist_rec.old_active_start_date := NULL;
2135: l_org_units_hist_rec.new_active_start_date := NULL;
2136: ELSIF
2137: NVL(l_org_unit_rec.active_start_date,fnd_api.g_miss_date) <> NVL(p_org_unit_rec.active_start_date,fnd_api.g_miss_date) THEN
2138: l_org_units_hist_rec.old_active_start_date := l_org_unit_rec.active_start_date ;
2139: l_org_units_hist_rec.new_active_start_date := p_org_unit_rec.active_start_date ;
2140: END IF;
2141: --
2138: l_org_units_hist_rec.old_active_start_date := l_org_unit_rec.active_start_date ;
2139: l_org_units_hist_rec.new_active_start_date := p_org_unit_rec.active_start_date ;
2140: END IF;
2141: --
2142: IF (p_org_unit_rec.active_end_date = fnd_api.g_miss_date) OR
2143: NVL(p_org_unit_rec.active_end_date, fnd_api.g_miss_date) = NVL(l_org_unit_rec.active_end_date, fnd_api.g_miss_date) THEN
2144: l_org_units_hist_rec.old_active_end_date := NULL;
2145: l_org_units_hist_rec.new_active_end_date := NULL;
2146: ELSIF
2139: l_org_units_hist_rec.new_active_start_date := p_org_unit_rec.active_start_date ;
2140: END IF;
2141: --
2142: IF (p_org_unit_rec.active_end_date = fnd_api.g_miss_date) OR
2143: NVL(p_org_unit_rec.active_end_date, fnd_api.g_miss_date) = NVL(l_org_unit_rec.active_end_date, fnd_api.g_miss_date) THEN
2144: l_org_units_hist_rec.old_active_end_date := NULL;
2145: l_org_units_hist_rec.new_active_end_date := NULL;
2146: ELSIF
2147: NVL(l_org_unit_rec.active_end_date,fnd_api.g_miss_date) <> NVL(p_org_unit_rec.active_end_date,fnd_api.g_miss_date) THEN
2143: NVL(p_org_unit_rec.active_end_date, fnd_api.g_miss_date) = NVL(l_org_unit_rec.active_end_date, fnd_api.g_miss_date) THEN
2144: l_org_units_hist_rec.old_active_end_date := NULL;
2145: l_org_units_hist_rec.new_active_end_date := NULL;
2146: ELSIF
2147: NVL(l_org_unit_rec.active_end_date,fnd_api.g_miss_date) <> NVL(p_org_unit_rec.active_end_date,fnd_api.g_miss_date) THEN
2148: l_org_units_hist_rec.old_active_end_date := l_org_unit_rec.active_end_date ;
2149: l_org_units_hist_rec.new_active_end_date := p_org_unit_rec.active_end_date ;
2150: END IF;
2151: --
2148: l_org_units_hist_rec.old_active_end_date := l_org_unit_rec.active_end_date ;
2149: l_org_units_hist_rec.new_active_end_date := p_org_unit_rec.active_end_date ;
2150: END IF;
2151: --
2152: IF (p_org_unit_rec.context = fnd_api.g_miss_char) OR
2153: NVL(p_org_unit_rec.context, fnd_api.g_miss_char) = NVL(l_org_unit_rec.context, fnd_api.g_miss_char) THEN
2154: l_org_units_hist_rec.old_context := NULL;
2155: l_org_units_hist_rec.new_context := NULL;
2156: ELSIF
2149: l_org_units_hist_rec.new_active_end_date := p_org_unit_rec.active_end_date ;
2150: END IF;
2151: --
2152: IF (p_org_unit_rec.context = fnd_api.g_miss_char) OR
2153: NVL(p_org_unit_rec.context, fnd_api.g_miss_char) = NVL(l_org_unit_rec.context, fnd_api.g_miss_char) THEN
2154: l_org_units_hist_rec.old_context := NULL;
2155: l_org_units_hist_rec.new_context := NULL;
2156: ELSIF
2157: NVL(l_org_unit_rec.context,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.context,fnd_api.g_miss_char) THEN
2153: NVL(p_org_unit_rec.context, fnd_api.g_miss_char) = NVL(l_org_unit_rec.context, fnd_api.g_miss_char) THEN
2154: l_org_units_hist_rec.old_context := NULL;
2155: l_org_units_hist_rec.new_context := NULL;
2156: ELSIF
2157: NVL(l_org_unit_rec.context,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.context,fnd_api.g_miss_char) THEN
2158: l_org_units_hist_rec.old_context := l_org_unit_rec.context ;
2159: l_org_units_hist_rec.new_context := p_org_unit_rec.context ;
2160: END IF;
2161: --
2158: l_org_units_hist_rec.old_context := l_org_unit_rec.context ;
2159: l_org_units_hist_rec.new_context := p_org_unit_rec.context ;
2160: END IF;
2161: --
2162: IF (p_org_unit_rec.attribute1 = fnd_api.g_miss_char) OR
2163: NVL(p_org_unit_rec.attribute1, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute1, fnd_api.g_miss_char) THEN
2164: l_org_units_hist_rec.old_attribute1 := NULL;
2165: l_org_units_hist_rec.new_attribute1 := NULL;
2166: ELSIF
2159: l_org_units_hist_rec.new_context := p_org_unit_rec.context ;
2160: END IF;
2161: --
2162: IF (p_org_unit_rec.attribute1 = fnd_api.g_miss_char) OR
2163: NVL(p_org_unit_rec.attribute1, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute1, fnd_api.g_miss_char) THEN
2164: l_org_units_hist_rec.old_attribute1 := NULL;
2165: l_org_units_hist_rec.new_attribute1 := NULL;
2166: ELSIF
2167: NVL(l_org_unit_rec.attribute1,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute1,fnd_api.g_miss_char) THEN
2163: NVL(p_org_unit_rec.attribute1, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute1, fnd_api.g_miss_char) THEN
2164: l_org_units_hist_rec.old_attribute1 := NULL;
2165: l_org_units_hist_rec.new_attribute1 := NULL;
2166: ELSIF
2167: NVL(l_org_unit_rec.attribute1,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute1,fnd_api.g_miss_char) THEN
2168: l_org_units_hist_rec.old_attribute1 := l_org_unit_rec.attribute1 ;
2169: l_org_units_hist_rec.new_attribute1 := p_org_unit_rec.attribute1 ;
2170: END IF;
2171: --
2168: l_org_units_hist_rec.old_attribute1 := l_org_unit_rec.attribute1 ;
2169: l_org_units_hist_rec.new_attribute1 := p_org_unit_rec.attribute1 ;
2170: END IF;
2171: --
2172: IF (p_org_unit_rec.attribute2 = fnd_api.g_miss_char) OR
2173: NVL(p_org_unit_rec.attribute2, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute2, fnd_api.g_miss_char) THEN
2174: l_org_units_hist_rec.old_attribute2 := NULL;
2175: l_org_units_hist_rec.new_attribute2 := NULL;
2176: ELSIF
2169: l_org_units_hist_rec.new_attribute1 := p_org_unit_rec.attribute1 ;
2170: END IF;
2171: --
2172: IF (p_org_unit_rec.attribute2 = fnd_api.g_miss_char) OR
2173: NVL(p_org_unit_rec.attribute2, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute2, fnd_api.g_miss_char) THEN
2174: l_org_units_hist_rec.old_attribute2 := NULL;
2175: l_org_units_hist_rec.new_attribute2 := NULL;
2176: ELSIF
2177: NVL(l_org_unit_rec.attribute2,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute2,fnd_api.g_miss_char) THEN
2173: NVL(p_org_unit_rec.attribute2, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute2, fnd_api.g_miss_char) THEN
2174: l_org_units_hist_rec.old_attribute2 := NULL;
2175: l_org_units_hist_rec.new_attribute2 := NULL;
2176: ELSIF
2177: NVL(l_org_unit_rec.attribute2,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute2,fnd_api.g_miss_char) THEN
2178: l_org_units_hist_rec.old_attribute2 := l_org_unit_rec.attribute2 ;
2179: l_org_units_hist_rec.new_attribute2 := p_org_unit_rec.attribute2 ;
2180: END IF;
2181: --
2178: l_org_units_hist_rec.old_attribute2 := l_org_unit_rec.attribute2 ;
2179: l_org_units_hist_rec.new_attribute2 := p_org_unit_rec.attribute2 ;
2180: END IF;
2181: --
2182: IF (p_org_unit_rec.attribute3 = fnd_api.g_miss_char) OR
2183: NVL(p_org_unit_rec.attribute3, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute3, fnd_api.g_miss_char) THEN
2184: l_org_units_hist_rec.old_attribute3 := NULL;
2185: l_org_units_hist_rec.new_attribute3 := NULL;
2186: ELSIF
2179: l_org_units_hist_rec.new_attribute2 := p_org_unit_rec.attribute2 ;
2180: END IF;
2181: --
2182: IF (p_org_unit_rec.attribute3 = fnd_api.g_miss_char) OR
2183: NVL(p_org_unit_rec.attribute3, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute3, fnd_api.g_miss_char) THEN
2184: l_org_units_hist_rec.old_attribute3 := NULL;
2185: l_org_units_hist_rec.new_attribute3 := NULL;
2186: ELSIF
2187: NVL(l_org_unit_rec.attribute3,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute3,fnd_api.g_miss_char) THEN
2183: NVL(p_org_unit_rec.attribute3, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute3, fnd_api.g_miss_char) THEN
2184: l_org_units_hist_rec.old_attribute3 := NULL;
2185: l_org_units_hist_rec.new_attribute3 := NULL;
2186: ELSIF
2187: NVL(l_org_unit_rec.attribute3,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute3,fnd_api.g_miss_char) THEN
2188: l_org_units_hist_rec.old_attribute3 := l_org_unit_rec.attribute3 ;
2189: l_org_units_hist_rec.new_attribute3 := p_org_unit_rec.attribute3 ;
2190: END IF;
2191: --
2188: l_org_units_hist_rec.old_attribute3 := l_org_unit_rec.attribute3 ;
2189: l_org_units_hist_rec.new_attribute3 := p_org_unit_rec.attribute3 ;
2190: END IF;
2191: --
2192: IF (p_org_unit_rec.attribute4 = fnd_api.g_miss_char) OR
2193: NVL(p_org_unit_rec.attribute4, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute4, fnd_api.g_miss_char) THEN
2194: l_org_units_hist_rec.old_attribute4 := NULL;
2195: l_org_units_hist_rec.new_attribute4 := NULL;
2196: ELSIF
2189: l_org_units_hist_rec.new_attribute3 := p_org_unit_rec.attribute3 ;
2190: END IF;
2191: --
2192: IF (p_org_unit_rec.attribute4 = fnd_api.g_miss_char) OR
2193: NVL(p_org_unit_rec.attribute4, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute4, fnd_api.g_miss_char) THEN
2194: l_org_units_hist_rec.old_attribute4 := NULL;
2195: l_org_units_hist_rec.new_attribute4 := NULL;
2196: ELSIF
2197: NVL(l_org_unit_rec.attribute4,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute4,fnd_api.g_miss_char) THEN
2193: NVL(p_org_unit_rec.attribute4, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute4, fnd_api.g_miss_char) THEN
2194: l_org_units_hist_rec.old_attribute4 := NULL;
2195: l_org_units_hist_rec.new_attribute4 := NULL;
2196: ELSIF
2197: NVL(l_org_unit_rec.attribute4,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute4,fnd_api.g_miss_char) THEN
2198: l_org_units_hist_rec.old_attribute4 := l_org_unit_rec.attribute4 ;
2199: l_org_units_hist_rec.new_attribute4 := p_org_unit_rec.attribute4 ;
2200: END IF;
2201: --
2198: l_org_units_hist_rec.old_attribute4 := l_org_unit_rec.attribute4 ;
2199: l_org_units_hist_rec.new_attribute4 := p_org_unit_rec.attribute4 ;
2200: END IF;
2201: --
2202: IF (p_org_unit_rec.attribute5 = fnd_api.g_miss_char) OR
2203: NVL(p_org_unit_rec.attribute5, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute5, fnd_api.g_miss_char) THEN
2204: l_org_units_hist_rec.old_attribute5 := NULL;
2205: l_org_units_hist_rec.new_attribute5 := NULL;
2206: ELSIF
2199: l_org_units_hist_rec.new_attribute4 := p_org_unit_rec.attribute4 ;
2200: END IF;
2201: --
2202: IF (p_org_unit_rec.attribute5 = fnd_api.g_miss_char) OR
2203: NVL(p_org_unit_rec.attribute5, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute5, fnd_api.g_miss_char) THEN
2204: l_org_units_hist_rec.old_attribute5 := NULL;
2205: l_org_units_hist_rec.new_attribute5 := NULL;
2206: ELSIF
2207: NVL(l_org_unit_rec.attribute5,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute5,fnd_api.g_miss_char) THEN
2203: NVL(p_org_unit_rec.attribute5, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute5, fnd_api.g_miss_char) THEN
2204: l_org_units_hist_rec.old_attribute5 := NULL;
2205: l_org_units_hist_rec.new_attribute5 := NULL;
2206: ELSIF
2207: NVL(l_org_unit_rec.attribute5,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute5,fnd_api.g_miss_char) THEN
2208: l_org_units_hist_rec.old_attribute5 := l_org_unit_rec.attribute5 ;
2209: l_org_units_hist_rec.new_attribute5 := p_org_unit_rec.attribute5 ;
2210: END IF;
2211: --
2208: l_org_units_hist_rec.old_attribute5 := l_org_unit_rec.attribute5 ;
2209: l_org_units_hist_rec.new_attribute5 := p_org_unit_rec.attribute5 ;
2210: END IF;
2211: --
2212: IF (p_org_unit_rec.attribute6 = fnd_api.g_miss_char) OR
2213: NVL(p_org_unit_rec.attribute6, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute6, fnd_api.g_miss_char) THEN
2214: l_org_units_hist_rec.old_attribute6 := NULL;
2215: l_org_units_hist_rec.new_attribute6 := NULL;
2216: ELSIF
2209: l_org_units_hist_rec.new_attribute5 := p_org_unit_rec.attribute5 ;
2210: END IF;
2211: --
2212: IF (p_org_unit_rec.attribute6 = fnd_api.g_miss_char) OR
2213: NVL(p_org_unit_rec.attribute6, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute6, fnd_api.g_miss_char) THEN
2214: l_org_units_hist_rec.old_attribute6 := NULL;
2215: l_org_units_hist_rec.new_attribute6 := NULL;
2216: ELSIF
2217: NVL(l_org_unit_rec.attribute6,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute6,fnd_api.g_miss_char) THEN
2213: NVL(p_org_unit_rec.attribute6, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute6, fnd_api.g_miss_char) THEN
2214: l_org_units_hist_rec.old_attribute6 := NULL;
2215: l_org_units_hist_rec.new_attribute6 := NULL;
2216: ELSIF
2217: NVL(l_org_unit_rec.attribute6,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute6,fnd_api.g_miss_char) THEN
2218: l_org_units_hist_rec.old_attribute6 := l_org_unit_rec.attribute6 ;
2219: l_org_units_hist_rec.new_attribute6 := p_org_unit_rec.attribute6 ;
2220: END IF;
2221: --
2218: l_org_units_hist_rec.old_attribute6 := l_org_unit_rec.attribute6 ;
2219: l_org_units_hist_rec.new_attribute6 := p_org_unit_rec.attribute6 ;
2220: END IF;
2221: --
2222: IF (p_org_unit_rec.attribute7 = fnd_api.g_miss_char) OR
2223: NVL(p_org_unit_rec.attribute7, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute7, fnd_api.g_miss_char) THEN
2224: l_org_units_hist_rec.old_attribute7 := NULL;
2225: l_org_units_hist_rec.new_attribute7 := NULL;
2226: ELSIF
2219: l_org_units_hist_rec.new_attribute6 := p_org_unit_rec.attribute6 ;
2220: END IF;
2221: --
2222: IF (p_org_unit_rec.attribute7 = fnd_api.g_miss_char) OR
2223: NVL(p_org_unit_rec.attribute7, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute7, fnd_api.g_miss_char) THEN
2224: l_org_units_hist_rec.old_attribute7 := NULL;
2225: l_org_units_hist_rec.new_attribute7 := NULL;
2226: ELSIF
2227: NVL(l_org_unit_rec.attribute7,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute7,fnd_api.g_miss_char) THEN
2223: NVL(p_org_unit_rec.attribute7, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute7, fnd_api.g_miss_char) THEN
2224: l_org_units_hist_rec.old_attribute7 := NULL;
2225: l_org_units_hist_rec.new_attribute7 := NULL;
2226: ELSIF
2227: NVL(l_org_unit_rec.attribute7,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute7,fnd_api.g_miss_char) THEN
2228: l_org_units_hist_rec.old_attribute7 := l_org_unit_rec.attribute7 ;
2229: l_org_units_hist_rec.new_attribute7 := p_org_unit_rec.attribute7 ;
2230: END IF;
2231: --
2228: l_org_units_hist_rec.old_attribute7 := l_org_unit_rec.attribute7 ;
2229: l_org_units_hist_rec.new_attribute7 := p_org_unit_rec.attribute7 ;
2230: END IF;
2231: --
2232: IF (p_org_unit_rec.attribute8 = fnd_api.g_miss_char) OR
2233: NVL(p_org_unit_rec.attribute8, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute8, fnd_api.g_miss_char) THEN
2234: l_org_units_hist_rec.old_attribute8 := NULL;
2235: l_org_units_hist_rec.new_attribute8 := NULL;
2236: ELSIF
2229: l_org_units_hist_rec.new_attribute7 := p_org_unit_rec.attribute7 ;
2230: END IF;
2231: --
2232: IF (p_org_unit_rec.attribute8 = fnd_api.g_miss_char) OR
2233: NVL(p_org_unit_rec.attribute8, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute8, fnd_api.g_miss_char) THEN
2234: l_org_units_hist_rec.old_attribute8 := NULL;
2235: l_org_units_hist_rec.new_attribute8 := NULL;
2236: ELSIF
2237: NVL(l_org_unit_rec.attribute8,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute8,fnd_api.g_miss_char) THEN
2233: NVL(p_org_unit_rec.attribute8, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute8, fnd_api.g_miss_char) THEN
2234: l_org_units_hist_rec.old_attribute8 := NULL;
2235: l_org_units_hist_rec.new_attribute8 := NULL;
2236: ELSIF
2237: NVL(l_org_unit_rec.attribute8,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute8,fnd_api.g_miss_char) THEN
2238: l_org_units_hist_rec.old_attribute8 := l_org_unit_rec.attribute8 ;
2239: l_org_units_hist_rec.new_attribute8 := p_org_unit_rec.attribute8 ;
2240: END IF;
2241: --
2238: l_org_units_hist_rec.old_attribute8 := l_org_unit_rec.attribute8 ;
2239: l_org_units_hist_rec.new_attribute8 := p_org_unit_rec.attribute8 ;
2240: END IF;
2241: --
2242: IF (p_org_unit_rec.attribute9 = fnd_api.g_miss_char) OR
2243: NVL(p_org_unit_rec.attribute9, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute9, fnd_api.g_miss_char) THEN
2244: l_org_units_hist_rec.old_attribute9 := NULL;
2245: l_org_units_hist_rec.new_attribute9 := NULL;
2246: ELSIF
2239: l_org_units_hist_rec.new_attribute8 := p_org_unit_rec.attribute8 ;
2240: END IF;
2241: --
2242: IF (p_org_unit_rec.attribute9 = fnd_api.g_miss_char) OR
2243: NVL(p_org_unit_rec.attribute9, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute9, fnd_api.g_miss_char) THEN
2244: l_org_units_hist_rec.old_attribute9 := NULL;
2245: l_org_units_hist_rec.new_attribute9 := NULL;
2246: ELSIF
2247: NVL(l_org_unit_rec.attribute9,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute9,fnd_api.g_miss_char) THEN
2243: NVL(p_org_unit_rec.attribute9, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute9, fnd_api.g_miss_char) THEN
2244: l_org_units_hist_rec.old_attribute9 := NULL;
2245: l_org_units_hist_rec.new_attribute9 := NULL;
2246: ELSIF
2247: NVL(l_org_unit_rec.attribute9,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute9,fnd_api.g_miss_char) THEN
2248: l_org_units_hist_rec.old_attribute9 := l_org_unit_rec.attribute9 ;
2249: l_org_units_hist_rec.new_attribute9 := p_org_unit_rec.attribute9 ;
2250: END IF;
2251: --
2248: l_org_units_hist_rec.old_attribute9 := l_org_unit_rec.attribute9 ;
2249: l_org_units_hist_rec.new_attribute9 := p_org_unit_rec.attribute9 ;
2250: END IF;
2251: --
2252: IF (p_org_unit_rec.attribute10 = fnd_api.g_miss_char) OR
2253: NVL(p_org_unit_rec.attribute10, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute10, fnd_api.g_miss_char) THEN
2254: l_org_units_hist_rec.old_attribute10 := NULL;
2255: l_org_units_hist_rec.new_attribute10 := NULL;
2256: ELSIF
2249: l_org_units_hist_rec.new_attribute9 := p_org_unit_rec.attribute9 ;
2250: END IF;
2251: --
2252: IF (p_org_unit_rec.attribute10 = fnd_api.g_miss_char) OR
2253: NVL(p_org_unit_rec.attribute10, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute10, fnd_api.g_miss_char) THEN
2254: l_org_units_hist_rec.old_attribute10 := NULL;
2255: l_org_units_hist_rec.new_attribute10 := NULL;
2256: ELSIF
2257: NVL(l_org_unit_rec.attribute10,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute10,fnd_api.g_miss_char) THEN
2253: NVL(p_org_unit_rec.attribute10, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute10, fnd_api.g_miss_char) THEN
2254: l_org_units_hist_rec.old_attribute10 := NULL;
2255: l_org_units_hist_rec.new_attribute10 := NULL;
2256: ELSIF
2257: NVL(l_org_unit_rec.attribute10,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute10,fnd_api.g_miss_char) THEN
2258: l_org_units_hist_rec.old_attribute10 := l_org_unit_rec.attribute10 ;
2259: l_org_units_hist_rec.new_attribute10 := p_org_unit_rec.attribute10 ;
2260: END IF;
2261: --
2258: l_org_units_hist_rec.old_attribute10 := l_org_unit_rec.attribute10 ;
2259: l_org_units_hist_rec.new_attribute10 := p_org_unit_rec.attribute10 ;
2260: END IF;
2261: --
2262: IF (p_org_unit_rec.attribute11 = fnd_api.g_miss_char) OR
2263: NVL(p_org_unit_rec.attribute11, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute11, fnd_api.g_miss_char) THEN
2264: l_org_units_hist_rec.old_attribute11 := NULL;
2265: l_org_units_hist_rec.new_attribute11 := NULL;
2266: ELSIF
2259: l_org_units_hist_rec.new_attribute10 := p_org_unit_rec.attribute10 ;
2260: END IF;
2261: --
2262: IF (p_org_unit_rec.attribute11 = fnd_api.g_miss_char) OR
2263: NVL(p_org_unit_rec.attribute11, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute11, fnd_api.g_miss_char) THEN
2264: l_org_units_hist_rec.old_attribute11 := NULL;
2265: l_org_units_hist_rec.new_attribute11 := NULL;
2266: ELSIF
2267: NVL(l_org_unit_rec.attribute11,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute11,fnd_api.g_miss_char) THEN
2263: NVL(p_org_unit_rec.attribute11, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute11, fnd_api.g_miss_char) THEN
2264: l_org_units_hist_rec.old_attribute11 := NULL;
2265: l_org_units_hist_rec.new_attribute11 := NULL;
2266: ELSIF
2267: NVL(l_org_unit_rec.attribute11,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute11,fnd_api.g_miss_char) THEN
2268: l_org_units_hist_rec.old_attribute11 := l_org_unit_rec.attribute11 ;
2269: l_org_units_hist_rec.new_attribute11 := p_org_unit_rec.attribute11 ;
2270: END IF;
2271: --
2268: l_org_units_hist_rec.old_attribute11 := l_org_unit_rec.attribute11 ;
2269: l_org_units_hist_rec.new_attribute11 := p_org_unit_rec.attribute11 ;
2270: END IF;
2271: --
2272: IF (p_org_unit_rec.attribute12 = fnd_api.g_miss_char) OR
2273: NVL(p_org_unit_rec.attribute12, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute12, fnd_api.g_miss_char) THEN
2274: l_org_units_hist_rec.old_attribute12 := NULL;
2275: l_org_units_hist_rec.new_attribute12 := NULL;
2276: ELSIF
2269: l_org_units_hist_rec.new_attribute11 := p_org_unit_rec.attribute11 ;
2270: END IF;
2271: --
2272: IF (p_org_unit_rec.attribute12 = fnd_api.g_miss_char) OR
2273: NVL(p_org_unit_rec.attribute12, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute12, fnd_api.g_miss_char) THEN
2274: l_org_units_hist_rec.old_attribute12 := NULL;
2275: l_org_units_hist_rec.new_attribute12 := NULL;
2276: ELSIF
2277: NVL(l_org_unit_rec.attribute12,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute12,fnd_api.g_miss_char) THEN
2273: NVL(p_org_unit_rec.attribute12, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute12, fnd_api.g_miss_char) THEN
2274: l_org_units_hist_rec.old_attribute12 := NULL;
2275: l_org_units_hist_rec.new_attribute12 := NULL;
2276: ELSIF
2277: NVL(l_org_unit_rec.attribute12,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute12,fnd_api.g_miss_char) THEN
2278: l_org_units_hist_rec.old_attribute12 := l_org_unit_rec.attribute12 ;
2279: l_org_units_hist_rec.new_attribute12 := p_org_unit_rec.attribute12 ;
2280: END IF;
2281: --
2278: l_org_units_hist_rec.old_attribute12 := l_org_unit_rec.attribute12 ;
2279: l_org_units_hist_rec.new_attribute12 := p_org_unit_rec.attribute12 ;
2280: END IF;
2281: --
2282: IF (p_org_unit_rec.attribute13 = fnd_api.g_miss_char) OR
2283: NVL(p_org_unit_rec.attribute13, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute13, fnd_api.g_miss_char) THEN
2284: l_org_units_hist_rec.old_attribute13 := NULL;
2285: l_org_units_hist_rec.new_attribute13 := NULL;
2286: ELSIF
2279: l_org_units_hist_rec.new_attribute12 := p_org_unit_rec.attribute12 ;
2280: END IF;
2281: --
2282: IF (p_org_unit_rec.attribute13 = fnd_api.g_miss_char) OR
2283: NVL(p_org_unit_rec.attribute13, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute13, fnd_api.g_miss_char) THEN
2284: l_org_units_hist_rec.old_attribute13 := NULL;
2285: l_org_units_hist_rec.new_attribute13 := NULL;
2286: ELSIF
2287: NVL(l_org_unit_rec.attribute13,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute13,fnd_api.g_miss_char) THEN
2283: NVL(p_org_unit_rec.attribute13, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute13, fnd_api.g_miss_char) THEN
2284: l_org_units_hist_rec.old_attribute13 := NULL;
2285: l_org_units_hist_rec.new_attribute13 := NULL;
2286: ELSIF
2287: NVL(l_org_unit_rec.attribute13,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute13,fnd_api.g_miss_char) THEN
2288: l_org_units_hist_rec.old_attribute13 := l_org_unit_rec.attribute13 ;
2289: l_org_units_hist_rec.new_attribute13 := p_org_unit_rec.attribute13 ;
2290: END IF;
2291: --
2288: l_org_units_hist_rec.old_attribute13 := l_org_unit_rec.attribute13 ;
2289: l_org_units_hist_rec.new_attribute13 := p_org_unit_rec.attribute13 ;
2290: END IF;
2291: --
2292: IF (p_org_unit_rec.attribute14 = fnd_api.g_miss_char) OR
2293: NVL(p_org_unit_rec.attribute14, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute14, fnd_api.g_miss_char) THEN
2294: l_org_units_hist_rec.old_attribute14 := NULL;
2295: l_org_units_hist_rec.new_attribute14 := NULL;
2296: ELSIF
2289: l_org_units_hist_rec.new_attribute13 := p_org_unit_rec.attribute13 ;
2290: END IF;
2291: --
2292: IF (p_org_unit_rec.attribute14 = fnd_api.g_miss_char) OR
2293: NVL(p_org_unit_rec.attribute14, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute14, fnd_api.g_miss_char) THEN
2294: l_org_units_hist_rec.old_attribute14 := NULL;
2295: l_org_units_hist_rec.new_attribute14 := NULL;
2296: ELSIF
2297: NVL(l_org_unit_rec.attribute14,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute14,fnd_api.g_miss_char) THEN
2293: NVL(p_org_unit_rec.attribute14, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute14, fnd_api.g_miss_char) THEN
2294: l_org_units_hist_rec.old_attribute14 := NULL;
2295: l_org_units_hist_rec.new_attribute14 := NULL;
2296: ELSIF
2297: NVL(l_org_unit_rec.attribute14,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute14,fnd_api.g_miss_char) THEN
2298: l_org_units_hist_rec.old_attribute14 := l_org_unit_rec.attribute14 ;
2299: l_org_units_hist_rec.new_attribute14 := p_org_unit_rec.attribute14 ;
2300: END IF;
2301: --
2298: l_org_units_hist_rec.old_attribute14 := l_org_unit_rec.attribute14 ;
2299: l_org_units_hist_rec.new_attribute14 := p_org_unit_rec.attribute14 ;
2300: END IF;
2301: --
2302: IF (p_org_unit_rec.attribute15 = fnd_api.g_miss_char) OR
2303: NVL(p_org_unit_rec.attribute15, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute15, fnd_api.g_miss_char) THEN
2304: l_org_units_hist_rec.old_attribute15 := NULL;
2305: l_org_units_hist_rec.new_attribute15 := NULL;
2306: ELSIF
2299: l_org_units_hist_rec.new_attribute14 := p_org_unit_rec.attribute14 ;
2300: END IF;
2301: --
2302: IF (p_org_unit_rec.attribute15 = fnd_api.g_miss_char) OR
2303: NVL(p_org_unit_rec.attribute15, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute15, fnd_api.g_miss_char) THEN
2304: l_org_units_hist_rec.old_attribute15 := NULL;
2305: l_org_units_hist_rec.new_attribute15 := NULL;
2306: ELSIF
2307: NVL(l_org_unit_rec.attribute15,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute15,fnd_api.g_miss_char) THEN
2303: NVL(p_org_unit_rec.attribute15, fnd_api.g_miss_char) = NVL(l_org_unit_rec.attribute15, fnd_api.g_miss_char) THEN
2304: l_org_units_hist_rec.old_attribute15 := NULL;
2305: l_org_units_hist_rec.new_attribute15 := NULL;
2306: ELSIF
2307: NVL(l_org_unit_rec.attribute15,fnd_api.g_miss_char) <> NVL(p_org_unit_rec.attribute15,fnd_api.g_miss_char) THEN
2308: l_org_units_hist_rec.old_attribute15 := l_org_unit_rec.attribute15 ;
2309: l_org_units_hist_rec.new_attribute15 := p_org_unit_rec.attribute15 ;
2310: END IF;
2311: --
2368: -- End of modification for Bug#2547034 on 09/20/02 - rtalluri
2369: -- End of API body
2370:
2371: -- Standard check of p_commit.
2372: IF FND_API.To_Boolean( p_commit ) THEN
2373: COMMIT WORK;
2374: END IF;
2375:
2376: FND_MSG_PUB.Count_And_Get
2380:
2381:
2382: EXCEPTION
2383:
2384: WHEN FND_API.G_EXC_ERROR THEN
2385: ROLLBACK TO update_organization_unit;
2386: x_return_status := FND_API.G_RET_STS_ERROR ;
2387: FND_MSG_PUB.Count_And_Get
2388: ( p_count => x_msg_count,
2382: EXCEPTION
2383:
2384: WHEN FND_API.G_EXC_ERROR THEN
2385: ROLLBACK TO update_organization_unit;
2386: x_return_status := FND_API.G_RET_STS_ERROR ;
2387: FND_MSG_PUB.Count_And_Get
2388: ( p_count => x_msg_count,
2389: p_data => x_msg_data
2390: );
2388: ( p_count => x_msg_count,
2389: p_data => x_msg_data
2390: );
2391:
2392: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2393: ROLLBACK TO update_organization_unit;
2394: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2395: FND_MSG_PUB.Count_And_Get
2396: ( p_count => x_msg_count,
2390: );
2391:
2392: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2393: ROLLBACK TO update_organization_unit;
2394: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2395: FND_MSG_PUB.Count_And_Get
2396: ( p_count => x_msg_count,
2397: p_data => x_msg_data
2398: );
2398: );
2399:
2400: WHEN OTHERS THEN
2401: ROLLBACK TO update_organization_unit;
2402: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2403:
2404: IF FND_MSG_PUB.Check_Msg_Level
2405: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2406: THEN
2455: -- Standard Start of API savepoint
2456: SAVEPOINT expire_organization_unit;
2457:
2458: -- Standard call to check for call compatibility.
2459: IF NOT FND_API.Compatible_API_Call (l_api_version,
2460: p_api_version,
2461: l_api_name ,
2462: g_pkg_name)
2463: THEN
2460: p_api_version,
2461: l_api_name ,
2462: g_pkg_name)
2463: THEN
2464: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2465: END IF;
2466:
2467:
2468: -- Initialize message list if p_init_msg_list is set to TRUE.
2465: END IF;
2466:
2467:
2468: -- Initialize message list if p_init_msg_list is set to TRUE.
2469: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2470: FND_MSG_PUB.initialize;
2471: END IF;
2472:
2473:
2471: END IF;
2472:
2473:
2474: -- Initialize API return status to success
2475: x_return_status := FND_API.G_RET_STS_SUCCESS;
2476:
2477:
2478: -- Check the profile option debug_level for debug message reporting
2479: l_debug_level:=fnd_profile.value('CSI_DEBUG_LEVEL');
2503: -- Validate instance_ou_id
2504: IF NOT(csi_org_unit_vld_pvt.Val_and_get_inst_ou_id
2505: (p_org_unit_rec.instance_ou_id,
2506: l_org_unit_rec)) THEN
2507: RAISE FND_API.G_EXC_ERROR;
2508: END IF;
2509:
2510: l_org_unit_rec.instance_ou_id := p_org_unit_rec.instance_ou_id;
2511: l_org_unit_rec.instance_id := FND_API.G_MISS_NUM ;
2507: RAISE FND_API.G_EXC_ERROR;
2508: END IF;
2509:
2510: l_org_unit_rec.instance_ou_id := p_org_unit_rec.instance_ou_id;
2511: l_org_unit_rec.instance_id := FND_API.G_MISS_NUM ;
2512: l_org_unit_rec.operating_unit_id := FND_API.G_MISS_NUM ;
2513: l_org_unit_rec.relationship_type_code := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2508: END IF;
2509:
2510: l_org_unit_rec.instance_ou_id := p_org_unit_rec.instance_ou_id;
2511: l_org_unit_rec.instance_id := FND_API.G_MISS_NUM ;
2512: l_org_unit_rec.operating_unit_id := FND_API.G_MISS_NUM ;
2513: l_org_unit_rec.relationship_type_code := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2509:
2510: l_org_unit_rec.instance_ou_id := p_org_unit_rec.instance_ou_id;
2511: l_org_unit_rec.instance_id := FND_API.G_MISS_NUM ;
2512: l_org_unit_rec.operating_unit_id := FND_API.G_MISS_NUM ;
2513: l_org_unit_rec.relationship_type_code := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2510: l_org_unit_rec.instance_ou_id := p_org_unit_rec.instance_ou_id;
2511: l_org_unit_rec.instance_id := FND_API.G_MISS_NUM ;
2512: l_org_unit_rec.operating_unit_id := FND_API.G_MISS_NUM ;
2513: l_org_unit_rec.relationship_type_code := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2512: l_org_unit_rec.operating_unit_id := FND_API.G_MISS_NUM ;
2513: l_org_unit_rec.relationship_type_code := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2513: l_org_unit_rec.relationship_type_code := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2514: l_org_unit_rec.active_start_date := FND_API.G_MISS_DATE;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2515: l_org_unit_rec.active_end_date := SYSDATE;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2516: l_org_unit_rec.context := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2517: l_org_unit_rec.attribute1 := FND_API.G_MISS_CHAR ;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2518: l_org_unit_rec.attribute2 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2519: l_org_unit_rec.attribute3 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2520: l_org_unit_rec.attribute4 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2521: l_org_unit_rec.attribute5 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2522: l_org_unit_rec.attribute6 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2530: l_org_unit_rec.attribute14 := FND_API.G_MISS_CHAR;
2523: l_org_unit_rec.attribute7 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2530: l_org_unit_rec.attribute14 := FND_API.G_MISS_CHAR;
2531: l_org_unit_rec.attribute15 := FND_API.G_MISS_CHAR;
2524: l_org_unit_rec.attribute8 := FND_API.G_MISS_CHAR;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2530: l_org_unit_rec.attribute14 := FND_API.G_MISS_CHAR;
2531: l_org_unit_rec.attribute15 := FND_API.G_MISS_CHAR;
2532: l_org_unit_rec.object_version_number := p_org_unit_rec.object_version_number;
2525: l_org_unit_rec.attribute9 := FND_API.G_MISS_CHAR;
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2530: l_org_unit_rec.attribute14 := FND_API.G_MISS_CHAR;
2531: l_org_unit_rec.attribute15 := FND_API.G_MISS_CHAR;
2532: l_org_unit_rec.object_version_number := p_org_unit_rec.object_version_number;
2533:
2526: l_org_unit_rec.attribute10 := FND_API.G_MISS_CHAR;
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2530: l_org_unit_rec.attribute14 := FND_API.G_MISS_CHAR;
2531: l_org_unit_rec.attribute15 := FND_API.G_MISS_CHAR;
2532: l_org_unit_rec.object_version_number := p_org_unit_rec.object_version_number;
2533:
2534: -- Call update org unit
2527: l_org_unit_rec.attribute11 := FND_API.G_MISS_CHAR;
2528: l_org_unit_rec.attribute12 := FND_API.G_MISS_CHAR;
2529: l_org_unit_rec.attribute13 := FND_API.G_MISS_CHAR;
2530: l_org_unit_rec.attribute14 := FND_API.G_MISS_CHAR;
2531: l_org_unit_rec.attribute15 := FND_API.G_MISS_CHAR;
2532: l_org_unit_rec.object_version_number := p_org_unit_rec.object_version_number;
2533:
2534: -- Call update org unit
2535: g_expire_flag := 'Y';
2534: -- Call update org unit
2535: g_expire_flag := 'Y';
2536: csi_organization_unit_pvt.update_organization_unit
2537: ( p_api_version => p_api_version
2538: ,p_commit => fnd_api.g_false
2539: ,p_init_msg_list => p_init_msg_list
2540: ,p_validation_level => p_validation_level
2541: ,p_org_unit_rec => l_org_unit_rec
2542: ,p_txn_rec => p_txn_rec
2549: );
2550:
2551: g_expire_flag := 'N';
2552:
2553: IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2554: l_msg_index := 1;
2555: l_msg_count := x_msg_count;
2556: WHILE l_msg_count > 0 LOOP
2557: x_msg_data := FND_MSG_PUB.GET
2555: l_msg_count := x_msg_count;
2556: WHILE l_msg_count > 0 LOOP
2557: x_msg_data := FND_MSG_PUB.GET
2558: (l_msg_index,
2559: FND_API.G_FALSE );
2560:
2561: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
2562: l_msg_index := l_msg_index + 1;
2563: l_msg_count := l_msg_count - 1;
2561: csi_gen_utility_pvt.put_line('message data = '||x_msg_data);
2562: l_msg_index := l_msg_index + 1;
2563: l_msg_count := l_msg_count - 1;
2564: END LOOP;
2565: RAISE FND_API.G_EXC_ERROR;
2566: END IF;
2567:
2568: -- End of API body
2569:
2568: -- End of API body
2569:
2570:
2571: -- Standard check of p_commit.
2572: IF FND_API.To_Boolean( p_commit ) THEN
2573: COMMIT WORK;
2574: END IF;
2575:
2576:
2582:
2583:
2584: EXCEPTION
2585:
2586: WHEN FND_API.G_EXC_ERROR THEN
2587:
2588: ROLLBACK TO expire_organization_unit;
2589: x_return_status := FND_API.G_RET_STS_ERROR;
2590: FND_MSG_PUB.Count_And_Get
2585:
2586: WHEN FND_API.G_EXC_ERROR THEN
2587:
2588: ROLLBACK TO expire_organization_unit;
2589: x_return_status := FND_API.G_RET_STS_ERROR;
2590: FND_MSG_PUB.Count_And_Get
2591: ( p_count => x_msg_count,
2592: p_data => x_msg_data
2593: );
2591: ( p_count => x_msg_count,
2592: p_data => x_msg_data
2593: );
2594:
2595: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2596:
2597: ROLLBACK TO expire_organization_unit;
2598: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2599: FND_MSG_PUB.Count_And_Get
2594:
2595: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2596:
2597: ROLLBACK TO expire_organization_unit;
2598: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2599: FND_MSG_PUB.Count_And_Get
2600: ( p_count => x_msg_count,
2601: p_data => x_msg_data
2602: );
2603:
2604: WHEN OTHERS THEN
2605:
2606: ROLLBACK TO expire_organization_unit;
2607: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2608:
2609: IF FND_MSG_PUB.Check_Msg_Level
2610: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2611: THEN
2705: -- SAVEPOINT get_org_unit_history;
2706:
2707:
2708: -- Standard call to check for call compatibility.
2709: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
2710: p_api_version ,
2711: l_api_name ,
2712: g_pkg_name )
2713: THEN
2710: p_api_version ,
2711: l_api_name ,
2712: g_pkg_name )
2713: THEN
2714: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2715: END IF;
2716:
2717: -- Initialize message list if p_init_msg_list is set to TRUE.
2718: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2714: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2715: END IF;
2716:
2717: -- Initialize message list if p_init_msg_list is set to TRUE.
2718: IF FND_API.to_Boolean( p_init_msg_list ) THEN
2719: FND_MSG_PUB.initialize;
2720: END IF;
2721:
2722: -- Initialize API return status to success
2719: FND_MSG_PUB.initialize;
2720: END IF;
2721:
2722: -- Initialize API return status to success
2723: x_return_status := FND_API.G_RET_STS_SUCCESS;
2724:
2725: -- Check the profile option CSI_DEBUG_LEVEL for debug message reporting
2726: l_csi_debug_level:=fnd_profile.value('CSI_DEBUG_LEVEL');
2727:
2821: -- End of API body
2822:
2823: -- Standard check of p_commit.
2824: /*
2825: IF FND_API.To_Boolean( p_commit ) THEN
2826: COMMIT WORK;
2827: END IF;
2828: */
2829:
2836:
2837:
2838: EXCEPTION
2839:
2840: WHEN FND_API.G_EXC_ERROR THEN
2841:
2842: -- ROLLBACK TO get_org_unit_history;
2843: x_return_status := FND_API.G_RET_STS_ERROR;
2844: FND_MSG_PUB.Count_And_Get
2839:
2840: WHEN FND_API.G_EXC_ERROR THEN
2841:
2842: -- ROLLBACK TO get_org_unit_history;
2843: x_return_status := FND_API.G_RET_STS_ERROR;
2844: FND_MSG_PUB.Count_And_Get
2845: ( p_count => x_msg_count,
2846: p_data => x_msg_data
2847: );
2845: ( p_count => x_msg_count,
2846: p_data => x_msg_data
2847: );
2848:
2849: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2850:
2851: -- ROLLBACK TO get_org_unit_history;
2852: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2853: FND_MSG_PUB.Count_And_Get
2848:
2849: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2850:
2851: -- ROLLBACK TO get_org_unit_history;
2852: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2853: FND_MSG_PUB.Count_And_Get
2854: ( p_count => x_msg_count,
2855: p_data => x_msg_data
2856: );
2857:
2858: WHEN OTHERS THEN
2859:
2860: -- ROLLBACK TO get_org_unit_history;
2861: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2862:
2863: IF FND_MSG_PUB.Check_Msg_Level
2864: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2865: THEN