(DV-2211) SAP Report - BADI Comparator
When you are executing the Set comparison settings step in the SAP Report Test Case you are able to select BAdI Report Comparator for the report comparator typesetting. Test Case with this setting will not use standard SNP Validate functionality to compare before and after image data but will call the appropriate implementation of BAdI /DVD/EQS_BADI_REP_COMPARE. This enables you to implement your own custom compare logic. This section describes basic information about implementing a custom BAdI comparator class.
Implementation
To implement a custom comparator class new implementation for the BAdI definition /DVD/EQS_BADI_REP_COMPARE (located under enhancement spot /DVD/EQS_EHNS_REP) must be created.
Implementing class must implement the interface /DVD/EQS_IF_BADI_REP_COMPARE.
Created implementation must be set to Active to take effect. Otherwise, SNP Validate default BAdI comparator implementation will be used.
BAdI Interface Description
Following methods of the interface /DVD/EQS_IF_BADI_REP_COMPARE should be implemented in your BAdI implementation:
- /DVD/EQS_IF_BADI_REP_COMPARE~COMPARE: Receives tables with all lines from before and after image to be compared. The number of received lines depends on the parameter Report compare package size in SNP Validate settings. Each line that was successfully matched with the expected similarity should be deleted from the corresponding table. Only unmatched lines have to remain on those tables. Exporting parameter EV_DIFFERENT must be set by the implementation to decide if rows do match. Exporting parameter EV_SIMILARITY can be set to decide the similarity of both report outputs.
- /DVD/EQS_IF_BADI_REP_COMPARE~SET_MAPPING: This method allows you to receive predefined mapping and custom mapping if it was set in the variant. This method is called before calling method COMPARE.
- /DVD/EQS_IF_BADI_REP_COMPARE~SET_SETTINGS: This method allows you to receive all variant attributes including comparison settings. This method is called before calling method COMPARE.
- /DVD/EQS_IF_BADI_REP_COMPARE~SET_LOG: Instance of the active log is provided by this method