ABAP-OO Workflow: _WI_RESULT not shown, no outcomes

Dart, Jocelyn jocelyn.dart at sap.com
Thu Dec 4 18:14:12 EST 2008


Florin, 

Ok this is one of those areas where ABAP OO has some minor undocumented
features ... Mostly I believe these are due to a stricter interpretation
of object-oriented behaviour with ABAP OO than we had with BOR, by
removing or avoiding BOR peculiarities. 

The use of _WI_OBJECT and _WI_RESULT in ABAP OO task for bindings should
be ignored/avoided.

For example you will note that when you add an ABAP OO task to an
activity step, you can bind forward from your workflow container to
_WI_OBJECT but the binding back from task _WI_OBJECT to the workflow
container doesn't actually return a value.  You've already discovered
the behaviour with _WI_RESULT.

Instead you should:
A) Use explicit parameters  - e.g. if I need to return an object
parameter I call it EO_<object> or similar and bind that rather than use
_WI_OBJECT to return a value
B) Instead of using "_WI_RESULT" outcomes you simply add a Multiple
Condition step afterwards.  This actually gives you greater flexibility
as you have the choice of "Case" or "Switch" so that if you need to
combine values into a single outcome you can do this readily.

As explained in the SDN blogs, the RETURNING parameter can be used if
you want to call a functional method directly in a binding - i.e. not as
a task.   In which case the returned value is the value passed in the
binding.   Although as you can see from the blog comments this needs to
be simplistic as passing dynamic parameters to the functional method in
a binding is problematic.

Generally in ABAP OO you will find that the only reason for retaining
the _WI_OBJECT is to indicate the main object of the task, and
_WI_RESULT is not used at all. 

You can still have multiple outcomes from a ABAP OO task of course -
e.g. where the task has multiple terminating events.

Hope that helps. 

Regards,
Jocelyn  

-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Florin Wach
Sent: Friday, 5 December 2008 3:05 AM
To: SAP Workflow Users' Group
Subject: ABAP-OO Workflow: _WI_RESULT not shown, no outcomes

Hello Wuggies,

I'm a bit of frustrated that something in the editor seems not to be
working, so I wonder, what's wrong here:

I have declared a functional method in an ABAP Class based on
IF_WORKFLOW. Let's name it "Decision" for the moment.
This method has on RETURNING parameter, based on a data element that is
based on a dictionary domain having three fixed values:  A B and C.
(Single characters).

No, when you create a task, based on that functional method, it
generates container element, where the element DECISION has that
specially curled arrow arround that sqare box, showing that this is a
result parameter. So making the dataflow between task container <->
method container is working fine.

When putting this task into a workflow pattern, the only thing shown as
outcome is  "Step executed" ... and not, which I'd expected, the
outcomes  A, B and C.

Now back in the task definition, I went to the container tab and used
the super-special-button "Create result element", that comes up with a
dialog, generating a  _WI_RESULT  ... This seems to be okay. The message
says  "Result element created", but actually it isn't shown in the task
container.
A few tries up, down, left and right brought me to the point that I
finally had a container element _WI_RESULT referring to that data
element I'd use.

The workflow still doesn't offer additional outcomes, only "Step
executed".

When editing the task again in change mode, that element _WI_RESULT has
disappeared.


We're on ECC 6.00 SAPKB70014


Did ANYONE ever has successfully used functional method with
workitem-result based on fixed domain values??


Thanks for any ideas,
   Florin
_______________________________________________
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