Difference between revisions of "SAP HCM APPRAISALS"
From SapWiki
Line 11: | Line 11: | ||
==Funciones== | ==Funciones== | ||
*BAPI_APPRAISAL_GETDETAIL : Leer datos de Calificación (Objeto BA) | *BAPI_APPRAISAL_GETDETAIL : Leer datos de Calificación (Objeto BA) | ||
+ | ejemplo | ||
+ | <nowiki>method GET_CALIFICACION. | ||
+ | |||
+ | data lt_calif type ZBAPIAPPHEAD_tab. | ||
+ | data ls_calif like line of lt_calif. | ||
+ | |||
+ | data lt_sobid type table of hrp1001-sobid. | ||
+ | data: lt_appraisers type table of bapiappraiser, | ||
+ | lt_appraisees type table of bapiappraisee. | ||
+ | data: lt_appraisal_data type table of bapiappdata. | ||
+ | data: ls_appraisal type bapiapphead. | ||
+ | data l_id type BAPIAPPRAISAL-ID. | ||
+ | |||
+ | * obtiene datos calificación( ver IT0025 en trn. PA30) | ||
+ | select sobid | ||
+ | into table lt_sobid | ||
+ | from hrp1001 | ||
+ | where otype = 'P' | ||
+ | and objid = i_pernr | ||
+ | and plvar = '01' | ||
+ | and rsign = 'A' | ||
+ | and relat = '046' "obtiene | ||
+ | and istat = '1' | ||
+ | and begda <= i_endda | ||
+ | and endda >= i_begda | ||
+ | and varyf like 'BA%' "Calificacion | ||
+ | . | ||
+ | |||
+ | if lt_sobid[] is initial. | ||
+ | return. | ||
+ | endif. | ||
+ | |||
+ | loop at lt_sobid into data(ls_sobid). | ||
+ | clear: ls_appraisal, | ||
+ | lt_appraisers[], | ||
+ | lt_appraisees[], | ||
+ | lt_appraisal_data[]. | ||
+ | |||
+ | l_id = ls_sobid. | ||
+ | |||
+ | call function 'BAPI_APPRAISAL_GETDETAIL' | ||
+ | exporting | ||
+ | plan_version = '01' | ||
+ | appraisal_id = l_id | ||
+ | importing | ||
+ | appraisal = ls_appraisal | ||
+ | * return = e_return | ||
+ | tables | ||
+ | appraisers = lt_appraisers | ||
+ | appraisees = lt_appraisees | ||
+ | appraisal_data = lt_appraisal_data. | ||
+ | |||
+ | if ls_appraisal is INITIAL. | ||
+ | continue. | ||
+ | endif. | ||
+ | |||
+ | MOVE-CORRESPONDING ls_appraisal to ls_calif. | ||
+ | read table lt_appraisal_data into data(ls_appraisal_data) with key element_type = 'BS'. "resultado final - Modelo de calificación | ||
+ | if sy-subrc = 0. | ||
+ | ls_calif-rating = ls_appraisal_data-rating. | ||
+ | append ls_calif to lt_calif. | ||
+ | clear ls_calif. | ||
+ | endif. | ||
+ | endloop. | ||
+ | |||
+ | e_calif[] = lt_calif[]. | ||
+ | |||
+ | endmethod.</nowiki> | ||
*BAPI_APPRAISAL_CREATE : Crear Calificación | *BAPI_APPRAISAL_CREATE : Crear Calificación | ||
*BAPI_APPRAISAL_CHANGE : Modificar Calificación | *BAPI_APPRAISAL_CHANGE : Modificar Calificación |
Revision as of 16:49, 15 January 2021
Contents
Crear Calificación
Trn. PA30 infotipo 0025
Relación entre N° de Personal y Id de Calificación
Vamos a la tabla HRP1001 con Tipo objeto = P (Personal), ID Objeto = Nº personal, Clase de enlace = ‘A’, Enlace = 046’, Tipo del objeto vinculado = ‘BA’. Seleccionamos los registros HRP1001-SOBID (ID Calificación)
Ver datos de Calificación
Trn. PP01 con Tipo Objeto = BA - Calificación
Funciones
- BAPI_APPRAISAL_GETDETAIL : Leer datos de Calificación (Objeto BA)
ejemplo
method GET_CALIFICACION. data lt_calif type ZBAPIAPPHEAD_tab. data ls_calif like line of lt_calif. data lt_sobid type table of hrp1001-sobid. data: lt_appraisers type table of bapiappraiser, lt_appraisees type table of bapiappraisee. data: lt_appraisal_data type table of bapiappdata. data: ls_appraisal type bapiapphead. data l_id type BAPIAPPRAISAL-ID. * obtiene datos calificación( ver IT0025 en trn. PA30) select sobid into table lt_sobid from hrp1001 where otype = 'P' and objid = i_pernr and plvar = '01' and rsign = 'A' and relat = '046' "obtiene and istat = '1' and begda <= i_endda and endda >= i_begda and varyf like 'BA%' "Calificacion . if lt_sobid[] is initial. return. endif. loop at lt_sobid into data(ls_sobid). clear: ls_appraisal, lt_appraisers[], lt_appraisees[], lt_appraisal_data[]. l_id = ls_sobid. call function 'BAPI_APPRAISAL_GETDETAIL' exporting plan_version = '01' appraisal_id = l_id importing appraisal = ls_appraisal * return = e_return tables appraisers = lt_appraisers appraisees = lt_appraisees appraisal_data = lt_appraisal_data. if ls_appraisal is INITIAL. continue. endif. MOVE-CORRESPONDING ls_appraisal to ls_calif. read table lt_appraisal_data into data(ls_appraisal_data) with key element_type = 'BS'. "resultado final - Modelo de calificación if sy-subrc = 0. ls_calif-rating = ls_appraisal_data-rating. append ls_calif to lt_calif. clear ls_calif. endif. endloop. e_calif[] = lt_calif[]. endmethod.
- BAPI_APPRAISAL_CREATE : Crear Calificación
- BAPI_APPRAISAL_CHANGE : Modificar Calificación
- RHPA_APPRAISAL_NOTES_READ : Leer Notas de Calificación
- RHPA_APPRAISAL_NOTES_WRITE : Crear Notas de Calificación
- RHPS_APP_SCHEME_READ : Leer datos de Modelo de calificación (Objeto BS)
- RHPA_APPRAISAL_1045_READ : Leer datos de valoración de Calificación (Infotipo 1045)