SHARE
TWEET

Untitled

a guest Nov 15th, 2019 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REPORT zwf_test.
  2.  
  3. DATA: et_workflist           TYPE TABLE OF swr_wihdr,
  4.       et_im_task_filter      TYPE  swrttask,
  5.       em_im_status_filter    TYPE swrtstatus,
  6.       et_worklist_attributes TYPE TABLE OF swr_wiaddattr.
  7.  
  8. APPEND VALUE #( wi_rh_task = 'TS96000355' ) TO et_im_task_filter.
  9.  
  10. CLEAR: et_workflist, et_worklist_attributes.
  11.  
  12. CALL FUNCTION 'SAP_WAPI_CREATE_WORKLIST'
  13.   EXPORTING
  14.     user                 = sy-uname
  15.     language             = sy-langu
  16.     translate_wi_text    = abap_false
  17.     passive_substitution = abap_true
  18.     im_task_filter       = et_im_task_filter
  19. *   im_status_filter     = em_im_status_filter
  20.   TABLES
  21.     worklist             = et_workflist
  22.     worklist_attributes  = et_worklist_attributes.
  23.  
  24. SELECT SINGLE us_name FROM hrus_d2 INTO @DATA(lv_user) WHERE rep_name = @sy-uname AND endda >= @sy-datum AND active = @abap_true.
  25. IF lv_user IS NOT INITIAL.
  26.   DATA(lv_rep) = abap_true.
  27. ENDIF.
  28.  
  29. IF lv_rep EQ abap_true.
  30.   LOOP AT et_worklist_attributes ASSIGNING FIELD-SYMBOL(<fs_worklist_attributes>) WHERE objid NE sy-uname AND objid NE ''.
  31.     IF <fs_worklist_attributes> IS ASSIGNED.
  32.       DELETE et_workflist WHERE wi_id EQ <fs_worklist_attributes>-wi_id.
  33.     ENDIF.
  34.   ENDLOOP.
  35. ENDIF.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top