Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REPORT zprogram10.
- DATA: lv_rc TYPE sy-subrc,
- lt_workitem_id TYPE STANDARD TABLE OF swr_cont WITH HEADER LINE,
- lv_task TYPE swr_struct-task,
- lt_table TYPE TABLE OF swwwihead.
- PARAMETERS: p1 AS CHECKBOX.
- IF p1 EQ abap_true.
- lv_task = 'WS77300061'.
- CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
- EXPORTING
- task = lv_task
- do_commit = 'X'
- user = sy-uname
- IMPORTING
- return_code = lv_rc.
- IF sy-subrc EQ 0.
- ENDIF.
- CALL FUNCTION 'SWW_WI_TASK_INSTANCES_READ'
- EXPORTING
- task = lv_task
- TABLES
- workitems_of_task = lt_table.
- .
- SORT lt_table BY wi_ct DESCENDING.
- READ TABLE lt_table ASSIGNING FIELD-SYMBOL(<fs_table>) INDEX 1.
- WRITE:/ 'Workflow with id # ', <fs_table>-wi_id , ' was creted'.
- ELSE.
- WRITE:/ ':('.
- ENDIF.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement