Ansicht
Dokumentation

CRM_IU_DSM_EQUIPMENT - BAdI: Define Predefined Searches and Validate Equipment

CRM_IU_DSM_EQUIPMENT - BAdI: Define Predefined Searches and Validate Equipment

Addresses (Business Address Services)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the Application (CRM_IU_DSM_APL) and Agreement (CRM_IU_DSM_AGR) components. You can use this BAdI for the following functions:

  • Searching for equipment to define a search criteria - predefined searches for the equipment installation and removal dates.
  • Validating an equipment during the creation of an equipment itemfor a measure item in DSM applications or agreements or during changes of the validity dates of a measure item.

The interface for the BAdI has two methods:

You can implement the method GET_EQUIPMENT_SEARCH_PERIODwhen you need to define your own search for the installation and removal dates of equipment based on the given predefined search key from Customizing,measure item and header information.

For example, Customizing entries for predefined searches can contain the following options:

  • Currently Installed

  • Past 30 days

  • Past 60 days

  • Past 90 days

On the search help, select one of the entries. The key of this entry is passed to the method as a parameter (IS_SELECTED_PDS_KEY). You can then implement specific logic in the method to define the search period for the installation or removal dates.

For example, you want to define the search period from the current date minus 30 days until the end of the measure validity. It would mean that all equipment where installation date falls within this period are selected. The resulting period needs to be provided in the exporting parameters ES_INSTALL_DATE_SEARCH_PERIOD and ES_REMOVAL_DATE_SEARCH_PERIOD.

You can implement method VALIDATE_EQUIPMENT_ITEMif additional validation of the equipment item is necessary. This method is called when you try to assign selected equipment to a measure (create equipment item).

This BAdI does not have a default implementation; nevertheless, it has a fallback class CL_CRM_IU_DSM_EQUIPMENT_EXAMPL, which is executed whenever customer implementation is not found. This BAdI is for single use (only one BAdI implementation can exist in the system) and does not have filters.

For more information about the standard settings (filters, single, or multiple uses), see the Enhancement Spot Element Definitions tab page in the BAdI Builder (transaction SE18).

For information about the implementation of BAdIs in the context of the Enhancement Concept, see SAP Library for SAP NetWeaver under BAdIs - Embedding in the Enhancement Framework.

Example

SAP provides the following logic in this example:

For the method GET_EQUIPMENT_SEARCH_PERIOD, when Currently Installed is selected, es_install_date_search_period-date_to is current date plus 1 and es_removal_date_search_period-date_from is the current date, minus 1.

When Past 30 or, past 60 or, past 90 days are selected, es_install_date_search_period-date_from is the current date minus 30, 60 or 90 days respectively; es_install_date_search_period-date_to is the current date.

For the method VALIDATE_EQUIPMENT_ITEM, equipment is not valid when its installation period does not overlap with the measure validity period.






TXBHW - Original Tax Base Amount in Local Currency   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 5212 Date: 20240523 Time: 183928     sap01-206 ( 144 ms )