Hi all,
What I want to do is to call a method (or write a method somewhere in workflow) to check somedata (e.g. manager of some user, or maktx of some material, just a simple method) and check whether the workflow should execute or not using the output of this method.
I'm not sure where should I write or call this method in workflow. Anyone help me about this ?
Thanks.
Request clarification before answering.
Hi,
Also consider using check function module in event linkage SWE2. The check FM gets executed before starting the workflow. You can put any condition in it, if condition evaluates to false and you do not want to trigger the workflow, simply raise an exception in this FM and workflow will not trigger.
http://saptechnical.com/Tutorials/Workflow/checkfunctionmodule/demo.htm
Regards,
Ibrahim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't use a method, create an attribute for the object and then add a starting condition to check that attribute (transaction SWB_COND) https://help.sap.com/saphelp_erp2004/helpdata/en/4c/86bf43feca11d2a64f0060087a79ea/frameset.htm).
You can also add more complicated checks in a check function module and link it via transaction SWE2 (Function Modules for Processing Events (SAP Library - Embedded Processes (SAP Business Workflow)), but usually the an attribute work well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ronen,
SWB_COND is different from the condition screen which is inside the workflow screen. Because I can just add controls with checking something inside Purchase Requisition such as, Release Code = 50, Requisitioner = "SOMEONE" etc.
I have to write some code which is totally irrelevant to Purchase Requisition. Can I do this with SWB_COND ? I clicked new condition and see this screen. Then I click the line which I highlighted below, nothing happens
1. you should get a screen similar to the IF conditions in the workflow. the purchase requisition object for your workflow should be BUS2105 (or BUS2009 for PR items) not EBAN. maybe that's the problem.
2. The code could be placed in the object attribute. there is no problem to create an attribute not relevant to the PR. you can write what you want - it's ABAP.
3. you can also use SWE2 (the second option I wrote) and then it's a regular function module.
4. using a method to check the data and cancel the workflow is possible but less recommended - it's better to not start the workflow at all.
Maybe consider bringing in an someone more experienced to help you get started?
anyhow, here are a few explanations:
Tutorial: Workflow Programming (SAP Library - Business Task Management)
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.