Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Performance Appraisal - Convert legacy data

Hello

The requirement is to convert the legacy Peformance Appraisal data into SAP. The appraisal template has five compentenices and maximum of eight development goals for a given year. Questions:

- What is the best way to approach the conversion?

- Is there any standard conversion template for pulling the data into SAP?

- Which tables/cluster(s) are involved and how can we load the "notes" section under each of the developement goals.

Please advise. Many thanks in advance,

Former Member
Former Member replied

Hi,

First use the FM "HRHAP_TEMPLATE_GET_DETAIL" to get the property of the template. Then pass the export parameters along with the legacy data into the FM "HRHAP_DOCUMENT_CREATE" to create the appraisal document.

A sample code would be like this.

  • Local Constants

CONSTANTS: lc_plversion TYPE plvar VALUE '01',

lc_p TYPE c VALUE 'P',

lc_status TYPE c VALUE '1',

lc_statusname(14) TYPE c VALUE 'In Preparation',

lc_0001 TYPE p0105-usrty VALUE '0001',

lc_x TYPE c VALUE 'X',

lc_01(2) TYPE c VALUE '01',

lc_12(2) TYPE c VALUE '12'.

  • Data types for FM call

DATA : li_appraiser TYPE hap_t_header_appraiser,

li_appraisee TYPE hap_t_header_appraisee,

li_others TYPE hap_t_header_others,

li_texts TYPE hap_s_header_texts,

li_dates TYPE hap_s_header_dates,

li_status TYPE hap_s_header_status,

li_display TYPE hap_s_header_display,

li_columns TYPE hap_t_body_columns,

li_elements TYPE hap_t_body_elements,

li_cells TYPE hap_t_body_cells,

li_processing TYPE hap_s_doc_processing,

li_appraisal_id TYPE hap_s_appraisal_id,

li_pappraisers TYPE hap_t_header_part_appraisers,

li_notes TYPE hap_t_body_cell_notes,

li_status_note TYPE hap_t_status_note.

  • Work Areas for filling the parameters

DATA : lw_appraisee TYPE hap_s_header_appraisee,

lw_appraiser TYPE hap_s_header_appraiser,

lv_appraiser TYPE pernr-pernr,

lv_begda TYPE p0105-begda,

lv_endda TYPE p0105-endda,

lv_syuname TYPE p0105-usrid.

  • Clear all the Local Variables before usgae.

  • Get the template properties from the FM 'HRHAP_TEMPLATE_GET_DETAIL'

CALL FUNCTION 'HRHAP_TEMPLATE_GET_DETAIL'

EXPORTING

plan_version = lc_plversion

template_id = template_id

IMPORTING

s_appraisal_id = li_appraisal_id

s_header_texts = li_texts

s_header_status = li_status

s_header_display = li_display

t_body_columns = li_columns

t_body_elements = li_elements

t_body_cells = li_cells

t_body_cell_notes = li_notes.

  • Check for the Employee id (Appraisee)

IF pernr IS INITIAL.

lv_syuname = sy-uname.

CONCATENATE sy-datum(4) sy-datum4(2) sy-datum6(2) INTO lv_begda.

CONCATENATE sy-datum(4) sy-datum4(2) sy-datum6(2) INTO lv_endda.

  • Call the FM 'RP_GET_PERNR_FROM_USERID'

CALL FUNCTION 'RP_GET_PERNR_FROM_USERID'

EXPORTING

begda = lv_begda

endda = lv_endda

usrid = lv_syuname

usrty = lc_0001

IMPORTING

usr_pernr = pernr

EXCEPTIONS

retcd = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF.

**********************************************************************

  • Populating FM parameters before calling the FM to create *

**********************************************************************

      • Get the supervisor's employee id from the reusable component of ENH-E084.

lv_appraiser = '81'.

  • Populate Appraiser

lw_appraiser-plan_version = lc_plversion.

lw_appraiser-type = lc_p.

lw_appraiser-id = lv_appraiser.

APPEND lw_appraiser TO li_appraiser.

CLEAR lw_appraiser.

  • Populate Appraisee

lw_appraisee-plan_version = lc_plversion.

lw_appraisee-type = lc_p.

lw_appraisee-id = pernr.

APPEND lw_appraisee TO li_appraisee.

CLEAR lw_appraisee.

  • Populate the status

li_status-ap_status = lc_status.

li_status-ap_status_name = lc_statusname.

  • Populate the Dates.

CONCATENATE sy-datum(4) lc_01 lc_01 INTO li_dates-ap_start_date.

CONCATENATE sy-datum(4) lc_12 lc_01 INTO li_dates-ap_end_date.

  • Populate the Processing status

li_processing-administrator = lc_x.

CLEAR: li_appraisal_id,

li_pappraisers,

li_notes,

li_status_note.

  • Call the FM 'HRHAP_DOCUMENT_CREATE' to create the appraisal document.

  • Document is created in status 'In Process'

CALL FUNCTION 'HRHAP_DOCUMENT_CREATE'

EXPORTING

plan_version = lc_plversion

t_header_appraiser = li_appraiser

t_header_appraisee = li_appraisee

t_header_others = li_others

s_header_texts = li_texts

s_header_dates = li_dates

s_header_status = li_status

s_header_display = li_display

t_body_columns = li_columns

t_body_elements = li_elements

t_body_cells = li_cells

s_doc_processing = li_processing

CHANGING

s_appraisal_id = li_appraisal_id

t_header_part_appraisers = li_pappraisers

t_body_cell_notes = li_notes

t_status_notes = li_status_note.

appraisal_id = li_appraisal_id-appraisal_id.

Hope this helps.

Reward if this helps.

Regards,

Subbu.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question