Advertisement
Guest User

temp

a guest
Feb 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 24.31 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *& Report  Z_ASSESSMENT_RECORDS_REPORT
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *&
  6. *&
  7. *&---------------------------------------------------------------------*
  8.  
  9. REPORT Z_ASSESSMENT_RECORDS_REPORT.
  10. TABLES zhcm_pernr.
  11. *INFOTYPES:  9913 , 9914 , 9912.
  12. DATA: it_9911 TYPE STANDARD TABLE OF p9911 WITH HEADER LINE .
  13. DATA: it_9912 TYPE STANDARD TABLE OF p9912 WITH HEADER LINE .
  14. DATA: it_9913 TYPE STANDARD TABLE OF p9913 WITH HEADER LINE .
  15. DATA: it_9914 TYPE STANDARD TABLE OF p9914 WITH HEADER LINE .
  16.  
  17. TYPES :
  18. BEGIN OF t_master_data,
  19.   pernr TYPE pa0001-pernr,
  20.   name TYPE emnam,
  21.   END OF t_master_data.
  22.  
  23.   TYPES:
  24.   BEGIN OF t_master_data_1 ,
  25.           pernr TYPE pa0001-pernr,
  26.           NAME type EMNAM,
  27.           SG type char10,
  28.           COMP_CODE type pa0001-bukrs ,
  29.           POSITION type plans,
  30.           MAN_LVL type char5,
  31.           COSTCENTER type KOSTL,
  32.           PERS_AREA type persa,
  33.           P_SUBAREA type BTRTL,
  34.           ORG_UNIT type ORGEH ,
  35.           BUS_AREA type gsber ,
  36.           sen_date type dats ,
  37.           lst_prm type date,
  38.   END OF t_master_data_1.
  39.  
  40. TYPES: BEGIN OF t_profile.
  41.         INCLUDE TYPE  t_master_data_1.
  42.         INCLUDE TYPE  ps9911.
  43. TYPES: END OF t_profile.
  44.  
  45. TYPES: BEGIN OF t_talent.
  46.         INCLUDE TYPE  t_master_data.
  47.         INCLUDE TYPE  ps9912.
  48. TYPES: END OF t_talent.
  49.  
  50. TYPES: BEGIN OF t_english.
  51.         INCLUDE TYPE  t_master_data.
  52.         INCLUDE TYPE  ps9913.
  53. TYPES: END OF t_english.
  54.  
  55.  
  56. TYPES: BEGIN OF t_appraisal.
  57.         INCLUDE TYPE  t_master_data.
  58.         INCLUDE TYPE  ps9914.
  59. TYPES: END OF t_appraisal.
  60.  
  61. DATA it_profile   TYPE  TABLE OF t_profile   WITH HEADER LINE.
  62. DATA it_talent    TYPE  TABLE OF t_talent    WITH HEADER LINE.
  63. DATA it_english   TYPE  TABLE OF t_english   WITH HEADER LINE.
  64. DATA it_appraisal TYPE  TABLE OF t_appraisal WITH HEADER LINE.
  65.  
  66. DATA: i_fcat TYPE slis_t_fieldcat_alv,
  67.       wa_fcat TYPE slis_fieldcat_alv.
  68.  
  69.  
  70. * Selection Screen.
  71.  
  72. SELECTION-SCREEN BEGIN OF BLOCK pernr WITH FRAME TITLE text-003.
  73. SELECT-OPTIONS s_pernr FOR zhcm_pernr-zzpernr NO INTERVALS.
  74. SELECTION-SCREEN END OF BLOCK pernr.
  75.  
  76. SELECTION-SCREEN SKIP.
  77. SELECTION-SCREEN BEGIN OF BLOCK PERIOD WITH FRAME TITLE text-001.
  78. PARAMETER : P_LATEST RADIOBUTTON GROUP GR1,
  79.  
  80. P_ALL RADIOBUTTON GROUP GR1.
  81. SELECTION-SCREEN END OF BLOCK PERIOD.
  82.  
  83. SELECTION-SCREEN BEGIN OF BLOCK REPORT_TYPE WITH FRAME TITLE text-002.
  84. PARAMETER : P_PROF RADIOBUTTON GROUP GR2,
  85. P_TALENT RADIOBUTTON GROUP GR2,
  86. P_TEST RADIOBUTTON GROUP GR2,
  87. P_APP RADIOBUTTON GROUP GR2.
  88. SELECTION-SCREEN END OF BLOCK REPORT_TYPE.
  89.  
  90. INITIALIZATION.
  91.  
  92. *PERFORM f_initialize.
  93.  
  94. START-OF-SELECTION.
  95.  
  96. * 1)Check Personnal Number .
  97.  
  98.   DATA r_pernr TYPE TABLE OF selopt WITH HEADER LINE.
  99.  
  100.   IF s_pernr IS NOT INITIAL.
  101.     MOVE-CORRESPONDING s_pernr[] TO r_pernr[].
  102.   ELSE.
  103.     CLEAR r_pernr[].
  104.   ENDIF.
  105.  
  106. IF P_APP = 'X'.
  107.   PERFORM f_get_appraisal_data.
  108.   IF it_appraisal IS NOT INITIAL.
  109.  
  110. *Start Forming the ALV
  111.   CLEAR wa_fcat.
  112.   CLEAR i_fcat[].
  113.   wa_fcat-outputlen = 15.
  114.   wa_fcat-col_pos = '1'.
  115.   wa_fcat-fieldname = 'PERNR'.
  116.   wa_fcat-seltext_m = 'Personnel No.'.
  117.   APPEND wa_fcat TO i_fcat.
  118.   CLEAR wa_fcat.
  119.   wa_fcat-outputlen = 40.
  120.   wa_fcat-col_pos = '2'.
  121.   wa_fcat-fieldname = 'NAME'.
  122.   wa_fcat-seltext_m = 'Name'.
  123.   APPEND wa_fcat TO i_fcat.
  124.   CLEAR wa_fcat.
  125.     wa_fcat-outputlen = 40.
  126.   wa_fcat-col_pos = '3'.
  127.   wa_fcat-fieldname = 'APPRAISAL_DATE'.
  128.   wa_fcat-seltext_m = 'Appraisal Date'.
  129.   APPEND wa_fcat TO i_fcat.
  130.   CLEAR wa_fcat.
  131.       wa_fcat-outputlen = 40.
  132.   wa_fcat-col_pos = '4'.
  133.   wa_fcat-fieldname = 'OVERALL_RATING'.
  134.   wa_fcat-seltext_m = 'Overall Rating'.
  135.   APPEND wa_fcat TO i_fcat.
  136.   CLEAR wa_fcat.
  137.  
  138. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  139.     EXPORTING
  140.       i_structure_name = 'PS9914'
  141.       it_fieldcat      = i_fcat
  142.       i_grid_title     = 'Appraisal Report'
  143.     TABLES
  144.       t_outtab         = it_appraisal.
  145.   ELSE.
  146.   MESSAGE ID 'ZINFOTYPE_ERRORS' TYPE 'I' NUMBER '003'.
  147.   ENDIF.
  148.  
  149. ELSEIF P_TEST = 'X'.
  150.     PERFORM f_get_test_data.
  151.   IF it_english IS NOT INITIAL.
  152.  
  153.  
  154. *Start Forming the ALV
  155.   CLEAR wa_fcat.
  156.   CLEAR i_fcat[].
  157.   wa_fcat-outputlen = 15.
  158.   wa_fcat-col_pos = '1'.
  159.   wa_fcat-fieldname = 'PERNR'.
  160.   wa_fcat-seltext_m = 'Personnel No.'.
  161.   APPEND wa_fcat TO i_fcat.
  162.   CLEAR wa_fcat.
  163.   wa_fcat-outputlen = 40.
  164.   wa_fcat-col_pos = '2'.
  165.   wa_fcat-fieldname = 'NAME'.
  166.   wa_fcat-seltext_m = 'Name'.
  167.   APPEND wa_fcat TO i_fcat.
  168.   CLEAR wa_fcat.
  169.     wa_fcat-outputlen = 40.
  170.   wa_fcat-col_pos = '3'.
  171.   wa_fcat-fieldname = 'ZTEST_DATE'.
  172.   wa_fcat-seltext_m = 'English Test Date'.
  173.   APPEND wa_fcat TO i_fcat.
  174.   CLEAR wa_fcat.
  175.   wa_fcat-outputlen = 40.
  176.   wa_fcat-col_pos = '4'.
  177.   wa_fcat-fieldname = 'ZPROGRAM'.
  178.   wa_fcat-seltext_m = 'Program'.
  179.   APPEND wa_fcat TO i_fcat.
  180.   CLEAR wa_fcat.
  181.    wa_fcat-outputlen = 40.
  182.   wa_fcat-col_pos = '5'.
  183.   wa_fcat-fieldname = 'ZTEST'.
  184.   wa_fcat-seltext_m = 'Test'.
  185.   APPEND wa_fcat TO i_fcat.
  186.   CLEAR wa_fcat.
  187.    wa_fcat-outputlen = 40.
  188.   wa_fcat-col_pos = '6'.
  189.   wa_fcat-fieldname = 'ZRESULT'.
  190.   wa_fcat-seltext_m = 'Result'.
  191.   APPEND wa_fcat TO i_fcat.
  192.   CLEAR wa_fcat.
  193.   wa_fcat-outputlen = 40.
  194.   wa_fcat-col_pos = '7'.
  195.   wa_fcat-fieldname = 'ZPERCENT'.
  196.   wa_fcat-seltext_m = 'Percent'.
  197.   APPEND wa_fcat TO i_fcat.
  198.   CLEAR wa_fcat.
  199.     wa_fcat-outputlen = 40.
  200.   wa_fcat-col_pos = '8'.
  201.   wa_fcat-fieldname = 'ZREFERENCE_REPORT_NO'.
  202.   wa_fcat-seltext_m = 'Reference Report No'.
  203.   APPEND wa_fcat TO i_fcat.
  204.   CLEAR wa_fcat.
  205.  
  206. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  207.     EXPORTING
  208.       i_structure_name = 'PS9913'
  209.       it_fieldcat      = i_fcat
  210.       i_grid_title     = 'English Test'
  211.     TABLES
  212.       t_outtab         = it_english.
  213.  
  214.   ELSE.
  215.   MESSAGE ID 'ZINFOTYPE_ERRORS' TYPE 'I' NUMBER '002'.
  216.   ENDIF.
  217.  
  218.  ELSEIF P_TALENT = 'X'.
  219.    PERFORM f_get_talent_data.
  220.     IF it_talent IS NOT INITIAL.
  221.  
  222. *Start Forming the ALV
  223.   CLEAR wa_fcat.
  224.   CLEAR i_fcat[].
  225.   wa_fcat-outputlen = 15.
  226.   wa_fcat-col_pos = '1'.
  227.   wa_fcat-fieldname = 'PERNR'.
  228.   wa_fcat-seltext_m = 'Personnel No.'.
  229.   APPEND wa_fcat TO i_fcat.
  230.   CLEAR wa_fcat.
  231.   wa_fcat-outputlen = 40.
  232.   wa_fcat-col_pos = '2'.
  233.   wa_fcat-fieldname = 'NAME'.
  234.   wa_fcat-seltext_m = 'Name'.
  235.   APPEND wa_fcat TO i_fcat.
  236.   CLEAR wa_fcat.
  237.     wa_fcat-outputlen = 40.
  238.   wa_fcat-col_pos = '3'.
  239.   wa_fcat-fieldname = 'TESTDATE'.
  240.   wa_fcat-seltext_m = 'Talent Q Date'.
  241.   APPEND wa_fcat TO i_fcat.
  242.   CLEAR wa_fcat.
  243.   wa_fcat-outputlen = 40.
  244.   wa_fcat-col_pos = '4'.
  245.   wa_fcat-fieldname = 'TALENT_Q'.
  246.   wa_fcat-seltext_m = 'Talent Q'.
  247.   APPEND wa_fcat TO i_fcat.
  248.   CLEAR wa_fcat.
  249.    wa_fcat-outputlen = 40.
  250.   wa_fcat-col_pos = '5'.
  251.   wa_fcat-fieldname = 'ABILITY'.
  252.   wa_fcat-seltext_m = 'Ability'.
  253.   APPEND wa_fcat TO i_fcat.
  254.   CLEAR wa_fcat.
  255.    wa_fcat-outputlen = 40.
  256.   wa_fcat-col_pos = '6'.
  257.   wa_fcat-fieldname = 'PERSONALITY'.
  258.   wa_fcat-seltext_m = 'Personality'.
  259.   APPEND wa_fcat TO i_fcat.
  260.   CLEAR wa_fcat.
  261.   wa_fcat-outputlen = 40.
  262.   wa_fcat-col_pos = '7'.
  263.   wa_fcat-fieldname = 'VERBAL_FIT'.
  264.   wa_fcat-seltext_m = 'Verbal Fit'.
  265.   APPEND wa_fcat TO i_fcat.
  266.   CLEAR wa_fcat.
  267.   wa_fcat-outputlen = 40.
  268.   wa_fcat-col_pos = '8'.
  269.   wa_fcat-fieldname = 'VERBAL_SCORE'.
  270.   wa_fcat-seltext_m = 'Verbal Score'.
  271.   APPEND wa_fcat TO i_fcat.
  272.   CLEAR wa_fcat.
  273.   wa_fcat-outputlen = 40.
  274.   wa_fcat-col_pos = '9'.
  275.   wa_fcat-fieldname = 'NUMERICAL_FIT'.
  276.   wa_fcat-seltext_m = 'Numerical Fit'.
  277.   APPEND wa_fcat TO i_fcat.
  278.   CLEAR wa_fcat.
  279.     wa_fcat-outputlen = 40.
  280.   wa_fcat-col_pos = '10'.
  281.   wa_fcat-fieldname = 'NUMERICAL_SCORE'.
  282.   wa_fcat-seltext_m = 'Numerical Score'.
  283.   APPEND wa_fcat TO i_fcat.
  284.   CLEAR wa_fcat.
  285.       wa_fcat-outputlen = 40.
  286.   wa_fcat-col_pos = '11'.
  287.   wa_fcat-fieldname = 'LOGICAL_FIT'.
  288.   wa_fcat-seltext_m = 'Logical Fit'.
  289.   APPEND wa_fcat TO i_fcat.
  290.   CLEAR wa_fcat.
  291.       wa_fcat-outputlen = 40.
  292.   wa_fcat-col_pos = '12'.
  293.   wa_fcat-fieldname = 'LOGICAL_SCORE'.
  294.   wa_fcat-seltext_m = 'Logical Score'.
  295.   APPEND wa_fcat TO i_fcat.
  296.   CLEAR wa_fcat.
  297.       wa_fcat-outputlen = 40.
  298.   wa_fcat-col_pos = '13'.
  299.   wa_fcat-fieldname = 'COMMUNICATIVE_FIT'.
  300.   wa_fcat-seltext_m = 'Communicative Fit'.
  301.   APPEND wa_fcat TO i_fcat.
  302.   CLEAR wa_fcat.
  303.   wa_fcat-outputlen = 40.
  304.   wa_fcat-col_pos = '14'.
  305.   wa_fcat-fieldname = 'COMMUNICATIVE_SCORE'.
  306.   wa_fcat-seltext_m = 'Communicative Score'.
  307.   APPEND wa_fcat TO i_fcat.
  308.   CLEAR wa_fcat.
  309.         wa_fcat-outputlen = 40.
  310.   wa_fcat-col_pos = '15'.
  311.   wa_fcat-fieldname = 'INFLUENCING_FIT'.
  312.   wa_fcat-seltext_m = 'Influencing Fit'.
  313.   APPEND wa_fcat TO i_fcat.
  314.   CLEAR wa_fcat.
  315.   wa_fcat-outputlen = 40.
  316.   wa_fcat-col_pos = '16'.
  317.   wa_fcat-fieldname = 'INFLUENCING_SCORE'.
  318.   wa_fcat-seltext_m = 'Influencing Score'.
  319.   APPEND wa_fcat TO i_fcat.
  320.   CLEAR wa_fcat.
  321.   wa_fcat-outputlen = 40.
  322.   wa_fcat-col_pos = '17'.
  323.   wa_fcat-fieldname = 'SOCIALLY_CONFIDENT_FIT'.
  324.   wa_fcat-seltext_m = 'Socially Confident Fit'.
  325.   APPEND wa_fcat TO i_fcat.
  326.   CLEAR wa_fcat.
  327.   wa_fcat-outputlen = 40.
  328.   wa_fcat-col_pos = '18'.
  329.   wa_fcat-fieldname = 'SOCIALLY_CONFIDENT_SCORE'.
  330.   wa_fcat-seltext_m = 'Socially Confident Score'.
  331.   APPEND wa_fcat TO i_fcat.
  332.   CLEAR wa_fcat.
  333.     wa_fcat-outputlen = 40.
  334.   wa_fcat-col_pos = '19'.
  335.   wa_fcat-fieldname = 'SUPPORTIVE_FIT'.
  336.   wa_fcat-seltext_m = 'Supportive Fit'.
  337.   APPEND wa_fcat TO i_fcat.
  338.   CLEAR wa_fcat.
  339.   wa_fcat-outputlen = 40.
  340.   wa_fcat-col_pos = '20'.
  341.   wa_fcat-fieldname = 'SUPPORTIVE_SCORE'.
  342.   wa_fcat-seltext_m = 'Supportive Score'.
  343.   APPEND wa_fcat TO i_fcat.
  344.   CLEAR wa_fcat.
  345.     wa_fcat-outputlen = 40.
  346.   wa_fcat-col_pos = '21'.
  347.   wa_fcat-fieldname = 'CONSULTATIVE_FIT'.
  348.   wa_fcat-seltext_m = 'Consultative Fit'.
  349.   APPEND wa_fcat TO i_fcat.
  350.   CLEAR wa_fcat.
  351.   wa_fcat-outputlen = 40.
  352.   wa_fcat-col_pos = '22'.
  353.   wa_fcat-fieldname = 'CONSULTATIVE_SCORE'.
  354.   wa_fcat-seltext_m = 'Consultative Score'.
  355.   APPEND wa_fcat TO i_fcat.
  356.   CLEAR wa_fcat.
  357.       wa_fcat-outputlen = 40.
  358.   wa_fcat-col_pos = '23'.
  359.   wa_fcat-fieldname = 'ANALYTICAL_FIT'.
  360.   wa_fcat-seltext_m = 'Analytical Fit'.
  361.   APPEND wa_fcat TO i_fcat.
  362.   CLEAR wa_fcat.
  363.   wa_fcat-outputlen = 40.
  364.   wa_fcat-col_pos = '24'.
  365.   wa_fcat-fieldname = 'ANALYTICAL_SCORE'.
  366.   wa_fcat-seltext_m = 'Analytical Score'.
  367.   APPEND wa_fcat TO i_fcat.
  368.   CLEAR wa_fcat.
  369.     wa_fcat-outputlen = 40.
  370.   wa_fcat-col_pos = '25'.
  371.   wa_fcat-fieldname = 'CONCEPTUAL_FIT'.
  372.   wa_fcat-seltext_m = 'Conceptual Fit'.
  373.   APPEND wa_fcat TO i_fcat.
  374.   CLEAR wa_fcat.
  375.   wa_fcat-outputlen = 40.
  376.   wa_fcat-col_pos = '26'.
  377.   wa_fcat-fieldname = 'CONCEPTUAL_SCORE'.
  378.   wa_fcat-seltext_m = 'Conceptual Score'.
  379.   APPEND wa_fcat TO i_fcat.
  380.   CLEAR wa_fcat.
  381.         wa_fcat-outputlen = 40.
  382.   wa_fcat-col_pos = '27'.
  383.   wa_fcat-fieldname = 'CREATIVE_FIT'.
  384.   wa_fcat-seltext_m = 'Creative Fit'.
  385.   APPEND wa_fcat TO i_fcat.
  386.   CLEAR wa_fcat.
  387.   wa_fcat-outputlen = 40.
  388.   wa_fcat-col_pos = '28'.
  389.   wa_fcat-fieldname = 'CREATIVE_SCORE'.
  390.   wa_fcat-seltext_m = 'Creative Score'.
  391.   APPEND wa_fcat TO i_fcat.
  392.   CLEAR wa_fcat.
  393.     wa_fcat-outputlen = 40.
  394.   wa_fcat-col_pos = '29'.
  395.   wa_fcat-fieldname = 'METHODICAL_FIT'.
  396.   wa_fcat-seltext_m = 'Methodical Fit'.
  397.   APPEND wa_fcat TO i_fcat.
  398.   CLEAR wa_fcat.
  399.   wa_fcat-outputlen = 40.
  400.   wa_fcat-col_pos = '30'.
  401.   wa_fcat-fieldname = 'METHODICAL_SCORE'.
  402.   wa_fcat-seltext_m = 'Methodical Score'.
  403.   APPEND wa_fcat TO i_fcat.
  404.   CLEAR wa_fcat.
  405.           wa_fcat-outputlen = 40.
  406.   wa_fcat-col_pos = '31'.
  407.   wa_fcat-fieldname = 'CONSCIENTIOUS_FIT'.
  408.   wa_fcat-seltext_m = 'Conscientious Fit'.
  409.   APPEND wa_fcat TO i_fcat.
  410.   CLEAR wa_fcat.
  411.   wa_fcat-outputlen = 40.
  412.   wa_fcat-col_pos = '32'.
  413.   wa_fcat-fieldname = 'CONSCIENTIOUS_SCORE'.
  414.   wa_fcat-seltext_m = 'Conscientious Score'.
  415.   APPEND wa_fcat TO i_fcat.
  416.   CLEAR wa_fcat.
  417.     wa_fcat-outputlen = 40.
  418.   wa_fcat-col_pos = '33'.
  419.   wa_fcat-fieldname = 'RELAXED_FIT'.
  420.   wa_fcat-seltext_m = 'Relaxed Fit'.
  421.   APPEND wa_fcat TO i_fcat.
  422.   CLEAR wa_fcat.
  423.   wa_fcat-outputlen = 40.
  424.   wa_fcat-col_pos = '34'.
  425.   wa_fcat-fieldname = 'RELAXED_SCORE'.
  426.   wa_fcat-seltext_m = 'Relaxed Score'.
  427.   APPEND wa_fcat TO i_fcat.
  428.   CLEAR wa_fcat.
  429.             wa_fcat-outputlen = 40.
  430.   wa_fcat-col_pos = '35'.
  431.   wa_fcat-fieldname = 'RESILIENT_FIT'.
  432.   wa_fcat-seltext_m = 'Resilient Fit'.
  433.   APPEND wa_fcat TO i_fcat.
  434.   CLEAR wa_fcat.
  435.   wa_fcat-outputlen = 40.
  436.   wa_fcat-col_pos = '36'.
  437.   wa_fcat-fieldname = 'RESILIENT_SCORE'.
  438.   wa_fcat-seltext_m = 'Resilient Score'.
  439.   APPEND wa_fcat TO i_fcat.
  440.   CLEAR wa_fcat.
  441.     wa_fcat-outputlen = 40.
  442.   wa_fcat-col_pos = '37'.
  443.   wa_fcat-fieldname = 'FLEXIBLE_FIT'.
  444.   wa_fcat-seltext_m = 'Flexible Fit'.
  445.   APPEND wa_fcat TO i_fcat.
  446.   CLEAR wa_fcat.
  447.   wa_fcat-outputlen = 40.
  448.   wa_fcat-col_pos = '38'.
  449.   wa_fcat-fieldname = 'FLEXIBLE_SCORE'.
  450.   wa_fcat-seltext_m = 'Flexible Score'.
  451.   APPEND wa_fcat TO i_fcat.
  452.   CLEAR wa_fcat.
  453.               wa_fcat-outputlen = 40.
  454.   wa_fcat-col_pos = '39'.
  455.   wa_fcat-fieldname = 'DECISIVE_ACTION_ORIENTED_FIT'.
  456.   wa_fcat-seltext_m = 'Decisive Action-oriented Fit'.
  457.   APPEND wa_fcat TO i_fcat.
  458.   CLEAR wa_fcat.
  459.   wa_fcat-outputlen = 40.
  460.   wa_fcat-col_pos = '40'.
  461.   wa_fcat-fieldname = 'DECISIVE_ACTION_ORIENTED_SCORE'.
  462.   wa_fcat-seltext_m = 'Decisive Action-oriented Score'.
  463.   APPEND wa_fcat TO i_fcat.
  464.   CLEAR wa_fcat.
  465.     wa_fcat-outputlen = 40.
  466.   wa_fcat-col_pos = '41'.
  467.   wa_fcat-fieldname = 'ACHIEVEMENT_ORIENTED_FIT'.
  468.   wa_fcat-seltext_m = 'Achievement Oriented Fit'.
  469.   APPEND wa_fcat TO i_fcat.
  470.   CLEAR wa_fcat.
  471.   wa_fcat-outputlen = 40.
  472.   wa_fcat-col_pos = '42'.
  473.   wa_fcat-fieldname = 'ACHIEVEMENT_ORIENTED_SCORE'.
  474.   wa_fcat-seltext_m = 'Achievement Oriented Score'.
  475.   APPEND wa_fcat TO i_fcat.
  476.   CLEAR wa_fcat.
  477.  
  478. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  479.     EXPORTING
  480.       i_structure_name = 'PS9912'
  481.       it_fieldcat      = i_fcat
  482.       i_grid_title     = 'Talent Q'
  483.     TABLES
  484.       t_outtab         = it_talent.
  485.   ELSE.
  486.   MESSAGE ID 'ZINFOTYPE_ERRORS' TYPE 'I' NUMBER '001'.
  487.   ENDIF.
  488.  
  489.   ELSEIF P_PROF = 'X'.
  490.      PERFORM f_get_profile_data.
  491.     IF it_profile IS NOT INITIAL.
  492.  
  493. *Start Forming the ALV
  494.   CLEAR wa_fcat.
  495.   CLEAR i_fcat[].
  496.   wa_fcat-outputlen = 15.
  497.   wa_fcat-col_pos = '1'.
  498.   wa_fcat-fieldname = 'PERNR'.
  499.   wa_fcat-seltext_m = 'Personnel No.'.
  500.   APPEND wa_fcat TO i_fcat.
  501.   CLEAR wa_fcat.
  502.   wa_fcat-col_pos = '2'.
  503.   wa_fcat-fieldname = 'NAME'.
  504.   wa_fcat-seltext_m = 'Name'.
  505.   wa_fcat-outputlen = 40.
  506.   APPEND wa_fcat TO i_fcat.
  507.   CLEAR wa_fcat.
  508.  
  509.   wa_fcat-col_pos = '3'.
  510.   wa_fcat-fieldname = 'SG'.
  511.   wa_fcat-seltext_m = 'SG'.
  512.   wa_fcat-outputlen = 10.
  513.   APPEND wa_fcat TO i_fcat.
  514.   CLEAR wa_fcat.
  515.  
  516.   wa_fcat-col_pos = '4'.
  517.   wa_fcat-fieldname = 'COMP_CODE'.
  518.   wa_fcat-seltext_m = 'Orglv'.
  519.   wa_fcat-outputlen = 10.
  520.   APPEND wa_fcat TO i_fcat.
  521.   CLEAR wa_fcat.
  522.  
  523.   wa_fcat-col_pos = '5'.
  524.   wa_fcat-fieldname = 'POSITION'.
  525.   wa_fcat-seltext_m = 'Current Position'.
  526.   wa_fcat-outputlen = 20.
  527.   APPEND wa_fcat TO i_fcat.
  528.   CLEAR wa_fcat.
  529.  
  530.  
  531.   wa_fcat-col_pos = '6'.
  532.   wa_fcat-fieldname = 'MAN_LVL'.
  533.   wa_fcat-seltext_m = 'Managerial Level'.
  534.   wa_fcat-outputlen = 20.
  535.   APPEND wa_fcat TO i_fcat.
  536.   CLEAR wa_fcat.
  537.  
  538.   wa_fcat-col_pos = '7'.
  539.   wa_fcat-fieldname = 'COSTCENTER'.
  540.   wa_fcat-seltext_m = 'Cost Center'.
  541.   wa_fcat-outputlen = 20.
  542.   APPEND wa_fcat TO i_fcat.
  543.   CLEAR wa_fcat.
  544.  
  545.   wa_fcat-col_pos = '7'.
  546.   wa_fcat-fieldname = 'PERS_AREA'.
  547.   wa_fcat-seltext_m = 'Personnal Area'.
  548.   wa_fcat-outputlen = 20.
  549.   APPEND wa_fcat TO i_fcat.
  550.   CLEAR wa_fcat.
  551.  
  552.   wa_fcat-col_pos = '8'.
  553.   wa_fcat-fieldname = 'P_SUBAREA'.
  554.   wa_fcat-seltext_m = 'Personnal Sub-Area'.
  555.   wa_fcat-outputlen = 20.
  556.   APPEND wa_fcat TO i_fcat.
  557.   CLEAR wa_fcat.
  558.  
  559.   wa_fcat-col_pos = '9'.
  560.   wa_fcat-fieldname = 'ORG_UNIT'.
  561.   wa_fcat-seltext_m = 'Department'.
  562.   wa_fcat-outputlen = 20.
  563.   APPEND wa_fcat TO i_fcat.
  564.   CLEAR wa_fcat.
  565.  
  566.  
  567.   wa_fcat-col_pos = '10'.
  568.   wa_fcat-fieldname = 'BUS_AREA'.
  569.   wa_fcat-seltext_m = 'Business Area'.
  570.   wa_fcat-outputlen = 20.
  571.   APPEND wa_fcat TO i_fcat.
  572.   CLEAR wa_fcat.
  573.  
  574.  
  575.   wa_fcat-col_pos = '11'.
  576.   wa_fcat-fieldname = 'SEN_DATE'.
  577.   wa_fcat-seltext_m = 'Seniority Date'.
  578.   wa_fcat-outputlen = 20.
  579.   APPEND wa_fcat TO i_fcat.
  580.   CLEAR wa_fcat.
  581.  
  582.   wa_fcat-col_pos = '12'.
  583.   wa_fcat-fieldname = 'LST_PRM'.
  584.   wa_fcat-seltext_m = 'Last Promotion'.
  585.   wa_fcat-outputlen = 20.
  586.   APPEND wa_fcat TO i_fcat.
  587.   CLEAR wa_fcat.
  588.     wa_fcat-outputlen = 40.
  589.   wa_fcat-col_pos = '13'.
  590.   wa_fcat-fieldname = 'TEST_DATE'.
  591.   wa_fcat-seltext_m = 'Profile XT Date'.
  592.   APPEND wa_fcat TO i_fcat.
  593.   CLEAR wa_fcat.
  594.   wa_fcat-outputlen = 40.
  595.   wa_fcat-col_pos = '14'.
  596.   wa_fcat-fieldname = 'MANAGER_ASSESS'.
  597.   wa_fcat-seltext_m = 'Manager Assess'.
  598.   APPEND wa_fcat TO i_fcat.
  599.   CLEAR wa_fcat.
  600.    wa_fcat-outputlen = 40.
  601.   wa_fcat-col_pos = '15'.
  602.   wa_fcat-fieldname = 'ELANG_TEST'.
  603.   wa_fcat-seltext_m = 'Elang Test'.
  604.   APPEND wa_fcat TO i_fcat.
  605.   CLEAR wa_fcat.
  606.    wa_fcat-outputlen = 40.
  607.   wa_fcat-col_pos = '16'.
  608.   wa_fcat-fieldname = 'W_ELANG_TEST'.
  609.   wa_fcat-seltext_m = 'W Elang Test'.
  610.   APPEND wa_fcat TO i_fcat.
  611.   CLEAR wa_fcat.
  612.   wa_fcat-outputlen = 40.
  613.   wa_fcat-col_pos = '17'.
  614.   wa_fcat-fieldname = 'XT'.
  615.   wa_fcat-seltext_m = 'XT'.
  616.   APPEND wa_fcat TO i_fcat.
  617.   CLEAR wa_fcat.
  618.   wa_fcat-outputlen = 40.
  619.   wa_fcat-col_pos = '18'.
  620.   wa_fcat-fieldname = 'WXT'.
  621.   wa_fcat-seltext_m = 'WXT'.
  622.   APPEND wa_fcat TO i_fcat.
  623.   CLEAR wa_fcat.
  624.   wa_fcat-outputlen = 40.
  625.   wa_fcat-col_pos = '19'.
  626.   wa_fcat-fieldname = 'TOTAL_XTALL'.
  627.   wa_fcat-seltext_m = 'Total(Mgr,ELT,XTALL)'.
  628.   APPEND wa_fcat TO i_fcat.
  629.   CLEAR wa_fcat.
  630.     wa_fcat-outputlen = 40.
  631.   wa_fcat-col_pos = '20'.
  632.   wa_fcat-fieldname = 'XT_THINKING'.
  633.   wa_fcat-seltext_m = 'XT (Thinking)'.
  634.   APPEND wa_fcat TO i_fcat.
  635.   CLEAR wa_fcat.
  636.       wa_fcat-outputlen = 40.
  637.   wa_fcat-col_pos = '21'.
  638.   wa_fcat-fieldname = 'TOTAL_XTTH'.
  639.   wa_fcat-seltext_m = 'Total(Mgr,ELT,XTTH)'.
  640.   APPEND wa_fcat TO i_fcat.
  641.   CLEAR wa_fcat.
  642.       wa_fcat-outputlen = 40.
  643.   wa_fcat-col_pos = '22'.
  644.   wa_fcat-fieldname = 'DIFFERENCE'.
  645.   wa_fcat-seltext_m = 'Difference'.
  646.   APPEND wa_fcat TO i_fcat.
  647.   CLEAR wa_fcat.
  648.       wa_fcat-outputlen = 40.
  649.   wa_fcat-col_pos = '23'.
  650.   wa_fcat-fieldname = 'THINKING'.
  651.   wa_fcat-seltext_m = 'Thinking'.
  652.   APPEND wa_fcat TO i_fcat.
  653.   CLEAR wa_fcat.
  654.   wa_fcat-outputlen = 40.
  655.   wa_fcat-col_pos = '24'.
  656.   wa_fcat-fieldname = 'BEHAVIORAL'.
  657.   wa_fcat-seltext_m = 'Behavioral'.
  658.   APPEND wa_fcat TO i_fcat.
  659.   CLEAR wa_fcat.
  660.         wa_fcat-outputlen = 40.
  661.   wa_fcat-col_pos = '25'.
  662.   wa_fcat-fieldname = 'INTEREST'.
  663.   wa_fcat-seltext_m = 'Interest'.
  664.   APPEND wa_fcat TO i_fcat.
  665.   CLEAR wa_fcat.
  666.   wa_fcat-outputlen = 40.
  667.   wa_fcat-col_pos = '26'.
  668.   wa_fcat-fieldname = 'PROFILE_XT'.
  669.   wa_fcat-seltext_m = 'Profile XT'.
  670.   APPEND wa_fcat TO i_fcat.
  671.   CLEAR wa_fcat.
  672.   wa_fcat-outputlen = 40.
  673.   wa_fcat-col_pos = '27'.
  674.   wa_fcat-fieldname = 'W_PROFILE_XT'.
  675.   wa_fcat-seltext_m = 'W Profile XT'.
  676.   APPEND wa_fcat TO i_fcat.
  677.   CLEAR wa_fcat.
  678.   wa_fcat-outputlen = 40.
  679.   wa_fcat-col_pos = '28'.
  680.   wa_fcat-fieldname = 'TOTAL'.
  681.   wa_fcat-seltext_m = 'Total'.
  682.   APPEND wa_fcat TO i_fcat.
  683.   CLEAR wa_fcat.
  684.     wa_fcat-outputlen = 40.
  685.   wa_fcat-col_pos = '29'.
  686.   wa_fcat-fieldname = 'ZASSIGNED'.
  687.   wa_fcat-seltext_m = 'Assigned'.
  688.   APPEND wa_fcat TO i_fcat.
  689.   CLEAR wa_fcat.
  690.   wa_fcat-outputlen = 40.
  691.   wa_fcat-col_pos = '30'.
  692.   wa_fcat-fieldname = 'TARGET_POSITION'.
  693.   wa_fcat-seltext_m = 'Target Position'.
  694.   APPEND wa_fcat TO i_fcat.
  695.   CLEAR wa_fcat.
  696.  
  697. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  698.     EXPORTING
  699.       i_structure_name = 'PS991'
  700.       it_fieldcat      = i_fcat
  701.       i_grid_title     = 'Profile XT'
  702.     TABLES
  703.       t_outtab         = it_profile.
  704.   ELSE.
  705.   MESSAGE ID 'ZINFOTYPE_ERRORS' TYPE 'I' NUMBER '000'.
  706.   ENDIF.
  707.  
  708.   ENDIF.
  709.  
  710. FORM f_get_profile_data .
  711.  
  712.   CLEAR it_profile[].
  713.   CLEAR it_9911[].
  714.  
  715.    CALL FUNCTION 'Z_INFOTYPE_9911'
  716.      TABLES
  717.        IM_PERNRS_SELOPT       = r_pernr
  718.        EX_TAB_INFTY           = it_9911
  719.              .
  720.   IF it_9911[] IS NOT INITIAL.
  721.     PERFORM f_fill_profile_data.
  722.   ENDIF.
  723. ENDFORM.
  724.  
  725. FORM f_get_talent_data .
  726.  
  727.   CLEAR it_talent[].
  728.   CLEAR it_9912[].
  729.  
  730.    CALL FUNCTION 'Z_INFOTYPE_9912'
  731.      TABLES
  732.        IM_PERNRS_SELOPT       = r_pernr
  733.        EX_TAB_INFTY           = it_9912
  734.              .
  735.   IF it_9912[] IS NOT INITIAL.
  736.     PERFORM f_fill_talent_data.
  737.   ENDIF.
  738. ENDFORM.
  739.  
  740. FORM f_get_appraisal_data .
  741.  
  742.   CLEAR it_appraisal[].
  743.   CLEAR it_9914[].
  744.  
  745.    CALL FUNCTION 'Z_INFOTYPE_9914'
  746.      TABLES
  747.        IM_PERNRS_SELOPT       = r_pernr
  748.        EX_TAB_INFTY           = it_9914
  749.              .
  750.   IF it_9914[] IS NOT INITIAL.
  751.     PERFORM f_fill_appraisal_data.
  752.   ENDIF.
  753. ENDFORM.
  754.  
  755. FORM f_get_test_data .
  756.  
  757.   CLEAR it_english[].
  758.   CLEAR it_9913[].
  759.  
  760.    CALL FUNCTION 'Z_INFOTYPE_9913'
  761.      TABLES
  762.        IM_PERNRS_SELOPT       = r_pernr
  763.        EX_TAB_INFTY           = it_9913
  764.              .
  765.   IF it_9913[] IS NOT INITIAL.
  766.     PERFORM f_fill_test_data.
  767.   ENDIF.
  768. ENDFORM.
  769.  
  770. FORM f_fill_appraisal_data .
  771.  
  772. *Clear Internal Table.
  773.   CLEAR it_appraisal[].
  774.  
  775. *Personal Data BAPI
  776.   DATA it_personal_data TYPE TABLE OF bapip0001b.
  777. **
  778.   MOVE-CORRESPONDING it_9914[] TO it_appraisal[].
  779.  
  780. *Start Looping through the personal data
  781.   LOOP AT it_appraisal.
  782.     CLEAR it_personal_data[].
  783.  
  784.     CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
  785.       EXPORTING
  786.         employee_id    = it_appraisal-pernr
  787.       TABLES
  788.         org_assignment = it_personal_data
  789. *       PERSONAL_DATA  =
  790. *       INTERNAL_CONTROL       =
  791. *       COMMUNICATION  =
  792. *       ARCHIVELINK    =
  793.       .
  794.  
  795. *Add name to the data
  796.     CHECK it_personal_data IS NOT INITIAL.
  797.     it_appraisal-name = it_personal_data[ 1 ]-name.
  798.     MODIFY it_appraisal.
  799.   ENDLOOP .
  800. ENDFORM.
  801.  
  802. *f_fill_test_data
  803. FORM f_fill_test_data .
  804.  
  805. *Clear Internal Table.
  806.   CLEAR it_english[].
  807.  
  808. *Personal Data BAPI
  809.   DATA it_personal_data TYPE TABLE OF bapip0001b.
  810. **
  811.   MOVE-CORRESPONDING it_9913[] TO it_english[].
  812.  
  813. *Start Looping through the personal data
  814.   LOOP AT it_english.
  815.     CLEAR it_personal_data[].
  816.  
  817.     CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
  818.       EXPORTING
  819.         employee_id    = it_english-pernr
  820.       TABLES
  821.         org_assignment = it_personal_data
  822. *       PERSONAL_DATA  =
  823. *       INTERNAL_CONTROL       =
  824. *       COMMUNICATION  =
  825. *       ARCHIVELINK    =
  826.       .
  827.  
  828. *Add name to the data
  829.     CHECK it_personal_data IS NOT INITIAL.
  830.     it_english-name = it_personal_data[ 1 ]-name.
  831.     MODIFY it_english.
  832.   ENDLOOP .
  833. ENDFORM.
  834.  
  835. FORM f_fill_talent_data .
  836.  
  837. *Clear Internal Table.
  838.   CLEAR it_talent[].
  839.  
  840. *Personal Data BAPI
  841.   DATA it_personal_data TYPE TABLE OF bapip0001b.
  842. **
  843.   MOVE-CORRESPONDING it_9912[] TO it_talent[].
  844.  
  845. *Start Looping through the personal data
  846.   LOOP AT it_talent.
  847.     CLEAR it_personal_data[].
  848.  
  849.     CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
  850.       EXPORTING
  851.         employee_id    = it_talent-pernr
  852.       TABLES
  853.         org_assignment = it_personal_data
  854. *       PERSONAL_DATA  =
  855. *       INTERNAL_CONTROL       =
  856. *       COMMUNICATION  =
  857. *       ARCHIVELINK    =
  858.       .
  859.  
  860. *Add name to the data
  861.     CHECK it_personal_data IS NOT INITIAL.
  862.     it_talent-name = it_personal_data[ 1 ]-name.
  863.     MODIFY it_talent.
  864.   ENDLOOP .
  865. ENDFORM.
  866.  
  867. FORM f_fill_profile_data .
  868.  
  869. *Clear Internal Table.
  870.   CLEAR it_profile[].
  871.  
  872. *Personal Data BAPI
  873.   DATA it_personal_data TYPE TABLE OF bapip0001b.
  874. **
  875.   MOVE-CORRESPONDING it_9911[] TO it_profile[].
  876.  
  877. *Start Looping through the personal data
  878.   LOOP AT it_profile.
  879.     CLEAR it_personal_data[].
  880.  
  881.     CALL FUNCTION 'BAPI_EMPLOYEE_GETDATA'
  882.       EXPORTING
  883.         employee_id    = it_profile-pernr
  884.       TABLES
  885.         org_assignment = it_personal_data
  886. *       PERSONAL_DATA  =
  887. *       INTERNAL_CONTROL       =
  888. *       COMMUNICATION  =
  889. *       ARCHIVELINK    =
  890.       .
  891.  
  892. *Add all required fields to the data
  893.     CHECK it_personal_data IS NOT INITIAL.
  894.     it_profile-name = it_personal_data[ 1 ]-name.
  895.     it_profile-COMP_CODE = it_personal_data[ 1 ]-COMP_CODE.
  896.     it_profile-POSITION = it_personal_data[ 1 ]-POSITION.
  897.     it_profile-COSTCENTER = it_personal_data[ 1 ]-COSTCENTER.
  898.     it_profile-PERS_AREA = it_personal_data[ 1 ]-PERS_AREA.
  899.     it_profile-P_SUBAREA = it_personal_data[ 1 ]-P_SUBAREA.
  900.     it_profile-ORG_UNIT = it_personal_data[ 1 ]-ORG_UNIT.
  901.     it_profile-BUS_AREA = it_personal_data[ 1 ]-BUS_AREA.
  902.     MODIFY it_profile.
  903.   ENDLOOP .
  904. ENDFORM.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement