Thank you guys.. I am not sure why it was going to the exit, but I just changed the exit, so it is now working.
The issue is that for postings through are coming through a BAPI, the system doesn't do a check and it posts.If I make the same posting manually, I get an error message.
How do I make the BAPI postings go through this exit?
I am using the standard BAPI_ACC_DOCUMENT_POST