Agent Determination - Rule - Function Module
Lowe, Henry
henry.lowe at logicacmg.com
Wed Aug 2 10:22:54 EDT 2006
This has been resolved now so no further help required. Couple of emails
explaining things below:
--- "Lowe, Henry" <henry.lowe at logicacmg.com> wrote:
> Bob,
>
> Thanks for that. It is exactly the same.
>
> Strangely the whole thing is now working. This is since I found
> instructions in the WUG archive describing how to populate the
> ac_container table in full in order to test in PFAC or SE37. I ran
> this test once and since then the whole thing has been working.
>
> I am new to the WUG and just need to check if there's anything I need
> to do to get these messages on there and declare this topic as
> resolved.
>
> Thanks,
>
> Henry.
>
> -----Original Message-----
> From: Bob Tan [mailto:tanbobby at yahoo.com]
> Sent: 02 August 2006 10:37
> To: Lowe, Henry
> Subject: Re: Agent Determination - Rule - Function Module
>
>
> Make sure the container name is exactly the same
> (cap
> sensitive) as how you have declared it in the rule.
>
> For example, if you have named it 'PONumber', then
> your code should also use the same.
>
> swc_get_element ac_container 'PONumber' l_ebeln.
>
> Good luck.
________________________________
From: Lowe, Henry
Sent: 02 August 2006 09:39
To: 'sap-wug at mit.edu'
Subject: Agent Determination - Rule - Function Module
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/ba0f6683/attachment.htm
More information about the SAP-WUG
mailing list