HI,
I am new to workflow and facing below issue.
I have created a workflow for Service entry sheet approval (BO- BUS2901) and I am having an issue with the agent determination. I am using my own Ztable to determine the possible agents.
I am using the following code in the FM of the rule I created for determining the agent:
FUNCTION ZME_SRV_REL_GET_RESPONSIBLE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*"----------------------------------------------------------------------
INCLUDE <cntain>.
TABLES: essr_rel, essr,zmm_service_mail.
DATA: object TYPE swc_object.
DATA: BEGIN OF essrkey,
lblni LIKE essr-lblni,
END OF essrkey.
DATA: verak_user TYPE csks-verak_user.
REFRESH actor_tab.
CLEAR actor_tab.
swc_get_element ac_container 'service' object.
if sy-subrc eq space.
essrkey-lblni = object-objkey(10).
select single * from essr where lblni = essrkey-lblni.
select single * from zmm_service_mail
where frggr = essr-frggr
and frgsx = essr-frgsx.
if essr-frgzu eq ' '.
verak_user = zmm_service_mail-pernr1.
elseif essr-frgzu eq 'x'.
verak_user = zmm_service_mail-pernr2.
endif.
actor_tab-otype = 'us'.
actor_tab-objid = verak_user.
append actor_tab.
endif.
ENDFUNCTION.
When I debug, sy-subrc = 8 at swc_get_element ac_container 'service' object.
What could be the problem?
Note- I have gone thru below thread but still I am unable to find the error.
http://scn.sap.com/thread/2017416