You can add exclusions when creating eDocuments based on the fields in the BKPF, BSEG, BSET, BSEC, EDOCUMENT and BSE_CLR tables in the "SII intermediate creation exception" enhancement point.
If you want to add an exception that takes into account some field not included in the mentioned tables, it is necessary to use this BAdI in order to implement a solution.
The indicated correction is covered by the implementation of the CHANGE_CREATION method.
Creating the Enhancement
Through transaction SE18 we access the enhancement point /EDGE/SII_EVENTOS_CREACION and create the corresponding implementation (or reuse a previously generated expansion).
Next, we implement the CHANGE_CREATION method to complete the code that will exclude the eDocuments that do not fulfill the desired condition.
The example below will exclude those eDocuments that in an associated financial document have a provider with country code KP.