SELECT DISTINCT hrl . country , hroutl_bg . name bg , hroutl_bg . organization_id , lep . legal_entity_id , lep . name legal_entity , hroutl_ou . name ou_name , hroutl_ou . organization_id org_id , hrl . location_id , hrl . location_code , glev . flex_segment_value FROM apps . xle_entity_profiles lep , apps . xle_registrations reg , apps . hr_locations_all hrl , apps . hz_parties hzp , apps . fnd_territories_vl ter , apps . hr_operating_units hro , apps . hr_all_organization_units_tl hroutl_bg , apps . hr_all_organization_units_tl hroutl_ou , hr_organization_units gloperatingunitseo , apps . gl_legal_entities_bsvs glev WHERE lep . transacting_entity_flag = 'Y' AND l