WBS Replication Gaps Between SAP SuccessFactors Employee Central & SAP HANA

 

The Problem: WBS Elements Get Lost in Translation During Employee Replication

Organizations running SAP SuccessFactors Employee Central (EC) alongside SAP ECP (Employee Central Payroll) or an on-premise HR/PS backend often hit a familiar wall: cost distribution data captured in EC does not always land cleanly in Infotype 0027 (Cost Distribution) on the payroll side. Specifically, the WBS Element (Work Breakdown Structure) value coming from EC is stored as an external, human-readable string, while SAP Project Systems expects the internal PSP number (PSPNR) in field PSP01.

Without a bridge between these two formats, replication either fails silently, defaults to blank cost assignments, or requires manual correction after every payroll-relevant employee change. For finance and controlling teams that depend on accurate cost object assignment, this is more than a technical inconvenience. It is a data integrity risk.

Where the Gap Actually Lives

During Employee Central to Employee Central Payroll replication, custom fields configured on EC templates (in this case a template holding cust_WBSElement) are passed through the standard Integration Center or Point-To-Point replication flow. However, standard replication logic has no inherent awareness of:

      Which EC template and field actually carries the external WBS value

      How to convert that external WBS string into the internal PSP number SAP expects

      Where in Infotype 0027 that converted value needs to be written

This is exactly the kind of gap that SAP's Enhancement Framework was built to close, and it is where the ES_ECPAO_IN_EMPL_REPLICATION enhancement spot becomes relevant.

The Solution: A Targeted BAdI Implementation

Using the ECPAO_IN_EXT_PROCESS_INFOTYPE BAdI definition (part of the standard Employee Replication enhancement spot), we built a custom implementation, ZEI_HR_WBS_BIB_REPL, that hooks into the replication process specifically for Infotype 0027. The implementing class, ZHR_CL_WBS_BIB_REPL, executes the following logic during PROCESS_INFOTYPE:

      Scope the enhancement narrowly. The logic runs only when the infotype being processed is 0027, so there is zero impact on any other infotype replication.

      Read the EC payload dynamically. Rather than hardcoding structure types, the implementation uses RTTI (Runtime Type Identification) to call the public GET_EC_PAYLOAD method for the relevant EC template and dynamically assign the returned payload table, keeping the code resilient to structure changes.

      Extract the WBS value from the field-value pair table. The payload's FIELD_VALUE_PAIR_TAB is looped to find the entry where EC_FLD_NAME equals cust_WBSElement, and its corresponding EC_FLD_VALUE is captured as the external WBS string.

      Convert external to internal format. The extracted value is converted using the standard function module CONVERSION_EXIT_ABPSP_INPUT, which transforms an external WBS identifier (for example PY-1050-BOF-IT) into its internal PSP number equivalent.

      Write back into the primary record. The converted PSP number is written into field PSP01 of the Infotype 0027 primary record table, ensuring the payroll-side record carries a valid, system-recognized cost object reference.

The Implementation: Code Walkthrough

Here is the actual PROCESS_INFOTYPE method implementation, for anyone who wants to see how the five steps above translate into working ABAP:

METHOD if_ecpao_in_process_infotype~process_infotype.

 

  CONSTANTS:

    lc_it0027   TYPE infty            VALUE '0027',

    lc_templ_id TYPE ECPAO_ECTEMPL_ID VALUE 'WS_21',   " EC template holding cust_WBSElement

    lc_fld_wbs  TYPE string           VALUE 'cust_WBSElement'.

 

* Run only for Cost Distribution infotype (0027)

  CHECK infotype = lc_it0027.

 

*--------------------------------------------------------------------*

* 1) Call the public GET_EC_PAYLOAD method for the known WBS template

*--------------------------------------------------------------------*

  DATA lr_payload TYPE REF TO data.

  FIELD-SYMBOLS:

    <lt_payload> TYPE ANY TABLE,

    <ls_payload> TYPE any,

    <lt_fvp>     TYPE ANY TABLE,

    <ls_fvp>     TYPE any,

    <lv_name>    TYPE any,

    <lv_value>   TYPE any.

 

  DATA(lo_classdescr) = CAST cl_abap_objectdescr(

                            cl_abap_typedescr=>describe_by_object_ref( ec_payload ) ).

 

  DATA(lo_partype) = lo_classdescr->get_method_parameter_type(

                        p_method_name    = 'IF_ECPAO_IN_EC_PAYLOAD~GET_EC_PAYLOAD'

                        p_parameter_name = 'EC_PAYLOAD_TAB' ).

 

  CREATE DATA lr_payload TYPE HANDLE lo_partype.

  ASSIGN lr_payload->* TO <lt_payload>.

 

  ec_payload->get_ec_payload(

    EXPORTING

      ec_templ_id    = lc_templ_id

    IMPORTING

      ec_payload_tab = <lt_payload> ).

 

*--------------------------------------------------------------------*

* 2) Drill into FIELD_VALUE_PAIR_TAB and pull cust_WBSElement

*--------------------------------------------------------------------*

  DATA lv_wbs_ext TYPE string.

 

  LOOP AT <lt_payload> ASSIGNING <ls_payload>.

    ASSIGN COMPONENT 'FIELD_VALUE_PAIR_TAB' OF STRUCTURE <ls_payload> TO <lt_fvp>.

    CHECK sy-subrc = 0.

 

    LOOP AT <lt_fvp> ASSIGNING <ls_fvp>.

      ASSIGN COMPONENT 'EC_FLD_NAME' OF STRUCTURE <ls_fvp> TO <lv_name>.

      CHECK sy-subrc = 0.

 

      IF <lv_name> = lc_fld_wbs.

        ASSIGN COMPONENT 'EC_FLD_VALUE' OF STRUCTURE <ls_fvp> TO <lv_value>.

        IF sy-subrc = 0.

          lv_wbs_ext = <lv_value>.

        ENDIF.

        EXIT.

      ENDIF.

    ENDLOOP.

 

    IF lv_wbs_ext IS NOT INITIAL.

      EXIT.

    ENDIF.

  ENDLOOP.

 

  CHECK lv_wbs_ext IS NOT INITIAL.

  TRANSLATE lv_wbs_ext TO UPPER CASE.

 

*--------------------------------------------------------------------*

* 3) Convert external WBS -> internal PSP number

*--------------------------------------------------------------------*

  DATA lv_psp_int TYPE ps_posnr.

 

  CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'

    EXPORTING

      input  = lv_wbs_ext

    IMPORTING

      output = lv_psp_int.

 

  CHECK lv_psp_int IS NOT INITIAL.

 

*--------------------------------------------------------------------*

* 4) Overwrite PSP01 in the IT0027 primary record(s)

*--------------------------------------------------------------------*

  FIELD-SYMBOLS:

    <ls_rec> TYPE any,

    <lv_psp> TYPE any.

 

  LOOP AT pnnnn_primary_tab ASSIGNING <ls_rec>.

    ASSIGN COMPONENT 'PSP01' OF STRUCTURE <ls_rec> TO <lv_psp>.

    IF sy-subrc = 0.

      <lv_psp> = lv_psp_int.

    ENDIF.

  ENDLOOP.

 

ENDMETHOD.

 

Why each block matters

      Constants block - hardcodes the infotype (0027), the EC template ID (WS_21), and the custom field name (cust_WBSElement) in one place, so the enhancement is easy to adapt if the template or field name changes later.

      RTTI-based payload retrieval - instead of binding to a fixed structure, the code asks the class descriptor for the actual parameter type of GET_EC_PAYLOAD at runtime and creates a matching data reference. This means the implementation keeps working even if SAP or the EC template configuration changes the payload structure shape.

      Nested loop over FIELD_VALUE_PAIR_TAB - EC payloads are typically returned as generic name-value pairs rather than fixed fields, so the code has to search for the pair where the name matches cust_WBSElement before it can read the value.

      CONVERSION_EXIT_ABPSP_INPUT - this is the standard SAP conversion exit used specifically for WBS element external-to-internal conversion, the same one used by PS transactions like CJ20N. Reusing it means the conversion logic stays consistent with the rest of the Project Systems module.

      Final write-back loop - only overwrites PSP01 where the field exists on the structure, which keeps the code safe even if pnnnn_primary_tab occasionally contains different record shapes.

Why This Approach Works Well

      No core modification. Everything is delivered through a standard BAdI implementation, keeping the solution upgrade-safe and fully supported.

      Dynamic and reusable. By using RTTI instead of hardcoded payload structures, the same pattern can be extended to other EC templates or custom fields with minimal rework.

      Fail-safe by design. Multiple CHECK statements ensure the logic exits gracefully if the infotype does not match, if the field is not found, or if conversion does not return a value, rather than posting incomplete or incorrect data.

      Precise targeting. Because the enhancement is scoped to Infotype 0027 only, there is no risk of unintended side effects on other replication scenarios.

The Business Impact

For HR, payroll, and controlling teams, this closes a specific but high-friction gap:

      Cost distribution data entered once in Employee Central now flows through to payroll accurately, without manual PSP number lookups or corrections.

      Reduces post-replication cleanup effort for HR operations teams.

      Improves the reliability of cost center and project-based reporting downstream in Controlling (CO) and Project Systems (PS).

      Strengthens confidence in EC as the true system of record for organizational and cost assignment data.

Key Takeaway

Replication gaps between SAP SuccessFactors Employee Central and payroll or on-premise HR systems are rarely about missing data. More often, they are about format mismatches between what EC sends and what the receiving system expects. A well-scoped BAdI implementation on the ECPAO_IN_EXT_PROCESS_INFOTYPE enhancement spot, like the one covered here for WBS Element conversion, is a clean, maintainable way to close that gap without touching standard code.

If your organization is seeing similar replication mismatches for cost objects, custom fields, or infotype-specific data, this pattern of using EC payload extraction plus standard conversion exits plus targeted infotype write-back is a reusable template worth considering.

Tags: SAP SuccessFactors, Employee Central Payroll, ECP Replication, BAdI Enhancement, WBS Element Mapping, Infotype 0027, SAP HCM Integration, Cost Distribution