Hi,
In document type definition select only GL account check box, then no need to define any validation. System will allow postings to only GL accounts. If you do not want to post it through FB50, then define validation that do not allow the t.code for posting.
Regards,
Mukthar