cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve Workflow Administrator maintained in SWU3

Former Member
0 Kudos

Hi,

Can anyone pls tell me that how can I retrieve Workflow Administrator (can be User, Position, Org Unit or Work centre) maintained in SWU3. I need to send a message to the workflow administrator in case when no agent is found.

Thanks

nk

Accepted Solutions (1)

Accepted Solutions (1)

narin_nandivada3
Active Contributor
0 Kudos

HI Nishant,

Please go through this thread []

Hope it migh help you.

Regards

Narin.

Former Member
0 Kudos

Hi Narin,

I have already gone through that thread. Can you please spread some more light on how can I use these roles to determine the workflow administrator explicitly.

Thanks

Answers (1)

Answers (1)

bpawanchand
Active Contributor
0 Kudos


DATA:
          lv_inter  type ref to  if_swf_run_wim_internal,
         lv_wiid   type sww_wiid.
TRY.
    CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
      EXPORTING
        im_wiid     = lv_wiid
      RECEIVING
        re_instance = lv_inter.
  CATCH cx_swf_run_wim_enq_failed .
  CATCH cx_swf_run_wim_read_failed .
  CATCH cx_swf_run_wim .
ENDTRY.

" When agent not found call the below method..
  TRY.
  CALL METHOD lv_inter->send_error_repair_mail.
  ENDTRY.

Former Member
0 Kudos

Hi,

I have used this method, now i am not getting error in SWEL Log but still the mail has not been sent to the workflow Admin. and i am getting message 'Access via 'NULL' object reference not possible.' in the SWEL Status.

Can you please tell me where i need to correct the things.

bpawanchand
Active Contributor
0 Kudos
'Access via 'NULL' object reference not possible

Make sure that the lv_interis getting populated, Imean the instance is getting created before calling the method.

Former Member
0 Kudos

Hi Pavan / Narin,

Thanks for your valuable help.

Finally i got the function module with the use of which we can get the Workflow Administrator.

We can use the following FM:

DATA: LW_ADMIN_EXPR LIKE SWD_SHEAD-ADMIN_EXPR,

LW_ADMIN LIKE SWD_SHEAD-WFI_ADMIN,

LW_ADMIN_TYPE LIKE SY-INPUT.

CALL FUNCTION 'SWD_WF_DEFINITION_ADMIN_GET'

IMPORTING

DEFAULT_ADMIN_EXPR = LW_ADMIN_EXPR

DEFAULT_ADMIN = LW_ADMIN

DEFAULT_ADMIN_TYPE = LW_ADMIN_TYPE

.

IF SY-SUBRC <> 0.

ENDIF.

NOTE: Field LW_ADMIN will return us the Workflow Administrator.

Cheers

nk