Hi,
The 'EXIT' command does not cause a dump - it will just exit your function module cleanly.
By the way - just to be clear - you are not building a 'BAPI' (a SAP-standard API module with a published interface), you are building a custom function module.
Unless you're a developer working at SAP?
cheers
Paul