Advertisement
yaramohamed78

ZHCM_GET_TALENT_Q_9189

Feb 22nd, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 1.69 KB | None | 0 0
  1. FUNCTION ZHCM_GET_TALENT_Q_9189 .
  2. *"----------------------------------------------------------------------
  3. *"*"Local Interface:
  4. *"  IMPORTING
  5. *"     REFERENCE(IM_BEGDA) TYPE  PRELP-BEGDA DEFAULT '18000101'
  6. *"     REFERENCE(IM_ENDDA) TYPE  PRELP-ENDDA DEFAULT '99991231'
  7. *"     REFERENCE(IM_LATEST_ONLY) TYPE  BOOLEAN DEFAULT ABAP_FALSE
  8. *"  TABLES
  9. *"      IM_PERNRS_SELOPT STRUCTURE  SELOPT
  10. *"      EX_TAB_INFTY STRUCTURE  P9189
  11. *"----------------------------------------------------------------------
  12.  
  13.   TYPES:
  14.    BEGIN OF ty_pernr,
  15.    pernr TYPE pernr-pernr,
  16.    END OF ty_pernr.
  17.  
  18.   DATA it_pernr TYPE TABLE OF ty_pernr.
  19.   DATA wa_pernr TYPE ty_pernr.
  20.  
  21.  
  22.   SELECT DISTINCT pernr FROM pa9189 INTO CORRESPONDING FIELDS OF TABLE it_pernr WHERE pernr IN im_pernrs_selopt.
  23.  
  24.   DATA tm_tab_infty LIKE TABLE OF ex_tab_infty WITH HEADER LINE.
  25.  
  26.   LOOP AT it_pernr INTO wa_pernr.
  27.     CALL FUNCTION 'HR_READ_INFOTYPE'
  28.       EXPORTING
  29. *       TCLAS     = 'A'
  30.         pernr     = wa_pernr-pernr
  31.         infty     = '9189'
  32.         begda     = im_begda
  33.         endda     = im_endda
  34. *       BYPASS_BUFFER         = ' '
  35. *       LEGACY_MODE           = ' '
  36. * IMPORTING
  37. *       SUBRC     =
  38.       TABLES
  39.         infty_tab = tm_tab_infty
  40. * EXCEPTIONS
  41. *       INFTY_NOT_FOUND       = 1
  42. *       OTHERS    = 2
  43.       .
  44.  
  45. if im_latest_only = abap_true.
  46.   SORT  tm_tab_infty by endda DESCENDING.
  47.     if tm_tab_infty[] is NOT INITIAL.
  48.      APPEND  tm_tab_infty[ 1 ] TO ex_tab_infty.
  49.      endif.
  50.  else.
  51.     APPEND LINES OF tm_tab_infty TO ex_tab_infty.
  52.    ENDIF.
  53.  
  54.     CLEAR tm_tab_infty[].
  55.     IF sy-subrc <> 0.
  56. * Implement suitable error handling here
  57.     ENDIF.
  58.  
  59.  
  60.  
  61.   ENDLOOP.
  62.  
  63.  
  64.  
  65.  
  66. ENDFUNCTION.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement