Hi Michelle,
This is standard requirement for lot of companies, where you need to send payment advices to vendors and print them for records.
As you mentioned you were able to send email payment advice to vendor by copying Function module and implement BTE2040.
in the same program you have to modify the logic to print it. Please take your Abaper help to achieve this.
below link will help you to impletement Payment advice print and sending Email.
Regards,
Sree