(DV-2011) ERP Report - BADI comparator
When you are executing "Set comparison settings" step in ERP Report Test Case you are able to select "BAdI Report Comparator" for report comparator type setting. Test Case with this setting will not use standard 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 custom comparator class new implementation for BAdI definition /DVD/EQS_BADI_REP_COMPARE ( located under enhancement spot /DVD/EQS_EHNS_REP ) must be created.
Implementing class must implement interface /DVD/EQS_IF_BADI_REP_COMPARE.
Created implementation must be set to "Active" to take effect. Otherwise 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. Number of received lines depend on parameter Report compare package size in Validate settings. Each line which was successfully matched with expected similarity should be deleted from the corresponding table. Only unmatched lines has to remain in 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 do decide similarity of both report outputs.
- /DVD/EQS_IF_BADI_REP_COMPARE~SET_MAPPING - this method allows to receive predefined mapping and custom mapping if was ste in the variant. This method is called before calling method COMARE.
- /DVD/EQS_IF_BADI_REP_COMPARE~SET_SETTINGS - this method allows to receive all variant attributes including comparison settings. This method is called before calling method COMARE .
- /DVD/EQS_IF_BADI_REP_COMPARE~SET_LOG - instance of active log is provided by this method