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_9912 TYPE STANDARD TABLE OF p9912 WITH HEADER LINE .
- 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_talent.
- INCLUDE TYPE t_master_data.
- INCLUDE TYPE ps9912.
- TYPES: END OF t_talent.
- 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_talent TYPE TABLE OF t_talent WITH HEADER LINE.
- 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'.
- PERFORM f_get_test_data.
- IF it_english 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 = 'ZTEST_DATE'.
- wa_fcat-seltext_m = 'English Test Date'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '4'.
- wa_fcat-fieldname = 'ZPROGRAM'.
- wa_fcat-seltext_m = 'Program'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '5'.
- wa_fcat-fieldname = 'ZTEST'.
- wa_fcat-seltext_m = 'Test'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '6'.
- wa_fcat-fieldname = 'ZRESULT'.
- wa_fcat-seltext_m = 'Result'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '7'.
- wa_fcat-fieldname = 'ZPERCENT'.
- wa_fcat-seltext_m = 'Percent'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- wa_fcat-outputlen = 40.
- wa_fcat-col_pos = '8'.
- wa_fcat-fieldname = 'ZREFERENCE_REPORT_NO'.
- wa_fcat-seltext_m = 'Reference Report No'.
- APPEND wa_fcat TO i_fcat.
- CLEAR wa_fcat.
- CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
- EXPORTING
- i_structure_name = 'PS9913'
- it_fieldcat = i_fcat
- i_grid_title = 'English Test'
- TABLES
- t_outtab = it_english.
- ENDIF.
- 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_get_test_data .
- CLEAR it_english[].
- CLEAR it_9913[].
- CALL FUNCTION 'Z_INFOTYPE_9913'
- TABLES
- IM_PERNRS_SELOPT = r_pernr
- EX_TAB_INFTY = it_9913
- .
- IF it_9913[] IS NOT INITIAL.
- PERFORM f_fill_test_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.
- *f_fill_test_data
- FORM f_fill_test_data .
- *Clear Internal Table.
- CLEAR it_english[].
- *Personal Data BAPI
- DATA it_personal_data TYPE TABLE OF bapip0001b.
- **
- MOVE-CORRESPONDING it_9913[] TO it_english[].
- *Start Looping through the personal data
- LOOP AT it_english.
- CLEAR it_personal_data[].
- CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
- EXPORTING
- employee_id = it_english-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_english-name = it_personal_data[ 1 ]-name.
- MODIFY it_english.
- ENDLOOP .
- ENDFORM.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement