You need to change the post slug.
add_action('acf/save_post', 'modify_post_slug');
function modify_post_slug($post_id) {
$ref = get_field('ref', $post_id);
if ($ref) {
$post = get_post($post_id);
$slug = sanitize_title($post->post_title.' '.$ref);
$post->post_name = $slug;
remove_filter('acf/save_post', 'modify_post_slug');
wp_update_post($post);
add_action('acf/save_post', 'modify_post_slug');
}
}