Agent Determination - Rule - Function Module
Lowe, Henry
henry.lowe at logicacmg.com
Wed Aug 2 04:38:34 EDT 2006
I have implemented a rule based agent assignment using a function
module. For some reason the statement
swc_get_element ac_container etc is not working. I initially tested the
workflow as a whole and then did the 'simulate rule resolution' in PFAC
and have narrowed it down to this statement.
I have put the include <CNTN01> in my global data for the function
group.
Here is the code in the function module:
FUNCTION z_get_po_creator.
*"----------------------------------------------------------------------
*"*"Local interface:
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
*"----------------------------------------------------------------------
DATA: l_user LIKE wfsyst-initiator,
l_ebeln TYPE ebeln.
CLEAR: actor_tab.
REFRESH: actor_tab.
break-point. "For Testing Purposes Only
* Get the PO Number from ac_container
swc_get_element ac_container 'PONUMBER' l_ebeln.
IF sy-subrc EQ 0.
SELECT SINGLE ernam FROM ekko INTO l_user WHERE ebeln EQ l_ebeln.
actor_tab-otype = 'US'.
actor_tab-objid = l_user.
APPEND actor_tab.
ELSE.
RAISE nobody_found.
ENDIF.
ENDFUNCTION.
And finally, below are the contents of the ac_container itab from debug
mode.
ELEMENT TAB_INDEX ELEMLENGTH TYPE VALUE
PONUMBER |000000 |000 | |4800000013
A single step through the statement
swc_get_element ac_container 'PONUMBER' l_ebeln.
returns an sy-subrc of 4 and l_ebeln is not filled. '
PONUMBER' is the name of the container element on the rule and it has
the same type as l_ebeln.
I am stuck now, can anybody help?
Thanks,
Henry.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20060802/9dc48aa4/attachment.htm
More information about the SAP-WUG
mailing list