one caveat
Your friend must check in for the COPA flight on the same ticket when he initially checks in on AA. I have had real problems checking in at PTY in the middle of a trip. You almost have to exit immigration and start over at the ticket counter. Don't buy two tickets, buy one.