There are three methods of badi BADI_SD_SALES that may be useful for validating header texts of SD documents while saving:
BADI_SD_SALES~SAVE_DOCUMENT_PREPARE
BADI_SD_SALES~SAVE_DOCUMENT_PREPARE_PART2
BADI_SD_SALES~SAVE_DOCUMENT
These methods are called in perform beleg_sichern of program SAPMV45A. Make a new implementation of this badi in SE18 and write your code in the methods.