Pages

Wednesday, 18 September 2013

Hiring from SAP E-Recruitment portal (3)

What if we have additional information to be passed from SAP E-Recruiting to SAP ERP HCM System(ECC)?

We can achieve this by implementing the BAdI to add additional data / fields for inbound or outbound processing.

First you have to implement the BAdI for the outbound processing, which is with postfix "CreateConfirmation_Out".
Implement the method IF_PERSONNEL_HIRING_ADTNL_FLDS~HANDLE_ADDITIONAL_FIELDS

You can achieve two things here,
1. To add additional field by giving name and value.
2. Change any standard XI fields value

Sample code to change gender code value
  FIELD-SYMBOLS: <fs> TYPE LINE OF ty_namevalueasstring.

  DATA ls_fields TYPE LINE OF ty_namevalueasstring.

  READ TABLE ct_xi_shadow_fields ASSIGNING <fs> WITH KEY name = 'GENDER_CODE'.

  IF SY-SUBRC = 0 .
    move 1 to <FS>-VALUE   .
  ENDIF.

To add new field 'ZNAME' into XI fields table, you can use this sample code

  ls_fields-name = 'ZNAME'.
  move 'ZVALUE' to ls_fields-value  .
  INSERT ls_fields INTO TABLE ct_xi_shadow_fields.


No comments:

Post a Comment