cancel
Showing results for 
Search instead for 
Did you mean: 

functional method not evaluated in wf start condition

former_member185998
Active Participant
0 Kudos

I want to extend an existing (and working) start condition with a functional method of a custom BOR object. However, it seems that the functional method is not evaluated when the event is triggered, so the workflow is started even if conditions aren't met.

The workflow is started with event FIPP-ASSIGNED (available through delegation from custom BOR object ZOKU_FIPP). The existing start condition checks for the company code. I added a new functional method to it.

The functional method is defined as a synchronous method with some ABAP for additional checks.

I have tested that the start condition works fine when I test it in the condition editor with proper test data.

I have also tested using the corresponding functional method as a separate step in the workflow. It is called and works correctly then. However, I checked with debugging (an eternal loop + SM50) that the functional method is not called from the start condition when the event is triggered.

What am I missing?

Accepted Solutions (1)

Accepted Solutions (1)

anjan_paul
Active Contributor

HI,

It is correct, your functional method will not call. Simply adding a method in BO will not call internally. You have to use it in TASK.

For your requirement you can use Check FM in Event linkage. You can find lots of document in SAP SCN for that.

former_member185998
Active Participant
0 Kudos

Thanks for the tip Anjan!

I don't agree with you that the method should/would not call, but thanks to you, I reinvestigated and noticed a silly typo that prevents the rule from executing. Unfortunately, even after correcting that type, the method is not called.

The typo was that I had chosen the attribute IsParked into the rule, but my method is called IsDuplicate. Didn't notice that even though I took the screen prints for my original post.

Why I think the method should be called: we have configured the FM SWB_2_CHECK_FB_START_COND_EVAL into the event linkage. See note 2146464 for instance. The function module interprets the start conditions maintained with the condition editor (above). I debugged the function with suitable input parameters, and I see that it is evaluating the specified start condition with company codes and the function module.

I set a breakpoint into my functional method, and use the test tool in the condition editor. The method is called.

However, when I call the function SWB_2_CHECK_FB_START_COND_EVAL with appropriate input parameters, the method does not get called. Instead, the function call returns an error indicating that it couldn't interpret the conditions. I'm not sure how seriously I should take that, as the condition editor confirms that the condition is correctly formed.

Answers (5)

Answers (5)

0 Kudos

Hi

I Achieved this functionality. Below are the points which i want to share.

1. i created a Custom FM and Kept the logic in it .

2. Went to SWE2 and in the event linkage placed that Custom FM.

3. Its mandatory to put the Exception along with your Condition (With respect to your scenario).

if sy-subrc eq/ne 0.

Raise Any Exception.

endif.

This code has inserted according to my requirement and i got my requirement fulfilled.

Thanks & Regards

Sri Ram

0 Kudos

Hi

Even i tried to put the Check FM in Event linkage but it doesn't triggered and i couldn't able to meet the requirement as well. Can some one suggest how to put the Custom FM in Event linkage so that Check condition could get activated there

Regards

Sri Ram

former_member185998
Active Participant
0 Kudos

I agree with Pavan that I should be able to use functional methods. Unfortunately, it doesn't work. So I ended up evaluating it as a separate task, as I had tried and Anjan confirmed.

bpawanchand
Active Contributor
0 Kudos

Hi,

You can use the functional methods same as how you use your container elements in the binding definition. check this blog.

Thanks,Pavan

former_member185998
Active Participant
0 Kudos

This post also gave me the idea to create a suitable check function module. Still, I'd rather not do that, as I'd need to incorporate the existing company code checks as well. The start conditions should be a flexible tool for adding rules, and it's more transparent to superusers.