Saturday, 1 June 2019

How to delete workflow items from SAP inbox ( Transaction code: SBWP )




  • Program.
REPORT ztest_delete_log.

DATA : wi_list TYPE TABLE OF  swkwlhead,
       ls_list 
TYPE swkwlhead.

PARAMETERS : p_user TYPE SY-UNAME.

CALL FUNCTION 'SWK_LOCAL_INBOX_GET'
  
EXPORTING
    user_id            
= p_user
    user_langu         
= sy-langu
*   READ_OTYPE         = 'US'
*   READ_OBJID         =
*   READ_TASK_NAME     =
*   READ_WITEXT_IN_LANGU       =
*   READ_RESUBMISSION  = ' '
*   PASSIVE_SUBSTITUTION       = ' '
* IMPORTING
*   E_SAPRL            =
  
TABLES
    wi_list            
= wi_list
*   WI_STATUS          =
*   TASK_FILTER        =
  
EXCEPTIONS
    user_cannot_get_wi 
= 1
    
OTHERS             = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

IF wi_list IS  NOT INITIAL.

  
LOOP AT wi_list INTO ls_list.

    
CALL FUNCTION 'SWW_WI_DELETE'
      
EXPORTING
        wi_id         
= ls_list-wi_id
*       DO_COMMIT     = 'X'
*       CREATE_EVENT  = ' '
*       DELETE_LOG    = ' '
* IMPORTING
*       DELETE_COUNT  =
      
EXCEPTIONS
        update_failed 
= 1
        
OTHERS        = 2.
    
IF sy-subrc <> 0.
* Implement suitable error handling here
    
ENDIF.

  
ENDLOOP.



ENDIF.

No comments:

Post a Comment