cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

using the Check Function Module in SWETYPV

jagesh_lakdawala
Active Participant
0 Likes
3,398

Hi Experts,

I have designed the PR Release workflow and it is working fine.

I want to restrict the execution of the workflow when PR is incomplete.

For achieving this, I have created one FM and assigned it to the workflow as check function module in Transaction SWETYPV.

Inside the FM, I have return the custom logic that if PR is incomplete than workflow should not trigger as shown below.

IF EBAN-MEMORY EQ 'X'.  "means incomplete

     RAISE NOT_TRIGGERED.

ENDIF.

this is working fine but the I observed in SWEL transaction it appears with Red error mark.

so just I am wondering is this the proper way for restricting the workflow execution under certain conditions.

please suggest.

Regards,

Jagesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi ,

Check Function module is the most optimal way to restrict the workflow from getting triggered as it is called even before executing the Receiver Function Module , thereby making sure even linkage is not determined .

The error mark in the SWEL is normal as the right exception is raised .

regards

Raghu

Answers (3)

Answers (3)

former_member227140
Active Participant
0 Likes

Hi,

if I understood your problem correctly, you can achieve same thing using start condition in header of workflow.

you have to delegate standard business object , create a attribute in BO , you can create a char1 type attribute , if PR is incomplete then set this to 'X'.

you can use this attribute to put start condition in workflow header.

roopashree_v2
Explorer
0 Likes

Hi Jagesh

You can find the solution for your problem in this thread.

However, your check function module should be like this.

if EBAN-memory = space

raise not_triggered.

endif

Regards,
Roopa

jagesh_lakdawala
Active Participant
0 Likes

Hi Roopa,

I double clicked on the exception line in SWEL and found the message as "check FM ends with exception" and it is very obvious reason is the usage of RAISE statement inside the check FM,

so whatever condition we write, usage of this RAISE is going to cause this Error in SWEL.

is there any other way by which we can prevent the workflow execution and at the same time we don't get any such error in Event Log SWEL.

Regards,

Jagesh

roopashree_v2
Explorer
0 Likes

Hi Jagesh,

Well, it is a standard  behavior for PR and PO as described in the thread.

It doesn't depend on the code in the Check function module. I just mentioned it since you copy pasted the code as well.

It is absolutely fine if you get this error message in SWEL

If you are so certain that you don't want any error message in SWEL, try writing this condition in start condition in workflow header-> basic data.

Regards,

Roopa

anjan_paul
Active Contributor
0 Likes

Hi,

Double click on the line and check what is the error