Pages

Monday, 15 July 2013

Useful class to retrieve or maintain your E-Recruiting candidate

If you have a development to display/ maintain your candidate in E-recruting, you might want to consider to use this handy class to serve your purpose.


Sample coding on how to retrieve telephone number from the using the BP number:
  DATA: lo_bas                    TYPE REF TO cl_hrrcf_candidate_bupa_bl.
  DATA: lo_exception              TYPE REF TO cx_hrrcf.
  DATA: lt_candidates             TYPE  rcf_t_hrobject,
        ls_candidates             LIKE LINE OF lt_candidates,
        lt_telefondata            TYPE rcf_t_telefondata_bp,
        ls_telefondata            TYPE rcf_s_telefondata_bp.

              CALL METHOD cl_hrrcf_candidate_bupa_bl=>get_instance
                RECEIVING
                  return = lo_bas.

*             Get candidates contact data and email address.
              ls_candidates-objid = candidate_number.
              ls_candidates-otype = 'NE'.
              ls_candidates-plvar = '01'.

              TRY.
                  CALL METHOD lo_bas->get_contact_data
                    EXPORTING
                      ps_cand_hrobject = ls_candidates
                    IMPORTING
                      pt_telefondata   = lt_telefondata.
                  IF sy-subrc IS INITIAL.
                    READ TABLE lt_telefondata INTO ls_telefondata WITH KEY channel = '03'" mobile number
                    IF sy-subrc IS INITIAL.
                      mobile_number = ls_telefondata-telephone.
                    ENDIF.
                  ENDIF.
                CATCH cx_hrrcf INTO lo_exception.
                  CALL METHOD cl_hrrcf_exception_handler=>write_exception_log
                    EXPORTING
                      ex = lo_exception.
              ENDTRY.

No comments:

Post a Comment