Product Lifecycle Management Blogs by Members
Get insider knowledge about product lifecycle management software from SAP. Tap into insights and real-world experiences with community member blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member209335
Contributor

What is Business Add-In(BADI)?

A business add-in (BADI) is a source code plug-in provided by SAP to enhance existing ABAP code. The enhancement technique uses the object-oriented method and business add-ins to map the specific requirements involved in business process. These are customer specific, and are not provided by standard code in SAP. BADIs allow the system landscape to be multilevel (country-specific, industry-specific, partner-specific, customer-specific, etc.) and hence accommodate a wider range of solutions without affecting the original source code of the object.

 

1) BAdi :Create and Initialize PCBO (Process control business objective)

You can use this BAdI to implement customer-specific logic to adapt the processes in the system. You can use this BAdI, for example, if your organization must comply with regulatory requirements in more than one country or region. You can create a variation of the process for a specific country or region.

Requirements

You have specified process definitions in the Customizing activity specify process definitions for Foundation of SAP EHS Management.

You have performed a consistency check without errors in the Customizing activity List configured processes for Foundation of SAP EHS Management.

Standard settings

This BAdI does not have a default implementation

2) BAdi : Definition of Process Steps

You can use this BAdI to define the persons that are involved in the process step of a given work process.

The process can contain the following people:

  • Responsible Person
  • Implementor
  • Approver

In the components of SAP EHS Management, there are specific processes that involve action. In these processes, workflow tasks are used to perform the work. You can use this BAdI to return the specific workflow task and to integrate your business processes.

Standard settings


In the standard system, the following BAdI implementations are activated:


  • EHHSS_ACTION_BADI_IMPL (implementation for incident management)
  • BADI_IMPL_EHHSS_RAS_ACTION (implementation for risk assessment)

The BAdI is filter-dependent and not designed for multiple use.

3) BAdi : Determination of Objects to Extract

You can use this BAdI to adjust the existing extractors or implement your own extractors. The extractors extract data to use in analytical reporting.You can also create a customer-specific BAdI implementation with logic, for example, to extract only the objects that have been changed since the last extraction of multiple objects.

Requirements

Each BAdI implementation corresponds to one or more DataSources. You have created the corresponding DataSources in RSA2.

You have configured the extractor for each DataSource in the Customizing activity configure extractors for SAP EHS Management under Foundation for EHS Management.

Standard settings

The BAdI definition is called once at the beginning of an extraction process.The BAdI definition contains the following methods:


  • INITIALIZE

  This method implements the actuallogic to determine the objects to extract. 

  • GET_ITERATOR

This method returns an iterator object to iterate through the determined objects for further extraction of the objects' data.

BAdI Implementations


  • BADI_EHFND_FW_BI_BOPF_OBJ_LIST

This implementation enables you to extract data from only one business object. The default implementation supports full loads by selecting all instances of the configured business object. The default implementation also supports delta loads by checking which instances of the configured business object have been changed since the last extraction.


3) BAdi : Extraction of One Object

You can use this BAdI to adjust the existing extractors or implement your own extractors. The extractors extract data to use in analytical reporting. You can also create a customer-specific BAdI implementation with logic, for example, to extract the data of one business object instance.

Requirements

Each BAdI implementation corresponds to one or more DataSources. You have created the corresponding DataSources in transaction RSA2.

You have configured the extractor for each DataSource in the Customizing activity configure Extractors for SAP EHS Management under Foundation for EHS Management.

Standard settings

The BAdI definition is called once for each business object instance to extract.The BAdI definition contains the following methods:

     INITIALIZE

This method enables you to perform any required initializations, for example, to evaluate the configuration. 

   EXTRACT_NEXT_OBJECT

This method reads and returns the data of one business object instance.

BAdI Implementations.


BADI_EHFND_FW_BI_BOPF_EXTRACT

The default implementation enables you to extract data from one node of a BOPF business object. You can use the BAdI, for example, to read data from multiple business objects nodes or from any other source, and combine the data in a transient node. The BAdI can then extract data from the transient node.

Note: You must create a customer-specific BAdI implementation for this extractor if you want to extract data from business objects that were not modeled with BOPF, or if you want the extractor to extract data from multiple nodes of a BOPF object that cannot be handled with one transient node.


4) BAdi : Electronic Report Shipment

You can use this BAdI to implement customer-specific logic for electronically shipping reports to a receiving party, for example, a legal authority, such as the Indian workers' compensation association. The BAdI allows you to adapt the report shipment process to company-specific requirements by enabling the use of different exchange formats and different channels of communication. You can, for example, use the BAdI if you want to send incident reports in an XML format via a Web service.

This BAdI is called before a report is sent to determine if a BAdI implementation exists for that type of report. If an implementation exists, you can choose to send the report electronically, and the system calls the BAdI again in the report shipment process. The BAdI then uses the SEND_REPORT method to do the following:


  • Generate the report in the correct output format
  • Ship the report to the receiving party
  • Complete the shipment process by reporting the success or failure of the shipment back to the system.

Requirements

  • You have configured the process foundation in Customizing for SAP EHS Management under Foundation for EHS Management -> Process Foundation. Ensure that the event linkage is active in activity Aciticate linkage for scheduled processes.
  • You have configured the processes used in incident management, specifically the following process definition, in Customizing activity Configure process definitions:

  Component: HSS 

Purpose: INC_REPORT

Variant: STANDARD

  • You have specified task recipients in Customizing activity assign default roles to workflow tasks.

Standard settings

The standard system does not include a default implementation for the BAdI.

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


5) Integration of Financial Transaction Objects:

You can use this BAdI to enable access to cost collectors in other components for financial tracking. The components can either be managed locally or in a remote system.

This BAdI is delivered with active implementations for the following types of cost collectors:


  • Internal order (Accounting (AC))
  • Maintenance order (Plant Maintenance (PM))
  • Service order (Customer Service (CS))

To enable access to other cost collectors, you can create additional BAdI implementations. The following methods are available:

  • ADD_FIN_TRANS_OBJECT (Add Financial Transaction Object)

This method is executed when you add a financial transaction to an incident record. 

  • DETAILS_FIN_TRANS_OBJECT (Display Details for Financial Transaction Object)
    This method is executed when you display the details for a financial transaction object.
  • REFRESH_FIN_TRANS_OBJECT (Refresh Data for Financial Transaction Object)
    This method is executed when you refresh the list of financial transaction objects.

If this BAdI is implemented, you can assign cost collectors from integrated components as financial transactions to an incident record.

Note

If you have defined an enhancement including customer-defined dialog boxes for the application configuration EHHSS_INC_REC_OIF_V3, you can use implementations of the BAdI methods ADD_FIN_TRANS_OBJECT and DETAILS_FIN_TRANS_OBJECT to specify which dialog boxes are called when you assign cost collectors to an incident.

Requirements

  • In the Customizing activity Specify Financial Transaction Categories, you have added a financial transaction category for each cost collector type that you want to use for financial tracking. You have selected the IntegrObj checkbox for these categories.
  • If you want to use cost collectors in components that are managed in a remote system, you have defined the required RFC destinations in the Customizing activity Specify Destinations for Integration.

Standard settings BAdI Implementations


  • BADI_EHHSS_FIN_TR_INT_ORDER

This BAdI implementation enables access to internal orders that exist in Accounting.

  • BADI_EHHSS_FIN_TR_MAINT_ORDER

This BAdI implementation enables access to maintenance orders that exist in Plant Maintenance. 

  • BADI_EHHSS_FIN_TR_SRV_ORDER

This BAdI implementation enables access to service orders that exist in Customer Service.

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

6) Check Readiness for Action

You can use this BAdI to perform checks on the following actions:


  • Set status of a data record to Closed
  • Set status of a data record to Void
  • Set status of an incident investigation to Closed
  • Set status of an investigation step to Closed

For each action, a BAdI implementation is delivered that you can use to perform the corresponding check in the standard system. If necessary, you can also deactivate the standard implementations and implement customer-specific checks instead. 

If you implement customer-specific checks, you must ensure that these are complete in terms of data consistency and legal requirements, for example, when generating legal reports based on the incident data.

Standard settings

The BAdI is active in the standard system.

BAdI Implementations

BADI_RDY_FOR_ACT_INC_CLOSE

You use this BAdI implementation to perform the following checks before the status of an incident is set to Closed:

    • Check if the Restricted Access attribute for the incident is set to Yes or No
    • Check if an incident group is assigned
    • Check if the Investigation Required attribute is set to Yes or No
    • If an investigation is required, check if the investigation is completed
    • If the incident is an occupational incident, check if at least one involved person has the Injured Person role
    • If the incident is classified as Release, check if at least one release is assigned
    • Check if the Reporting Required attribute for a release is set to Yes or No
    • Check if risk matrix entries are complete and confirmed
    • If the incident is classified as a notice of violation, check if at least one notice of violation is assigned
    • If the incident has actions assigned, check if all actions that are not recurring are complete
    • Check if all inquiry processes are complete
    • For any injured person, check if the Required in Summary Report attribute is set to Yes or No
    • For any release of incident, check if the Reporting Required attribute is set to Yes or No

BADI_RDY_FOR_ACT_NM_CLOSE:

  You use this BAdI implementation to perform the following checks before the status of a near miss is set to Closed :

 

    • If the near miss has actions assigned, check if all non-recurring actions are complete
    • Check if all inquiry processes are complete

BADI_RDY_FOR_ACT_SO_CLOSE

  You use this BAdI implementation to perform the following checks before the status of a safety observation is set to Closed: 

    • If the safety observation has actions assigned, check if all non-recurring actions are complete
    • Check if all inquiry processes are complete

BADI_RDY_FOR_ACT_INC_VOID

BADI_RDY_FOR_ACT_NM_VOID

BADI_RDY_FOR_ACT_SO_VOID

You use these BAdI implementations to implement customer-specific checks that you want to perform before an incident, near miss, or safety observation is set to Void. The implementations do not perform any checks in the standard system. 

BADI_RDY_FOR_ACT_INV_CLOSE

You use this BAdI implementation to perform the following checks before the status of an investigation is set to Closed:

    • Check if the Investigation Required attribute is set to Yes or No
    • Check if an investigation lead is assigned
    • Check if a major root cause is selected
    • Check if all investigation steps are complete (status Closed, Void, or Completed)

  BADI_RDY_FOR_ACT_STEP_CLOSE 

You use this BAdI implementation to perform the following check before the status of an investigation step is set to Closed: 

For investigation steps with the step category EHHSS_ST_CAT_ROOTCAUS, check if all assigned actions are complete (status Closed, Void, or Completed).


7) Check Incident Reports

You can use this BAdI to perform checks for data completeness in incident reports.If you implement customer-specific checks , you must ensure that these are complete in terms of data consistency and legal requirements, for example, when generating legal reports based on the incident data.


If you deactivate or change a check, you must also ensure that all actions are complete or are in the process of completing.

Standard settings

  The BAdI is active in the standard system


8: BAdI : Investigation Lead Determination

By default, the investigation lead is automatically set to the current incident manager.You can use this BAdI to change how the default investigation lead is determined.


BADI : Determination of FTE and Working Time from PT

You can use this BAdI implementation to activate or deactivate the integration of Personnel Time Management (PT) for analytical reporting in SAP EHS Management (EHS-MGM). If you activate the BAdI implementation, the system determines the key figure values for Full-Time Equivalents and Working Time per organizational unit and calendar day from PT.


As only employee data is managed in PT, no key figure values are determined for external persons or business partners. To include key figures for external persons or business partners in analytical reports, you can create a customer-specific implementation of the Business Add-In Determination of FTE and Working Time.You can also use an implementation of this BAdI to determine key figure values according to company-specific determination rules.

Note

If you activate this implementation and an implementation of the BAdI Determination of FTE and Working Time, the system combines the results of both determination runs per employee, if appropriate.

Requirements

You have made the required settings for analytical reporting using the SAP NetWeaver Business Warehouse.

Standard settings

The BAdI implementation is active in the standard system.

9) BAdI: Determination of FTE and Working Time:

You can use this BAdI to determine the key figure values for Full-Time Equivalents and Working Time according to customer-specific rules. The key figures are determined for reporting purposes:


  • Full-Time Equivalents: analytical reporting
  • Working Time analytical reporting and legal reporting, for example, OSHA reporting

Note 

The key figure values for Full-Time Equivalents and Working Time values are always determined per organizational unit and date period. The system takes into account all objects (for example, employees or business partners) that are directly assigned to an organizational unit or that are assigned to a subordinate organizational unit.


Requirements

The following prerequisites must be met:

  • You have made the required settings for analytical reporting using the Business Information Warehouse.
  • You have specified the required forms for legal reporting in the Customizing activity Specify Formsfor Foundation for EHS Management.

Standard settings

 

The BAdI is not active in the standard system.

10 ) BAdI: Transfer of Incident Data to GRC

You can use this BAdI to transfer incident data from the incident management application to a remote SAP BusinessObjects governance, risk, and compliance solutions (GRC solutions), especially to the SAP BusinessObjects Risk Management component.

Use

This Business Add-In (BAdI) is used in the SAP EHS Management (EHS_MGM) component. You can use this BAdI to transfer incident data from the incident management application to a remote SAP BusinessObjects governance, risk, and compliance solutions (GRC solutions), especially to the SAP BusinessObjects Risk Management component.


To report incidents to GRC solutions, the BAdI proceeds as follows:

  1. 1. It uses the method START_GRC_WORKFLOW to determine all incidents that must be reported:

a) It determines all incidents that have not yet been reported to GRC solutions.

b) It restricts the number of relevant incidents according to the selection criteria specified in the Customizing activity Specify Selection Criteria for Data Transfer.

Note: This method is delivered with the standard system and must not be changed.

  1. 2. It uses the method SET_GRC_DATA to fill the predefined data structure and transfer the relevant data for each incident to the GRC solutions system.

The BAdI is called when you save an incident record.


Requirements

You have enabled integration with GRC solutions by activating the BAdI implementation BADI_EHHSS_INC_GRC_INT.

Standard settings

The BAdI is not active in the standard system.

11) BAdI: Finalization of Initial Creation of EHS Incident


12) BAdI: Creation of EHS Incident


13) BAdI: Creation of Attachment Folder for EHS Incident


14) BAdI: Creation of Release for EHS Incident:


15) BAdI: Creation of Involved Party for EHS Incident


16) BAdI: Finalization of Initial Creation of EHS Incident


17) BAdI: Creation of EHS Incident


18) BAdI: Creation of Attachment Folder for EHS Incident

19) BAdI: Creation of Release for EHS Incident


20) BAdI: Creation of Involved Party for EHS Incident

You can use this BAdI if you use an enterprise service for recording incidents. This BAdI changes or extends the data transferred through the message interface EHSIncidentFinaliseInitialCreationRequestConfirmation_In that is part of the EHS Incident Processing process component.

Standard settings

The BAdI is intended for multiple uses and is not filter-dependent.This BAdI uses the following methods:



  • INBOUND_PROCESSING

  To enable you to integrate your own conversions, this method is called after the default mapping of the service-oriented architecture (SOA) request message to the EHS Incident. 

  • OUTBOUND_PROCESSING

To enable you to integrate your own conversions, this method is called after the default mapping of the EHS Incident to the SOA confirmation message.

  This BAdI definition uses the IF_EHHSS_INC_FICRTRC_IN interface.

21) BAdI: Check Readiness for Action

You can use this BAdI to perform checks on the following actions:

  • Set status of a data record to Closed
  • Set status of a data record to Void
  • Set status of an incident investigation to Closed
  • Set status of an investigation step to Closed

For each action, a BAdI implementation is delivered that you can use to perform the corresponding check in the standard system. If necessary, you can also deactivate the standard implementations and implement customer-specific checks instead.

Caution If you implement customer-specific checks, you must ensure that these are complete in terms of data consistency and legal requirements, for example, when generating legal reports based on the incident data.



Standard settings

The BAdI is active in the standard system.

22) BAdI: Check Incident Reports

You can use this BAdI to perform checks for data completeness in incident reports.If you implement customer-specific checks , you must ensure that these are complete in terms of data consistency and legal requirements, for example, when generating legal reports based on the incident data.

Caution If you deactivate or change a check, you must also ensure that all actions are complete or are in the process of completing.

Standard settings

  The BAdI is active in the standard system

23) BAdI: Calculate Risk Rating and Determine Risk Icon

You can use this BAdI to adapt the standard logic to calculate risk ratings and to determine the risk icons that are displayed. The risk icons are set according to the risk rating. The risk rating is calculated for each affected area based on configurable scores for the following risk parameters: severity, likelihood to reoccur, frequency and duration. The calculated value can be manually overwritten by the user. The default logic for calculating risk ratings and determining risk icons is as follows:


 

  • The scores of the affected areas are added.
  • The rating is determined according to the lower and upper limit of the sum of scores.
  • The risk icon is determined according to the risk rating configuration.

  The BAdI method calculate_risk receives the relevant risk type (initial or residual), the precalculated sum of risk scores, the distinctive scores for severity, likelihood to reoccur, frequency and duration, and returns the value for the risk icon.

Requirements

 

You have made the following settings in the Customizing for SAP EHS Management under Incident Management

Specify Affected Areas

Specify Severity

Specify Likelihood

Specify Frequency

Specify Duration Classifications

Specify Risk Ratings

Standard settings

This BAdI is active in the standard system:

24) BAdI: Data Transfer to Follow-Up Assessment

You can use this BAdI to copy data from an existing risk assessment to a follow-up risk assessment. The BAdI is called when you create a follow-up assessment, for example, to reassess identified risks after a regulation has changed.


The BAdI uses the method COPY_ALL_RISK to copy all relevant data. It creates a new risk revision for each risk that is copied to the follow-up assessment. This allows you to edit risk data in a follow-up assessment without changing the data that was originally recorded for the selected risk

Standard settings


The BAdI implementation EHHSS_COPY_ASSESSMENT_IMPL is delivered with the standard system

25) BAdI: Risk Level Calculation:

You can use this BAdI to determine the risk value and the risk level for an identified risk.

The BAdI uses the method CALCULATE_RISK to determine the risk level:

  • It calculates the risk value by using a mathematical operator to combine the risk scores of the individual risk matrix dimensions:

    • Severity
    • Likelihood
    • Exposure frequency

  Note: If you use a graphical risk matrix, the BAdI automatically determines the risk values for all possible combinations of risk scores that are included in the risk matrix. 

It determines the risk level that is specified for the calculated risk value in the Customizing activity Specify Risk Levels

Standard settings

The BAdI implementation EHHSS_RISK_LEVEL_CALC_IMPL is delivered with the standard system. This BAdI implementation calculates the risk value by multiplying the risk scores that have been specified for the individual risk matrix dimensions.

26) BAdI: Automatic Control Evaluation:

You can use this BAdI to provide automatic evaluation of the effectiveness of controls. In the application, the user can choose to evaluate the effectiveness automatically instead of manually entering the effectiveness or requesting a control evaluation be performed.

Standard settings

This BAdI does not have a default implementation.

The BAdI has the two following exporting parameters:

  • Date of effectiveness evaluation (EHFND_DATE)
  • Effectiveness code (EHHSS_CTRL_EFFECTIVN_CODE)

Common problems that BAdIs solve:

● Standard software – the customer wants specific changes but modifications cause problems.

The solution is a BAdI, a type of enhancement with a well-defined interface; BAdIs are more robust to changes than source code plug-ins.

● Different country and industry solutions need their own specific solution of a specified problem.

The solution is to create a BAdI definition in the core and the different countries can add their own implementations.

● You want to add and later choose parts of code dynamically.

The solution is to create an internal BAdI and add the different parts in different implementations. The BAdI and its implementations may belong to different software layers.

● As an SAP developer, you have a program in the SAP standard and want to give customers the chance to add some specific code of their own.

The solution is to include BAdI calls in the standard software. The customer can add the implementations of these objects later.

● You have a program which needs specific implementations for different countries.

The solution is to put the country-specific parts in BAdI implementations. These implementations can be overwritten later for the respective countries without modifying the original program that contains the BAdI calls.

● You want to program a registry.

It is possible to use the BAdI infrastructure to build a high-performance registry. In that case, the filter is used as selection criteria for the registry.

Edward.





4 Comments