Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FUNCTION ZHCM_GET_TALENT_Q_9189 .
- *"----------------------------------------------------------------------
- *"*"Local Interface:
- *" IMPORTING
- *" REFERENCE(IM_BEGDA) TYPE PRELP-BEGDA DEFAULT '18000101'
- *" REFERENCE(IM_ENDDA) TYPE PRELP-ENDDA DEFAULT '99991231'
- *" REFERENCE(IM_LATEST_ONLY) TYPE BOOLEAN DEFAULT ABAP_FALSE
- *" TABLES
- *" IM_PERNRS_SELOPT STRUCTURE SELOPT
- *" EX_TAB_INFTY STRUCTURE P9189
- *"----------------------------------------------------------------------
- TYPES:
- BEGIN OF ty_pernr,
- pernr TYPE pernr-pernr,
- END OF ty_pernr.
- DATA it_pernr TYPE TABLE OF ty_pernr.
- DATA wa_pernr TYPE ty_pernr.
- SELECT DISTINCT pernr FROM pa9189 INTO CORRESPONDING FIELDS OF TABLE it_pernr WHERE pernr IN im_pernrs_selopt.
- DATA tm_tab_infty LIKE TABLE OF ex_tab_infty WITH HEADER LINE.
- LOOP AT it_pernr INTO wa_pernr.
- CALL FUNCTION 'HR_READ_INFOTYPE'
- EXPORTING
- * TCLAS = 'A'
- pernr = wa_pernr-pernr
- infty = '9189'
- begda = im_begda
- endda = im_endda
- * BYPASS_BUFFER = ' '
- * LEGACY_MODE = ' '
- * IMPORTING
- * SUBRC =
- TABLES
- infty_tab = tm_tab_infty
- * EXCEPTIONS
- * INFTY_NOT_FOUND = 1
- * OTHERS = 2
- .
- if im_latest_only = abap_true.
- SORT tm_tab_infty by endda DESCENDING.
- if tm_tab_infty[] is NOT INITIAL.
- APPEND tm_tab_infty[ 1 ] TO ex_tab_infty.
- endif.
- else.
- APPEND LINES OF tm_tab_infty TO ex_tab_infty.
- ENDIF.
- CLEAR tm_tab_infty[].
- IF sy-subrc <> 0.
- * Implement suitable error handling here
- ENDIF.
- ENDLOOP.
- ENDFUNCTION.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement