'How to' Workflow Macro Question

Dart, Jocelyn jocelyn.dart at sap.com
Tue Jan 18 19:57:26 EST 2005


Hi Raul, 
Firstly - I would always use Start Conditions (the new technique) in
preference to check function modules (the old technique).  If the
conditions are seriously complex I sometimes use a virtual attribute to
work out the hard part,e.g. "ApprovalReqd" yes or no, and then include
that in my start condition.  Just a thought for another possible
approach - but you know your scenario best. 

Secondly - to call an instance independent method, first create a dummy
object handle using the 
SWC_CREATE_OBJECT <object> <objecttype> <objectkey>
statement but putting initial values e.g. space in your object key. 
You can then call your instance independent method correctly.

Regards,
Jocelyn  

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Michael Pokraka
Sent: Tuesday,18 January 2005 8:16 PM
To: SAP Workflow Users' Group
Subject: Re: 'How to' Workflow Macro Question

Hi Raul, 
Good question, something I've not had to do yet. Let us know if you find
out.

However, a more elegant solution may be to use an attribute instead, and
evaluate that via start conditions. Either move the methods into attribs
or
create a new one that calls the methods - depends on your design. 

This also makes it possible to move any potential hardcoding out of your
ABAP
and into the condition; and the whole thing is easier to maintain and/or
add to
in future. 

Cheers
Mike

--- "Rivera, Raul" <Raul.Rivera at absu.accenture.com> wrote:

> Hello everyone,
> 
> We are in 4.6c
> 
> I am revising an existing custom workflow by moving most of its
complex
> start conditions from the workflow to a Check Function Module (FM). 
> 
> The 'start conditions' were built as a series of tasks and conditions
in the
> WF that terminate the WF if a condition isn't met. As such, I would
like to
> REUSE the existing BOR methods in the Check FM.
> 
> One such method is an instance INdependent synchronous method. For
testing
> purposes, I create an instance of the object, set the import parameter
value
> and then execute the method (see the code snippet below). This
approach is
> ugly but it does give me the expected result.
> 
> My question is
> 
> 	How do you call an instance independent method from your check
FM
> without creating an object instance? 
> 
> 
> 
>       SWC_CONTAINER container.
>       SWC_CREATE_CONTAINER container.
> 
> *     create an object instance
>       SWC_CREATE_OBJECT workItemObj 'WORKITEM' '000000599006'.
> 
> *     set the import parameter
>       SWC_SET_ELEMENT container 'Agent' initiator.
> 
> *     execute the BOR method
>       SWC_CALL_METHOD workItemObj 'ZGETAGENTORGUNIT'
>                       container.
> *     read method export parameter
>       SWC_GET_ELEMENT container 'ErrorFlag' errorFlag.
> 
>       IF errorFlag EQ 'X'.
>         RAISE DO_NOT_START_WF.
>       ENDIF.
> 
> Regards,
> Raul Rivera
> _______________________________________________
> 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



More information about the SAP-WUG mailing list