Agent Determination - Rule - Function Module
vijay srikanth
vijay_d15 at hotmail.com
Wed Aug 2 04:52:54 EDT 2006
Hi Henry,
Try declaring l_ebeln like this:
DATA : ebeln like swcont-value. (instead of type ebeln).
Regards,
Vijay
>From: "Lowe, Henry" <henry.lowe at logicacmg.com>
>Reply-To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
>To: <sap-wug at mit.edu>
>Subject: Agent Determination - Rule - Function Module
>Date: Wed, 2 Aug 2006 09:38:34 +0100
>
>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.
>_______________________________________________
>SAP-WUG mailing list
>SAP-WUG at mit.edu
>http://mailman.mit.edu/mailman/listinfo/sap-wug
More information about the SAP-WUG
mailing list