cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Agent Determination Rule using Function Module

Former Member
0 Likes
2,659

Hi all,

I am trying to create a custom agent determination rule using function module. But my rule is not getting invoked when the workflow is executed.

I created a custom rule and linked my function module (with proper signature).

FUNCTION 'ZRULEXXX''

""Local Interface:

*" TABLES

*" AC_CONTAINER STRUCTURE SWCONT

*" ACTOR_TAB STRUCTURE SWHACTOR

*" EXCEPTIONS

*" NOBODY_FOUND

And I am hard coding some values into table ACTOR_TAB

********************************************************************

REFRESH ACTOR_TAB.

CLEAR ACTOR_TAB.

IF SY-SUBRC NE 0.

RAISE NOBODY_FOUND.

ELSE.

ACTOR_TAB-OTYPE = 'US'.

ACTOR_TAB-OBJID = 'XXXX'.

APPEND ACTOR_TAB.

ACTOR_TAB-OTYPE = 'US'.

ACTOR_TAB-OBJID = 'XXXXXX'.

APPEND ACTOR_TAB.

ENDIF.

********************************************************************

But a worklist item is not being created for the users appended to ACTOR_TAB.

Is there anything am missing. Please let me know.

Thanks in advance

Regards

Raju

View Entire Topic
Former Member
0 Likes

Hi,

Change it to following code. It will work.


 REFRESH ACTOR_TAB.
CLEAR ACTOR_TAB.

*IF SY-SUBRC NE 0.
*RAISE NOBODY_FOUND.
*ELSE.
ACTOR_TAB-OTYPE = 'US'.
ACTOR_TAB-OBJID = 'XXXX'.
APPEND ACTOR_TAB.

ACTOR_TAB-OTYPE = 'US'.
ACTOR_TAB-OBJID = 'XXXXXX'.
APPEND ACTOR_TAB.

*ENDIF.

Regards,

Vaishali.