How To Create An Upload For HR Infotype 0025 (Appraisals) in ABAP - SAP Blogs
How To Create An Upload For HR Infotype 0025 (Appraisals) in ABAP - SAP Blogs
Community
Fahad Javed
September 29, 2012 More than a 1 hour read
Apart from these BAPI’s,a couple of functions would be utilized for uploading the Tab delimited text le,using the File API in abap:
> WS_FILENAME_GET
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 1/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
> WS_UPLOAD
When you are creating an appraisal,you need to select an appraisal model,which has already been created by the HR consultants,using the
transaction ‘OOAM‘[Appraisal Model Catalogue]. Appraisal Models are Models on which you base an appraisal[Each Appraisal Model is represented
by a xed id called Appraisal Model ID] and it consists of ‘Criteria Group‘[For Group Category rating e.g: summing all sub-criterians] and
‘Criterion‘(also known as objectives are sub ratings for the given criteria group).
Appraisal Model Anatomy
Note:
When ever a new appraisal entry is created in infotype 25[Appraisals],each appraisal for an employee is represented by a Unique 8 character
ID,automatically generated at runtime[This ID is of Object type = ‘BA(Appraisal)‘]. This id is generated each time,where as the ID’s generated while
creating the appraisal model are xed for their lifetime[These ID’s include Appraisal Model ID’s(of Object type = ‘BS(Appraisal Model)‘),Criteria
Group(of Object type = ‘BG(Criteria Group)‘) and Criterion or Objectives(of Object type = ‘BK(Criterion)‘)].
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 2/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 3/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Step 02 – Extract Appraisal Model based on the Appraisal ID generated in the rst step.
Step 03 – Utilizing Apppraisal Structure in creating the entries for ratings,on top of the initial entry created in Step 01.
Step 04 – Finally changing the status of the appraisal,in this case ‘COMPLETED‘
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 4/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
The Steps:
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 5/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
> ID = Employee Number of Employee who is performing the appraisal for the given appraisee(Supervisor)
These entries are appended to respective internal tables and passsed in the BAPI named ‘BAPI_APPRAISAL_CREATE‘.
Note:
Both Appraisee and Appraiser Numbers are to be prvoided in the Flat Upload Text le.
EXPORTING
plan_version = ’01’ “Current Plan can also be used,or plan version could be provided in the le
appraisal_model_id = ‘50000770’”For Forced Ranking Method-ABAP”To be passed in case,multiple appraisal models are to be created
TEXT = ‘Forced Ranking Method-ABAP’ “If we dont pass the text, an entry will not be created
* ANONYMOUS = ‘ ‘
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 6/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
* NOCOMMIT =
IMPORTING
APPRAISAL_ID = APPRAISAL_ID“Appraisal ID generated at the time of creation at runtime[Dynamically created at ID]
* RETURN =
TABLES
APPRAISERS = it_APPRAISERS“One entry for each Appraisal.For Multiple entries can also be passed for more than one supervisor
.
Note:
> For in depth look at the entire code see the section titled ‘Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case
‘For Forced Ranking Method-ABAP’]’.
‘BAPI_APPRAISAL_GETDETAIL‘
to extract the entire contents of the appraisal model in context,including its ratings and the appraisal model structure in its entirety. Since the Bapi in
step 01 has only created a Basic Appraisal Entry based on the following parameters:
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 7/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
This BAPI(BAPI_APPRAISAL_GETDETAIL) is normally used for reporting purposes,but it is used here to also extract the strutcure for that particular
employee. This structure is extracted in the Appraisal Data Internal table(it_appraisal_data),which would be used later on in step 03.
“Extract details of the created appraisal,based on the auto generated Appraisal ID
EXPORTING
* IMPORTING
* APPRAISAL =
* RETURN =
TABLES
APPRAISAL_DATA = it_appraisal_data “Internal Table that will be used as a structure for passing in Rating values from the at upload text le
Note:
> For in depth look at the entire code see the section titled ‘Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case
‘For Forced Ranking Method-ABAP’]’.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 8/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
‘BAPI_APPRAISAL_CHANGE‘
to supply the ratings,missing in step 01. But before using this bapi,the appraisal table extracted in step 02,must rst be repopulated with ratings and
then nally modifying its content and passing the appraisal internal table to this BAPI.
“Each Rating has an Object ID which can easily be viewed in IT0025[Appraisal] by going to the menu path:
wa_appraisal_data-not_rated = ”.
wa_appraisal_data-not_rated = ”.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 9/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Note:
If wa_appraisal_data-not_rated is not set to ”,that particular rating would not be counted,even if the rating is provided in the at le.
wa_appraisal_data-not_rated = ”.
wa_appraisal_data-rating =
( wa_0025-rating1_1 +
wa_0025-rating1_2 +
wa_0025-rating1_3 +
wa_0025-rating1_4 +
wa_0025-rating1_5 +
wa_0025-rating1_6 +
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 10/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
wa_0025-rating1_7 +
wa_0025-rating1_8 +
wa_0025-rating1_9 +
wa_appraisal_data-not_rated = ”.
wa_appraisal_data-rating =
( wa_0025-rating2_1 +
wa_0025-rating2_2 +
wa_0025-rating2_3 +
wa_0025-rating2_4 +
wa_0025-rating2_5 +
wa_0025-rating2_6 +
wa_0025-rating2_7 +
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 11/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
wa_0025-rating2_8 +
wa_0025-rating2_9 +
elseif ( wa_appraisal_data-element_id = ‘50000770’).”[Force ranking Method – ABAP] [Total= 50000772 rating + 50000771 rating ]
wa_appraisal_data-not_rated = ”.
endif.
at last.
READ TABLE it_appraisal_data INTO wa_appraisal_data WITH KEY element_id = ‘50000770’.
IF sy-subrc = 0.
*** wa_appraisal_data-not_rated = ”.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 12/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
ENDIF.
endat.
ENDLOOP.
EXPORTING
CREATION_DATE = sy-datum
* ANONYMOUS = ‘ ‘
*** IMPORTING
*** RETURN =
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 13/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
TABLES
APPRAISERS = it_appraisers
APPRAISEES = it_appraisees
APPRAISAL_DATA = it_appraisal_data “Re-passed,with ratings by looping through its contents,assigning ratings and modifying this from step 02
.
The ratings calculated above are based on the operations provided by the criteria groups. Some Possible operations are Total, Average,
Percentage,Without e.t.c.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 14/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 15/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Note:
> For in depth look at the entire code see the section titled ‘Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case
‘For Forced Ranking Method-ABAP’]’.
‘BAPI_APPRAISAL_STATUS_CHANGE’
EXPORTING
***01 In Preparation
***02 In Process
***03 Completed
***04 Approved
***05 Rejected
NOCOMMIT = ”
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 16/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
IMPORTING
* STATUS_TEXT =
RETURN = return_status
.
Note:
> For in depth look at the entire code see the section titled ‘Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case
‘For Forced Ranking Method-ABAP’]’.
you can get a dynamic view of the appraisal model used for the particular employee’s,even if the same appraisal model is assigned to them but with
di erent Objectives for each employee.
> In this Program,one employee is appraised by one supervisor only,in order for multiple supervisor’s to appraise a single appraisee ,each line should
be added in the upload le for each of the supervisor’s and they should be appended in the appraiser’s internal table ‘it_appraisers‘.
Updates[version 2]:
> After transporting this upload program to QA,it has been observed that the appraisal model needs to be created from scratch on each client i.e.
Dev,QAS,PRD e.t.c. Since appraisal model creation is a user end activity,and besides there is no transport mechanism through which we can
transport the appraisal model to another client as it is. Secondly,replication of an appraisal model in another client generates unique Object ID’s for
each model,criteriagroup and criterias(or objectives). Keeping this in mind the upload now takes the object id for each rating as well,so that it can be
uploaded on any client. Also see the heading ‘Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case ‘For Forced
Ranking Method-ABAP’] – Version 02′ for changes in source code.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 17/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
> I had already created a BADI called ‘HRPDV00APPRAISAL0003’ for standard Infotype 25(Appraisals). The Badi and any error checks won’t work in
this upload program, as this upload program is Back-end one and not a front end Upload program for example as created via BDC Recording. You will
need to re-implement any checks within this upload,lets say create a Log le of any error or omissions for Appraisal while creating an entry in
infotype 25(Appraisals).
Extras:
When ever you try to delete an entry in appraisal infotype with status ‘Completed’,and when you save it,it will not delete that entry and show up a
pop-up menu with the message ‘Appraisal “[Appraisal Model Name]” cannot be edited anymore’ as shown in the screen shot given below:
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 18/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
As you can see,we are unable to delete an appraisal entry. So,to be able to delete an appraisal entry with the Completed status,we will need to open
up the appraisal model creation transaction called ‘S_AHR_61003969’(Edit Appraisals Catalog). Now double click on the appraisal model for which
you want to allow the deletion of an entry. In the change appraisal Pop-up,choose the ‘Processing’ tab and select ‘Reset and delete‘,to allow deletion
of an appraisal entry for the given appraisal model with the status ‘COMPLETED‘,as shown below:
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 19/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Changing the Appraisal Model Settings,to allow deletion of an Appraisal entry with ‘completed’ status
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 20/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
After setting this, when you go back to infotype 25 and delete that entry and save it,it will allow the deletion as show below:
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 21/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case
‘For Forced Ranking Method-ABAP’]
*&———————————————————————*
*& Report ZFJ_HR_PD_IT0025_UPLOAD
*&
*&———————————————————————*
*& Developer = Fahad Javed
*& Module = Human Resource(HR)
*& Sub-Module = Personnel Development(PD)
*& Development Type = Upload[based on BAPI’s not BDC recording]
*& Upload For = Infotype 0025[Appraisals]
*& Description = HR upload for uploading data for Force
*& Ranking curve method – ABAP
*& Completed on = 20th September 2012
*& Transaction Code = “ZIT25_UPL”
*&———————————————————————*
REPORT ZFJ_HR_PD_IT0025_UPLOAD.
“For creation of Appraisals based on the provided appraisal Model
“BAPI used = BAPI_APPRAISAL_CREATE
“Note:
“—–
“This BAPI will create an initial entry with basics such as:
“> Appraisee
“> Appraiser(s)
“> Appraisal Model ID
“> Entry created with the Appraisal Status of = ‘In Process’
TYPES :
begin of st_0025,
“Appraisal Creation – [START]
*** PLAN_VERSION type c length 2,”Hard coded to ’01’ as it is used by NBP
*** app_model_id type n length 8,”Hardcoded to 50000770 as only created for appraisal model
*** app_model_id type BAPIAPPMODEL-ID,
*** app_model_id type c length 8,
*** app_model_text type c LENGTH 40,
*** start_date type BAPIPERIODAPP-start_date,
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 22/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 23/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 24/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc NE 0.
** lename = sy-subrc.
ENDIF.
START-OF-SELECTION.
CALL FUNCTION ‘WS_UPLOAD’
EXPORTING
* CODEPAGE = ‘IBM’
lename = lename
letype = ‘DAT’
* HEADLEN = ‘ ‘
* LINE_EXIT = ‘ ‘
* TRUNCLEN = ‘ ‘
* USER_FORM = ‘ ‘
* USER_PROG = ‘ ‘
* DAT_D_FORMAT = ‘ ‘
* IMPORTING
* FILELENGTH =
TABLES
data_tab = it_0025
EXCEPTIONS
conversion_error = 1
le_open_error = 2
le_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_ letransfer = 8
customer_error = 9
no_authority = 10
OTHERS = 11
.
IF sy-subrc <> 0.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 25/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 26/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 27/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 28/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 29/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
wa_appraisal_data-not_rated = ”.
elseif wa_appraisal_data-element_id = ‘50000786’.”2.9 Development of subordinates
wa_appraisal_data-rating = wa_0025-rating2_9.
wa_appraisal_data-not_rated = ”.
elseif wa_appraisal_data-element_id = ‘50000787’.”2.10 Personal appearance and grooming
wa_appraisal_data-rating = wa_0025-rating2_10.
wa_appraisal_data-not_rated = ”.
“3. Ranking by Supervisor
elseif wa_appraisal_data-element_id = ‘50002522’.”2.10 Personal appearance and grooming
wa_appraisal_data-rating = wa_0025-rating3.
wa_appraisal_data-not_rated = ”.
“Automatically calculated ratings
elseif wa_appraisal_data-element_id = ‘50000771’.”[1. Performance against Job Objectives]
*** wa_appraisal_data-rating = ‘1.000’.
wa_appraisal_data-not_rated = ”.
wa_appraisal_data-rating =
( wa_0025-rating1_1 +
wa_0025-rating1_2 +
wa_0025-rating1_3 +
wa_0025-rating1_4 +
wa_0025-rating1_5 +
wa_0025-rating1_6 +
wa_0025-rating1_7 +
wa_0025-rating1_8 +
wa_0025-rating1_9 +
wa_0025-rating1_10 ) / 10.
rating1_average = wa_appraisal_data-rating.
elseif wa_appraisal_data-element_id = ‘50000772’.”[2. behavioural Skills]
*** wa_appraisal_data-rating = ‘1.000’.
wa_appraisal_data-not_rated = ”.
wa_appraisal_data-rating =
( wa_0025-rating2_1 +
wa_0025-rating2_2 +
wa_0025-rating2_3 +
wa_0025-rating2_4 +
wa_0025-rating2_5 +
wa_0025-rating2_6 +
wa_0025-rating2_7 +
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 30/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
wa_0025-rating2_8 +
wa_0025-rating2_9 +
wa_0025-rating2_10 ) / 10.
rating2_average = wa_appraisal_data-rating.
elseif ( wa_appraisal_data-element_id = ‘50000770’).”[Force ranking Method – ABAP]
wa_appraisal_data-not_rated = ”.
wa_appraisal_data-rating = rating3.
“Note:
“—–
“Not_rated must be set to ”,otherwise it won’t cound the rating values provided
endif.
rating3 = ( rating1_average + rating2_average ).
modify it_appraisal_data from wa_appraisal_data.
at last.
READ TABLE it_appraisal_data INTO wa_appraisal_data WITH KEY element_id = ‘50000770’.
IF sy-subrc = 0.
*** wa_appraisal_data-element_id = ‘50000770’.”[Force ranking Method – ABAP]
*** wa_appraisal_data-not_rated = ”.
wa_appraisal_data-rating = rating3.
modify it_appraisal_data from wa_appraisal_data index 1.
ENDIF.
endat.
ENDLOOP.
“Modify the appraisal data Internal Table with the Ratings – [END]
CALL FUNCTION ‘BAPI_APPRAISAL_CHANGE’
EXPORTING
plan_version = ’01’
*** plan_version = wa_0025-PLAN_VERSION
*** plan_version = wa_0025-PLAN_VERSION
appraisal_id = appraisal_id
*** appraisal_id = ‘50002856’
TEXT = ‘Forced Ranking Method-ABAP’
*** TEXT = wa_0025-app_model_text
*** TEXT = ‘changed’
CREATION_DATE = sy-datum
* ANONYMOUS = ‘ ‘
NOCOMMIT = ””Should be set to ”,for changing the entry
*** IMPORTING
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 31/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
*** RETURN =
TABLES
APPRAISERS = it_appraisers
APPRAISEES = it_appraisees
APPRAISAL_DATA = it_appraisal_data
.
“______Change or Update Appraisal – [END]
“______Set Appraisal Status – [START]
break abapdev.
CALL FUNCTION ‘BAPI_APPRAISAL_STATUS_CHANGE’
EXPORTING
plan_version = ’01’
*** plan_version = wa_0025-PLAN_VERSION
appraisal_id = appraisal_id
status = ’03′”Complete Status
*** status = wa_0025-app_status
***01 In Preparation
***02 In Process
***03 Completed
***04 Approved
***05 Rejected
NOCOMMIT = ”
IMPORTING
* STATUS_TEXT =
RETURN = return_status
.
“______Set Appraisal Status – [END]
*** MESSAGE ‘Appraisal Created Successfully’ type ‘I’.
ENDIF.
“______Appraisal Creation – [END]
refresh : it_appraisers,it_appraisees.
clear : wa_appraisees,wa_appraisers.
clear : t_start_date,t_end_date,rating1_average,rating2_average,rating3.
ENDLOOP.
***write : appraisal_id.
****break abapdev.
“______Change or Update Appraisal – [END]
INITIALIZATION.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 32/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Source Code for Utilizing the Upload program for a Single Appraisal Model[In this Case
‘For Forced Ranking Method-ABAP’] – Version 02
*&———————————————————————*
*& Report ZFJ_HR_PD_IT0025_UPLOAD
*&
*&———————————————————————*
*& Developer = Fahad Javed
*& Module = Human Resource(HR)
*& Sub-Module = Personnel Development(PD)
*& Development Type = Upload[based on BAPI’s not BDC recording]
*& Upload For = Infotype 0025[Appraisals]
*& Description = HR upload for uploading data for Force
*& Ranking curve method – ABAP
*& Completed on = 20th September 2012
*& version 2 = Updated on 30th November 2012
*& version 8 = Updated on 4th December 2012
*& Transaction Code = “ZIT25_UPL”
*&———————————————————————*
REPORT ZFJ_HR_PD_IT0025_UPLOAD.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 33/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
TYPES :
begin of st_0025,
“Appraisal Creation – [START]
*** PLAN_VERSION type c length 2,”Hard coded to ’01’ as it is used by NBP
*** app_model_id type BAPIAPPMODEL-ID,
*** app_model_id type c length 8,
*** app_model_text type c LENGTH 40,
*** start_date type BAPIPERIODAPP-start_date,
start_date type c length 10,
*** end_date type BAPIPERIODAPP-end_date,
end_date type c length 10,
app_model_id type n length 8,“Hardcoded to 50000770 as only created for appraisal model”Added on 30th November 2012
app_model_text type BAPIAPPRAISAL-text,“Appraisal Model text
appraisee_id type c length 45,
appraiser_id type c length 45,
rating1_1_id type n length 8,“1.1 Objective # 1 ID”Added on 30th November 2012
rating1_1 type n length 19,“1.1 Objective # 1
rating1_2_id type n length 8,“1.2 Objective # 2 ID”Added on 30th November 2012
rating1_2 type n length 19,“1.2 Objective # 2
rating1_3_id type n length 8,“1.3 Objective # 3 ID”Added on 30th November 2012
rating1_3 type n length 19,“1.3 Objective # 3
rating1_4_id type n length 8,“1.4 Objective # 4 ID”Added on 30th November 2012
rating1_4 type n length 19,“1.4 Objective # 4
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 34/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
rating1_5_id type n length 8,“1.5 Objective # 5 ID”Added on 30th November 2012
rating1_5 type n length 19,“1.5 Objective # 5
rating1_6_id type n length 8,“1.6 Objective # 6 ID”Added on 30th November 2012
rating1_6 type n length 19,“1.6 Objective # 6
*** rating1_7_id type n length 8,”1.7 Objective # 7 ID”Added on 30th November 2012
*** rating1_7 type n length 19,”1.7 Objective # 7
***
*** rating1_8_id type n length 8,”1.8 Objective # 8 ID”Added on 30th November 2012
*** rating1_8 type n length 19,”1.8 Objective # 8
***
*** rating1_9_id type n length 8,”1.9 Objective # 9 ID”Added on 30th November 2012
*** rating1_9 type n length 19,”1.9 Objective # 9
***
*** rating1_10_id type n length 8,”1.10 Objective # 10 ID”Added on 30th November 2012
*** rating1_10 type n length 19,”1.10 Objective # 10
rating2_1_id type n LENGTH 8,“2.1 Job Knowledge ID”Added on 30th November 2012
rating2_1 type n LENGTH 19,“2.1 Job Knowledge
rating2_2_id type n LENGTH 8,“2.2 Communication Skills ID”Added on 30th November 2012
rating2_2 type n LENGTH 19,“2.2 Communication Skills
rating2_3_id type n LENGTH 8,“2.3 Attitude, Behavior & Response to Control ID”Added on 30th November 2012
rating2_3 type n LENGTH 19,“2.3 Attitude, Behavior & Response to Control
rating2_4_id type n LENGTH 8,“2.4 Initiative ID”Added on 30th November 2012
rating2_4 type n LENGTH 19,“2.4 Initiative
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 35/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
*** rating2_5_id type n LENGTH 8,”2.5 Attendance & Punctuality ID”Added on 30th November 2012
*** rating2_5 type n LENGTH 19,”2.5 Attendance & Punctuality
***
*** rating2_6_id type n LENGTH 8,”2.6 Commitment to Job & Organization ID”Added on 30th November 2012
*** rating2_6 type n LENGTH 19,”2.6 Commitment to Job & Organization
***
*** rating2_7_id type n LENGTH 8,”2.7 Team work ID”Added on 30th November 2012
*** rating2_7 type n LENGTH 19,”2.7 Team work
***
*** rating2_8_id type n LENGTH 8,”2.8 Analytical ability ID”Added on 30th November 2012
*** rating2_8 type n LENGTH 19,”2.8 Analytical ability
***
*** rating2_9_id type n LENGTH 8,”2.9 Development of subordinates ID”Added on 30th November 2012
*** rating2_9 type n LENGTH 19,”2.9 Development of subordinates
***
*** rating2_10_id type n LENGTH 8,”2.10 Personal appearance and grooming ID”Added on 30th November 2012
*** rating2_10 type n LENGTH 19,”2.10 Personal appearance and grooming
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 36/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
DATA:
APPRAISAL_ID type BAPIAPPRAISAL-ID,“For Extraction of appraisal ID generated at runtime
“FOR further processing
DATA:
it_appraisers type STANDARD TABLE OF BAPIAPPRAISER,“Pass in the Appraisers Data[Employee who has been appraised]
wa_appraisers like line OF it_appraisers,“
it_APPRAISEES type standard table of BAPIAPPRAISEE, “Pass in the Appraisees Data[Supervisor who has carried out the appraisal]
wa_APPRAISEES like line of it_appraisees, “
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 37/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
it_appraisal_data type standard table of BAPIAPPDATA,“Holds the Appraisals Data,containing the rating
wa_appraisal_data like line of it_appraisal_data“
.
START-OF-SELECTION.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 38/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
END-OF-SELECTION.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 39/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
“For Conversion of date from character type to date type to avoid exception in the BAPI
t_start_date = wa_0025-start_date.
t_end_date = wa_0025-end_date.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 40/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
*** appraisal_model_id = ‘50000770’”For Forced Ranking Method-ABAP”Disabled on 30th November 2012,as id’s will be required for each
client
*** appraisal_model_id = wa_0025-app_model_id”For Forced Ranking Method-ABAP
*** appraisal_model_id = ‘50000770’”For Forced Ranking Method-ABAP
start_date = t_start_date“to be provided in the le
*** start_date = ‘20120912’”to be provided in the le
end_date = t_end_date“to be provided in the le
*** end_date = ‘20120912’”to be provided in the le
TEXT = wa_0025-app_model_text“If we dont pass the text,
*** TEXT = ‘Forced Ranking Method-ABAP'”If we dont pass the text,
*** TEXT = wa_0025-app_model_text”If we dont pass the text,
*** TEXT = ‘Forced Ranking Method-ABAP'”If we dont pass the text,
“an entry will not be created
CREATION_DATE = SY-DATUM
* ANONYMOUS = ‘ ‘
* NOCOMMIT =
IMPORTING
APPRAISAL_ID = APPRAISAL_ID“Appraisal ID generated at the time of creation at runtime[Dynamically created at ID]
* RETURN =
TABLES
APPRAISERS = it_APPRAISERS“One entry for each Appraisal.For Multiple entries con rm
APPRAISEES = it_APPRAISEES“For Employee who is to be appraised
.
IF sy-subrc = 0.
“Extract details of the created appraisal,based on the auto generated Appraisal ID
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 41/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
* RETURN =
TABLES
APPRAISERS = it_appraisers
APPRAISEES = it_appraisees
APPRAISAL_DATA = it_appraisal_data
.
***COUNTER”Counter
***ELEMENT_TYPE “Object Type – Appraisal Element
***ELEMENT_ID “Object ID – Appraisal Element
***ELEMENT_TEXT “Numbering + Text – Appraisal Element
***WEIGHTING “Weighting
***RATING “Rating of an Appraisal Element
***RATING_TEXT “Rating text of an appraisal element
***NOT_RATED “Flag: Without Rating
***INPUT_TYPE “Flag: Type of input option for appraisal result
***PARENT “Reference to Counter of Parent
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 42/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
“Modify the appraisal data Internal Table with the Ratings – [START]
BREAK abapdev.
LOOP AT it_appraisal_data into wa_appraisal_data.
endif.
“As added on 4th December 2012 – [END]
“Iterative Code
IF wa_appraisal_data-ELEMENT_TYPE = ‘BK’.“For Finding the Criteria Groups[Object type = ‘BG’] for the given control group
no_of_objectives = no_of_objectives + 1.
clear ag_criteria_group.
*** average_CG_ratings type n length 40″Creates the average of ratings divided by the no of objectives
ENDIF.
“Iterative Code
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 43/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 44/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 45/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 46/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 47/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
rating]]
*** elseif wa_appraisal_data-element_id = ‘50002522’.”3.00 Personal appearance and grooming
wa_appraisal_data-rating = wa_0025-rating3.
wa_appraisal_data-not_rated = ”.
“Note:
“—–
“Not_rated must be set to ”,otherwise it won’t count the rating values provided
endif.
at last.
“1. Objectives/KPIs rating(average of all objectives) – [START]
READ TABLE it_appraisal_data INTO wa_appraisal_data WITH KEY element_id = wa_0025-rating1_0_id.
*** READ TABLE it_appraisal_data INTO wa_appraisal_data WITH KEY element_id = ‘50000770’.
IF sy-subrc = 0.
temp_index_cg1 = wa_appraisal_data-counter.
wa_appraisal_data-not_rated = ”.
rating1_average =
( wa_0025-rating1_1 +
wa_0025-rating1_2 +
wa_0025-rating1_3 +
wa_0025-rating1_4 +
wa_0025-rating1_5 +
wa_0025-rating1_6
*** wa_0025-rating1_7 +
*** wa_0025-rating1_8 +
*** wa_0025-rating1_9 +
*** wa_0025-rating1_10
) / no_of_objectives_cg1.“Added on 4th December 2012
*** ) / 6.
*** rating1_average = wa_appraisal_data-rating.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 48/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 49/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 50/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
APPRAISERS = it_appraisers
APPRAISEES = it_appraisees
APPRAISAL_DATA = it_appraisal_data
.
NOCOMMIT = ”
IMPORTING
* STATUS_TEXT =
RETURN = return_status
.
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 51/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
refresh :it_appraisal_data.
clear : wa_appraisal_data,return_status,appraisal_id,wa_0025.
“Added on 4th December 2012
ENDLOOP.
***write : appraisal_id.
****break abapdev.
“______Change or Update Appraisal – [END]
INITIALIZATION.
title = ‘Upload File Selection’.
Alert Moderator
Assigned tags
View more...
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 52/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Related Questions
6 Comments
Former Member
Fahad,
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 53/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Thank you very much for this kind of sharing. It is very helpful for me.
Regards,
Like (0)
Hi Gabriela,
Thanks a lot for the appreciation, It motivates me to write more useful articles in the future.
Regards,
Fahad
Like (0)
Former Member
Hi
Regards
sujatha sahu
Like (0)
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 54/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Celso Huamani
you can delete an object BA Appraisal in Complete status (without changing the whole Appraisal Model)
Greetings
Celso
Like (0)
Former Member
Hi,
Like (0)
Former Member
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 55/56
10/2/2020 How to create an Upload For HR Infotype 0025[Appraisals] in ABAP | SAP Blogs
Pls. also check the following link and rate if you nd it correct. This worked out for me
Like (0)
Find us on
Newsletter Support
https://blogs.sap.com/2012/09/29/how-to-create-an-upload-for-hr-infotype-0025appraisals-in-abap/ 56/56