Use 'M3 Document. Connect Media' (CRS929) to define the media connected to documents. The definition states the media support per document number. By connecting a document number to a media code, that combination is validated.
You can also generate the records in (CRS929) by selecting function key F15='Gen all' in 'M3 Document. Open' (CRS928).