233:
234: UPDATE mtl_object_genealogy_interface mogi
235: SET process_status = 'E' , error_code = 9999, error_message = 'Invalid Organization. Organization and Parent Organization have to be the same.'
236: WHERE batch_id = p_batch_id
237: AND ( select mp.maint_organization_id from mtl_parameters mp
238: where mp.organization_code = mogi.organization_code )
239: <>
240: ( select mp.maint_organization_id from mtl_parameters mp
241: where mp.organization_code = mogi.parent_organization_code )
236: WHERE batch_id = p_batch_id
237: AND ( select mp.maint_organization_id from mtl_parameters mp
238: where mp.organization_code = mogi.organization_code )
239: <>
240: ( select mp.maint_organization_id from mtl_parameters mp
241: where mp.organization_code = mogi.parent_organization_code )
242: AND process_status = 'P';
243:
244: COMMIT;
252: END IF;
253:
254:
255: UPDATE mtl_object_genealogy_interface mogi
256: SET organization_code= (select organization_code from mtl_parameters
257: where organization_id = mogi.organization_id
258: and maint_organization_id is not null)
259: WHERE batch_id = p_batch_id
260: AND organization_id is not null
260: AND organization_id is not null
261: AND process_status = 'P';
262:
263: UPDATE mtl_object_genealogy_interface mogi
264: SET organization_id= (select organization_id from mtl_parameters
265: where organization_code = mogi.organization_code
266: and maint_organization_id is not null)
267: WHERE batch_id = p_batch_id
268: AND organization_id is null
286: fnd_file.new_line(FND_FILE.LOG,1);
287: END IF;
288:
289: UPDATE mtl_object_genealogy_interface mogi
290: SET parent_organization_code= (select organization_code from mtl_parameters
291: where organization_id = mogi.parent_organization_id
292: and maint_organization_id is not null)
293: WHERE batch_id = p_batch_id
294: AND parent_organization_id is not null
294: AND parent_organization_id is not null
295: AND process_status = 'P';
296:
297: UPDATE mtl_object_genealogy_interface mogi
298: SET parent_organization_id= (select organization_id from mtl_parameters
299: where organization_code = mogi.parent_organization_code
300: and maint_organization_id is not null)
301: WHERE batch_id = p_batch_id
302: AND parent_organization_id is null