(DV-2111) ERP Report - BADI comparator
When you are executing the "Set comparison settings" step in ERP 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 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 the 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 the parameter Report compare package size in 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 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 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 active log is provided by this method