Skip to Content
0
Dec 14, 2020 at 09:36 AM

find workflow diagram name WSxxxxxx given workflow class name

33 Views

Hi all,

the flow of program is like this:

webdynpro -> call a custom method trigger_worflow -> call workflow class methods to perform logic

I need the workflow name for the swdd diagram. How to find it?

Based on the class name 'ZCL_SOMETHING' what workflow table can lead me to the workflow diagram name?

DATA: lo_event_param TYPE REF TO if_swf_ifs_parameter_container.

  DATA: lt_worklist    TYPE STANDARD TABLE OF swr_wihdr.

  DATA: ls_sibflpord   TYPE sibflporb,
        ls_worklist    TYPE swr_wihdr,
        ls_wfcon       TYPE LINE OF swconttab.

  DATA: lv_wfkey       TYPE char100,
        lv_revalue     TYPE zcm_char_value,
        lv_count       TYPE i.

  DATA: lr_oref        TYPE REF TO cx_root.

  CONSTANTS:
        lc_objty_tdev  TYPE sibftypeid    VALUE 'ZCL_SOMETHING',
        lc_clstyp_cl   TYPE swf_clstyp    VALUE 'CL',
        lc_event_sta   TYPE sibfevent     VALUE 'STARTED',
        lc_event_del   TYPE sibfevent     VALUE 'CANCELLED',
        lc_sesv_0001   TYPE swr_stavar    VALUE '0001',"Active
        lc_value_x     TYPE char01        VALUE 'X'.
*        lc_pa_dupem   TYPE zcm_parameter VALUE 'TD_CHKDUP_EMAIL'.

  CLEAR: cv_emsg.

  CHECK iv_event IS NOT INITIAL.

  IF wd_this->bukrs IS INITIAL OR wd_this->tdrnr IS INITIAL.
    MESSAGE e045(zmm01) INTO cv_emsg. EXIT.
  ENDIF.


  CONCATENATE wd_this->bukrs
              wd_this->tdrnr
              wd_this->werks INTO ls_sibflpord-instid RESPECTING BLANKS.

  ls_sibflpord-typeid = lc_objty_tdev.
  ls_sibflpord-catid  = lc_clstyp_cl.


  CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'
    EXPORTING
      object_por               = ls_sibflpord
      selection_status_variant = lc_sesv_0001
      output_only_top_level    = lc_value_x
    TABLES
      worklist                 = lt_worklist.
  IF iv_event = lc_event_sta.
    IF lt_worklist[] IS NOT INITIAL.
      MESSAGE e046(zmm01) INTO cv_emsg. EXIT.
    ENDIF.
  ELSE.
    DESCRIBE TABLE lt_worklist[] LINES lv_count.
    IF lv_count < 1.
      MESSAGE e047(zmm01) INTO cv_emsg. EXIT.
    ELSEIF lv_count > 1.
      MESSAGE e048(zmm01) INTO cv_emsg. EXIT.
    ENDIF.
  ENDIF.