'How to' Workflow Macro Question
Michael Pokraka
workflow at quirky.me.uk
Tue Jan 18 04:16:19 EST 2005
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
>
>
More information about the SAP-WUG
mailing list