Ansicht
Dokumentation

HRSFEC_DETERM_COSTOB - BAdI: Determine Cost Object

HRSFEC_DETERM_COSTOB - BAdI: Determine Cost Object

General Material Data   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used for the integration of SuccessFactors Employee Central and your SAP ERP backend system. In this BAdI, you can determine cost objects other than the cost centers replicated from Employee Central to infotypes 0015 and 0027 in the SAP ERP backend system.

You implement this BAdI if you want to replicate cost centers from Employee Central that may not only be cost centers, but other cost objects such as internal orders or WBS elements.

Method: IF_HRSFEC_DETERMINE_COST_OBJEC~DETERMINE_COST_OBJECTS

If the incoming cost object is not a cost center, the fields WBS element or Work Order will be filled in infotypes 0015 and 0027.

Your SAP ERP backend system is customized for the mapping of cost centers in Employee Central to cost centers in the SAP ERP backend system. Make these settings under Personnel Management > Personnel Administration > Interfaces and Integration > Integration of SAP ERP HR Master Data and SuccessFactors Employee Central > Key Mapping of Organizational Terms > Assign External Cost Center Keys to Internal Cost Center Keys.

ERP Customizing:

The cost centers of Employee Central have to be mapped to cost centers and company codes in the ERP backend system.

You do not have to maintain a mapping if your cost center identifiers are identical in Employee Central and in the SAP ERP backend system.

If you use the predelivered implementation example class for the BAdI processing, you need to enhance the replication role with the following authorization attributes:

Authorization objects:

  • K_AUFK_ART: Activity: '03' (Display); please configure order status and order type according to your needs
  • K_ORDER: Actions for CO-OM Authorizations '0003'; please configure order type, internal order authorization, cost element and CO-OM responsibility area according to your needs
  • I_TCODE: Transaction Code: IW33

If you want to read further objects, you will need to add additional authorizations to the role.

There is no standard implementation for this BAdI.

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

The prerequisite for this sample implementation to function is that the cost centers in Employee Central that aren't actual cost centers are created in a way that they follow a specific pattern, for example all WBS elements start with "WBS_" and consist of a WBS element ID that is 6 characters long.

If none of the patterns match, the system assumes that the cost center is an actual cost center and therefore sets the flag to use the standard mapping for this cost center ID.

IF iv_cost_center_id IS NOT INITIAL.

IF iv_cost_center_id(3) = 'IO_'.

* This coding assumes that the order number is of length 6, for example 100020

* So you need to add the leading zeros in order to find company code, controlling area and business area

lv_int_order = iv_cost_center_id+3(6).

CONCATENATE '000000' lv_int_order INTO ev_internal_order. "for example. 000000100020.

ELSEIF iv_cost_center_id(4) = 'WBS_'.

lv_wbs_element = iv_cost_center_id+4(16). "external number provided

* If the external WBS element numbers are used,

* you need to map the external number to the internal number

* with this function module in order to find company code, controlling area and business area

CALL FUNCTION 'HRCA_CJPN_EXTERN_TO_INTERN_CNV'

EXPORTING

ext_num = lv_wbs_element " e.g. EMPREP1

IMPORTING

int_num = ev_wbs_element "e.g. 00000106.

EXCEPTIONS

not_found = 1

OTHERS = 2.

ELSE.

* if none of the patterns match, the system assumes that the cost center is an actual cost center and therefore sets the flag to use

* the standard mapping for this cost center ID

ev_use_standard_mapping = 'X'.

ENDIF.

ELSE.

* Error message can be filled because cost center ID is not filled.

* Cost center ID is empty making further processing not possible

* Please fill the error message into the provided message handler

* This ensures that you see the message in the application log (transaction: SLG1)

MESSAGE e124(paocf_ec_services) INTO lv_dummy.

MOVE-CORRESPONDING sy TO ls_msg.

TRY.

CALL METHOD co_message_handler->add_message

EXPORTING

message = ls_msg

cause = if_paocf_ec_b2b_msg_handler=>universal.

CATCH cx_hrpa_violated_assertion INTO lx_hrpa_violated_assertion.

ENDTRY.

ENDIF.

For more information about how to implement BAdIs in the Enhancement Framework, see SAP NetWeaver Library and choose Function-Oriented View -> Application Server -> Application Server ABAP -> Application Development in AS ABAP -> ABAP Customer Development -> Enhancement Framework.






BAL Application Log Documentation   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 6814 Date: 20240523 Time: 213304     sap01-206 ( 81 ms )