Agent Determination - Rule - Function Module

Kjetil Kilhavn KJETILK at statoil.com
Wed Aug 2 06:36:16 EDT 2006


Have you tried, when single-testing, to specify the type and length of the parameter you add to AC_CONTAINER? Or even adding a line of code to store the container value before trying to read it back?

If you have more than one element in AC_CONTAINER, make sure they are sorted. I went in that trap once, filling the container with append statements instead of SWC_SET_ELEMENT statements. Took days and assistance, from this very group if I recall correct, to figure out what the problem was.
-- 
Kjetil Kilhavn, Statoil ØFT KTJ BAS DEV SAP

 

> -----Original Message-----
> From: sap-wug-bounces at mit.edu 
> [mailto:sap-wug-bounces at mit.edu] On Behalf Of vijay srikanth
> Sent: 2. august 2006 10:53
> To: sap-wug at mit.edu
> Subject: RE: Agent Determination - Rule - Function Module
> 
> 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
> 
> 
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
> 


-------------------------------------------------------------------
The information contained in this message may be CONFIDENTIAL and is
intended for the addressee only. Any unauthorised use, dissemination of the
information or copying of this message is prohibited. If you are not the
addressee, please notify the sender immediately by return e-mail and delete
this message.
Thank you.




More information about the SAP-WUG mailing list