Ansicht
Dokumentation

ECPAO_BADI_VALIDITY - BAdI: Validity Periods for Data Replication to EC

ECPAO_BADI_VALIDITY - BAdI: Validity Periods for Data Replication to EC

CPI1466 during Backup   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the integration add-on for Enterprise Resource Planning (ERP) and SAP SuccessFactors Employee Central (EC) when extracting data from the ERP system and replicating it to Employee Central.

You can use this BAdI for the Employee Data and the Organizational Data integration types.

Using this BAdI you can classify employee data that is extracted from the ERP system as relevant or not relevant for the replication to Employee Central, based on specific time segments and country value. Filtering of the employee data for extraction should be done only for country. To do so, you define periods based on countries in which the data is valid for the replication. Data that is outside these periods is classified as invalid for the replication. This way you can define segments of employees whose data is to be replicated to Employee Central.

Additionally, you can completely exclude employees from the data replication whose data is mastered in Employee Central.

Example
An employee can be based in different countries over time. For some of these countries, data is to be transferred to Employee Central, for others not. For example:
  • January 1, 2013 - May 31, 2013: Country 1 - data is to be transferred to Employee Central

  • June 1, 2013 - December 31, 2013: Country 2 - data is not to be transferred to Employee Central

  • January 1, 2014 - December 31, 9999: Country 1 - data is again to be transferred to Employee Central

Therefore, you define the following validity periods using this BAdI:
  • January 1, 2013 - May 31, 2013

  • January 1, 2014 - December 31, 9999

In these periods, this employee is considered as active in Employee Central and the employee's data is transferred to Employee Central.
June 1, 2013 - December 31, 2013 would not be a validity period. In this period, this employee is considered as inactive in Employee Central.

The BAdI is called by the Employee Data Extraction (ECPAO_EMPL_EXTRACTION) program when it extracts employee data from the ERP system. The program checks the validity periods for data extraction that you have defined using this BAdI, and removes the data from the extraction result which is outside of these periods. For more information about the program, see Employee Data Extraction.

Note
An exception is the job information data. If data was already transferred for an employee, the job information data is considered to be valid for the replication even if the organizational assignment of the employee changes and no validity period for data extraction is defined for the new organizational assignment. In such cases, the program ECPAO_EMPL_EXTRACTION does not remove the data from the extraction result that is outside of the validity period. This is to keep the history of the job information data.
Example
In the example given above, job information data would also be transferred for the period of June 1, 2013 - December 31, 2013.

For this integration type, the BAdI uses the GET_EMP_VALIDITY_SEGMENTS method with the following parameters:

  • Importing parameters
  • IV_PERNR: Personnel number of the employee for whom data is to be extracted

  • IT_P0001: Field or fields from infotype Organizational Assignment (0001) that you want to use as a selection criterion (for example, the Organizational Key of the employee)

  • IV_TEMPLATE_GROUP_ID (optional parameter): Transformation template group that you have defined in the VC_ECPAO_MAP view cluster

  • IV_COMPANY (optional parameter): Employee Central instance ID that you have defined in the EC Instance (V_ECPAO_COMPANY) view

  • Exporting parameters
  • ET_VALIDITY: Table consisting of the following fields:

BEGDA: Begin of the validity period
ENDDA: End of the validity period
  • EV_IS_EC_MASTER: Specifies that an employee's data is mastered in Employee Central

This indicator is set based on information that is stored for an employee in the infotype Organizational Assignment (0001). If this indicator is set, no data for this employee is extracted from ERP and transferred to Employee Central.

Using this BAdI you can exclude organizational objects from the data replication to Employee Central. The BAdI is called by the Organizational Data Extraction (ECPAO_OM_OBJECT_EXTRACTION) program when it extracts data from the ERP system. The program checks the validity of the organizational objects that you have defined using this BAdI, and removes the invalid objects from the extraction result. For more information about the program, see Organizational Data Extraction.

For this integration type, the BAdI uses the CHECK_VALID_OM_OBJECT method with the following parameters:

  • Importing parameters
  • IV_OTYPE: Type of the organizational object for which data is to be extracted

  • IV_OBJID: ID of the organizational object for which data is to be extracted

  • IV_ERP_TEMPLATE (optional parameter): Transformation template that you have defined in the VC_ECPAO_MAP_OM view cluster

  • IV_OSI_CODE (optional parameter): Type code of organizational structure item from key mapping table SFIOM_KMAP_OSI (01 = department, 02 = division, 03 = business unit, 04 = job classification, 05 = position)

  • IV_TEMPLATE_GROUP_ID (optional parameter): Transformation template group that you have defined in the VC_ECPAO_MAP_OM view cluster

  • IV_COMPANY (optional parameter): Employee Central instance ID that you have defined in the V_ECPAO_COMPANY view

  • Exporting parameter
  • EV_IS_INVALID_REPL: Specifies that the organizational object isn't replicated to Employee Central using the transformation template defined by the IV_ERP_TEMPLATE parameter

Note
You can use this BAdI, for example, to specify which organizational units are to be replicated to which type of organizational structure item (department, business unit, or division) in Employee Central. Let's say you use a template group that has templates for all three object types assigned, but you want to replicate the organizational unit with the ID 50014488 to an Employee Central division only. Therefore you implement the FILTER_ORG_UNIT_EXTRACTION method as follows:
  • For IV_OBJID = 50014488 and IV_ERP_TEMPLATE = ERP_DEPARTMENT, you set EV_IS_INVALID_REPL to X

  • For IV_OBJID = 50014488 and IV_ERP_TEMPLATE = ERP_BUS_UNIT, you set EV_IS_INVALID_REPL to X

  • For IV_OBJID = 50014488 and IV_ERP_TEMPLATE = ERP_DIVISION, you leave EV_IS_INVALID_REPL blank

You have created the following event reasons in Employee Central:

  • DATAVAL (event: Data Change, employee status: Active)
  • DATAINVAL (event: Data Change, employee status: Furlough)
  • PSEUDO_HIRE (event: Hire, employee status: Active)
Note
These event reasons are needed for replicating employee data in situations as described in the example above. In this example, a Data Change event with the event reason DATAINVAL and the employee status Furlough has to be carried out on June 1, 2013 so that the employee becomes inactive in Employee Central. On January 1, 2014, a Data Change event with the event reason DATAVAL and the employee status Active has to be carried so that the employee becomes active in Employee Central again.

You have made the required settings in the VC_ECPAO_MAP_OM or VC_ECPAO_MAP view cluster. For more information see Define Field Mapping for Organizational Data and Define Field Mapping for Employee Data.

To define validity periods for employee data extraction or exclude organizational objects from the data replication, create a customer-specific implementation of this BAdI.

  • CL_ECPAO_EMP_VALIDITY_TAB
This class contains some examples of how you can define validity periods for employee data and exclude organizational objects from the data replication. If you create a customer-specific implementation of this BAdI, you can copy the sample class for your implementation and adapt the coding to suit your requirements.





BAL Application Log Documentation   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 10981 Date: 20240523 Time: 170807     sap01-206 ( 171 ms )