I solved it.
<?php if( have_rows('affiliatepartner') ): ?>
<div class="external-links">
<?php while( have_rows('affiliatepartner') ): the_row(); ?>
<?php
$produkturl = get_sub_field('produkturl');
$buttontext = get_sub_field('buttontext');
?>
<a href="<?php echo esc_url( $produkturl ); ?>" class="button product_type_external" aria-label="<?php echo $buttontext; ?>" rel="nofollow" target="_blank"><?php echo $buttontext; ?></a>
<?php endwhile; ?>
</div>
<?php endif; ?>