SAP Invoice Search Component
You can extend the SAP Invoice Search Component by adding up to 10 fields at the end of the search result table. You can also replace the standard search with a custom selection.
The SAP Invoice Search Component calls BAdI /ENSXSFCI/SD_INVOICE_SEARCH.
The BAdI contains two methods: SEARCH and ADDITIONAL_FIELDS.
Method SEARCH
The SEARCH method receives the IS_CONTEXT results and the IV_ORDERBY results generated by the paging logic and returns the CT_KEY invoice search structure (it contains the Customer Number). The CV_IMPLEMENTED flag should be set if this method is implemented. You can use the CUSTOM tab in the Context to pass extra selection fields from the front-end.
The SAP Invoice Search Component logic checks the CV_IMPLEMENTED flag and ignores the standard search if it's set.
Method ADDITIONAL_FIELDS
The ADDITIONAL_FIELDS method receives the CT_DATASET search result table and lets you add values to the CUSTOM01 - CUSTOM10 fields in the table. This method is called after all the SAP Invoice Search Component logic is executed.
Example Implementation
We provide an example implementation class: /ENSXSFCI/CL_INV_SEARCH_BADI. You can copy the example implementation and add/replace it with your own logic and fields.
In the SEARCH method, this class receives SD Document Currency keys using the WAERK key in the CUSTOM tab of the Context and filters the results by Currency.
In the ADDITIONAL_FIELDS method, the INCO1 field (Incoterms 1) is returned in field CUSTOM01 of CT_DATASET.