Hi Cecilia,
If you are making the payment in local currency for the invoice in foreign currency, then system will definitely generate exchange rate difference. It is a standard behaviour of the system. However, you can define reason codes for exchange rate differences in OBBE and later you assign the GL accounts to the reason in OBXL. After that, when you are making payment for the invoice, for any difference you can do residual posting by set off it to the above reason code. Then system will create a open item for the vendor for the difference. Later when you receive debit memo from the vendor, you can cross check with it and do payment for it.
Regards,
Mukthar