Hi,
Why dont you try validation rule for this requirement.
You write validation like below in GGB0-> Financial Accounting -> Document Header
Prerequisite: You can mentione your company code, the document types where you want this check, any other specific to your document like system t-code.
Check: You can put your logic Value date (check from where it is referenced) > posting date (from BKPF)
Message: Put Error message as you want to be displayed and the document will not be posted
Value date is derived or referenced from either doc date, posting date or due date, you can check your system configuration about this logic and can reference those fields from BKPF.
For value date logic refer
Value date calculation logic during automatic payment process (APP)
Please let me know if this works for you.
Regards,
Jyoti