Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Report Z_ASSESSMENT_RECORDS_REPORT
- *&
- *&---------------------------------------------------------------------*
- *&
- *&
- *&---------------------------------------------------------------------*
- REPORT Z_ASSESSMENT_RECORDS_REPORT.
- TABLES zhcm_pernr.
- *INFOTYPES: 9913 , 9914.
- DATA: it_9913 TYPE STANDARD TABLE OF p9913 WITH HEADER LINE .
- DATA: it_9914 TYPE STANDARD TABLE OF p9914 WITH HEADER LINE .
- TYPES :
- BEGIN OF t_master_data,
- pernr TYPE pa0001-pernr,
- name TYPE emnam,
- END OF t_master_data.
- TYPES: BEGIN OF t_english.
- INCLUDE TYPE t_master_data.
- INCLUDE TYPE ps9913.
- TYPES: END OF t_english.
- TYPES: BEGIN OF t_appraisal.
- INCLUDE TYPE t_master_data.
- INCLUDE TYPE ps9914.
- TYPES: END OF t_appraisal.
- DATA it_english TYPE TABLE OF t_english WITH HEADER LINE.
- DATA it_appraisal TYPE TABLE OF t_appraisal WITH HEADER LINE.
- DATA: i_fcat TYPE slis_t_fieldcat_alv,
- wa_fcat TYPE slis_fieldcat_alv.
- * Selection Screen.
- SELECTION-SCREEN BEGIN OF BLOCK pernr WITH FRAME TITLE text-003.
- SELECT-OPTIONS s_pernr FOR zhcm_pernr-zzpernr NO INTERVALS.
- SELECTION-SCREEN END OF BLOCK pernr.
- SELECTION-SCREEN SKIP.
- SELECTION-SCREEN BEGIN OF BLOCK PERIOD WITH FRAME TITLE text-001.
- PARAMETER : P_LATEST RADIOBUTTON GROUP GR1,
- P_ALL RADIOBUTTON GROUP GR1.
- SELECTION-SCREEN END OF BLOCK PERIOD.
- SELECTION-SCREEN BEGIN OF BLOCK REPORT_TYPE WITH FRAME TITLE text-002.
- PARAMETER : P_PROF RADIOBUTTON GROUP GR2,
- P_TALENT RADIOBUTTON GROUP GR2,
- P_TEST RADIOBUTTON GROUP GR2,
- P_APP RADIOBUTTON GROUP GR2.
- SELECTION-SCREEN END OF BLOCK REPORT_TYPE.
- INITIALIZATION.
- *PERFORM f_initialize.
- START-OF-SELECTION.
- * 1)Check Personnal Number .
- DATA r_pernr TYPE TABLE OF selopt WITH HEADER LINE.
- IF s_pernr IS NOT INITIAL.
- MOVE-CORRESPONDING s_pernr[] TO r_pernr[].
- ELSE.
- CLEAR r_pernr[].
- ENDIF.
- IF P_APP = 'X'.
- PERFORM f_get_appraisal_data.
- IF it_appraisal IS NOT INITIAL.
- *Start Forming the ALV
- CLEAR wa_fcat.
- CLEAR i_fcat[].
- wa_fcat-outputlen = 15.
- wa_fcat-col_pos = '1'.
- wa_fcat-fieldname = 'PERNR'.
- wa_fcat-seltext_m = 'Personnel No.'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '2'.
- wa_fcat-fieldname = 'NAME'.
- wa_fcat-seltext_m = 'Name'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '3'.
- wa_fcat-fieldname = 'APPRAISAL_DATE'.
- wa_fcat-seltext_m = 'Appraisal Date'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '4'.
- wa_fcat-fieldname = 'OVERALL_RATING'.
- wa_fcat-seltext_m = 'Overall Rating'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
- EXPORTING
- i_structure_name = 'PS9914'
- it_fieldcat = i_fcat
- i_grid_title = 'Appraisal Report'
- TABLES
- t_outtab = it_appraisal.
- ENDIF.
- ELSEIF P_TEST = 'X'.
- ENDIF.
- FORM f_get_appraisal_data .
- CLEAR it_appraisal[].
- CLEAR it_9914[].
- CALL FUNCTION 'Z_INFOTYPE_9914'
- TABLES
- IM_PERNRS_SELOPT = r_pernr
- EX_TAB_INFTY = it_9914
- .
- IF it_9914[] IS NOT INITIAL.
- PERFORM f_fill_appraisal_data.
- ENDIF.
- ENDFORM.
- FORM f_fill_appraisal_data .
- *Clear Internal Table.
- CLEAR it_appraisal[].
- *Personal Data BAPI
- DATA it_personal_data TYPE TABLE OF bapip0001b.
- **
- MOVE-CORRESPONDING it_9914[] TO it_appraisal[].
- *Start Looping through the personal data
- LOOP AT it_appraisal.
- CLEAR it_personal_data[].
- CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
- EXPORTING
- employee_id = it_appraisal-pernr
- TABLES
- org_assignment = it_personal_data
- * PERSONAL_DATA =
- * INTERNAL_CONTROL =
- * COMMUNICATION =
- * ARCHIVELINK =
- .
- *Add name to the data
- CHECK it_personal_data IS NOT INITIAL.
- it_appraisal-name = it_personal_data[ 1 ]-name.
- MODIFY it_appraisal.
- ENDLOOP .
- ENDFORM.
- * CLEAR it_profile_ext[].
- * CLEAR it_profile_9188[].
- * CALL FUNCTION 'ZHCM_GET_PROFILE_XT_9188'
- * EXPORTING
- * im_latest_only = p_latest
- * TABLES
- * im_pernrs_selopt = r_pernr
- * ex_tab_infty = it_profile_9188.
- * IF it_profile_9188[] IS NOT INITIAL.
- * PERFORM f_fill_prf_ext.
- *
- * ELSE.
- * MESSAGE 'No talent test data found for selected personal no.' TYPE 'I'.
- * ENDIF.
- *ENDFORM.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement