Skip to Content
0
Former Member
Dec 30, 2011 at 11:41 AM

Workflow defining agents issues

31 Views

Dear All,

In my workflow i am using "Send Mail" step, now i have to search my agent for a ztable.

First i have created a rule, but problem is in 'Send Mail" step there is no option to insert rules.

Second, i have create a activity before the "Send Mail" step to fetch the agents from the rule and place it in the workflow container, this is where i am facing the problem.

I am facing problem trasnferring data from workflow conatiner to task container to rule container.

The rule which i have create is "zrule"(AC90000003) and in that the function module which i created is ZFIND_SUPERIOR.

Please find the code of my FM:

FUNCTION ZFIND_SUPERIOR.

INCLUDE <CNTN01>.

TYPES: BEGIN OF TY_USER.

INCLUDE STRUCTURE ZUSER_WORKFLOW.

TYPES: END OF TY_USER.

DATA: VRG_AGENT LIKE WFSYST-AGENT,

IT_HOLDER TYPE STANDARD TABLE OF SWHACTOR,

WA_HOLDER TYPE SWHACTOR,

IT_USER TYPE STANDARD TABLE OF TY_USER,

WA_USER TYPE TY_USER,

V_LEN TYPE I,

V_CLERK LIKE ZUSER_WORKFLOW-CLERK,

NUM_LINES TYPE I.

SWC_GET_ELEMENT AC_CONTAINER 'XYZ' VRG_AGENT.

SELECT * FROM ZUSER_WORKFLOW INTO CORRESPONDING FIELDS OF TABLE IT_USER

WHERE CLERK = VRG_AGENT.

LOOP AT IT_USER INTO WA_USER.

WA_HOLDER-OTYPE = 'US'.

WA_HOLDER-OBJID = WA_USER-MANAGER.

APPEND WA_HOLDER TO IT_HOLDER.

APPEND LINES OF IT_HOLDER TO ACTOR_TAB.

DESCRIBE TABLE ACTOR_TAB LINES NUM_LINES.

ENDLOOP.

IF NUM_LINES IS INITIAL.

RAISE NOBODY_FOUND.

ENDIF.

ENDFUNCTION.

Now please advice me how to get the value from ACTOR_TAB to workflow container.

Kindly help with with the bindings which need to be done