cancel
Showing results for 
Search instead for 
Did you mean: 

Validation on Execution of workitem

Former Member
0 Kudos

Hi all,

I have a scenario in which a workitem with expense value 7000$ has gone for approval to manager1 in his UWL. Manager1 can approve expense upto 10000$ But when this workitem was created Manager1 has gone on leave and he has substituted Manager2 for this approval. Manager2 has limit of approving expenses only upto 5000$.

So what I want is when this Manager 2 click on approval of this workitem in his UWL the validation should happen and it should give Manager2 an Error message that ' 7000$ is higher than your approval limit' and workitem should not get executed and should remain in Manager2 UWL so that later when Manager1 comes Manager2 can forward this workitem back to Manager1

How to do this...should i do this validation in my BO method then how to throw error in UWL screen. else if this validation is to be done in JAVA or ABAP Webdynpro of UWL or any other way to achieve this...

Thanks in advance..

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Patrick ...i will definately tell if i find some crack in this...thanks a lot for helpful answer....

imthiaz_ahmed
Active Contributor
0 Kudos

Alternatively, you can make sure that your approval step has the proper Roles assigned and not declared as "General task". The users should be given proper roles.

Regards, IA

vijy_mukunthan
Active Contributor
0 Kudos

Hi michell

For what scenario your are trying to do this. All the BADI are directly connected to portal. So my best advice is write the logic in the BADI where you can through error which will display in the portal. If you could tell for which scenario i could tell the badi are u using travel or what else.

Regards

vijay

Former Member
0 Kudos

Best option will be to search the BADI and check the amount logic inside it.You can easily raise the error and pass the same to return parameter of badi which will be automatically displayed on portal.

Former Member
0 Kudos

hi Vijay,

sorry for late reply...the workflow is travel request approval WS20000050 and the validation is to be put in User Decision step TS20000118...can u just guide how to put validation...

bpawanchand
Active Contributor
0 Kudos

I think you can make use of the Program Exits in workflow , as per your scenarion when ever a woekitem is executed you want to validate a container element , then i think you have to try with the Program exits tab.

Former Member
0 Kudos

Michell,

As mentionned by Pavan, you can use a program exit for this. Look at the decision step in your workflow, tab Program Exit. Since you need to add something there I suggest you do a copy of the standard wf and use that one instead of the standard directly

There is a serious downside to this when using UWL however: the nice and sexy Java Webdynpro provided with the portal and used by default to handle decision tasks does not handle the program exits. That means you need to change the configuration of your UWL so that it calls the GUI decision screen instead of the WD.

I faced exactly the same issue in the same process and copntext (i.e. travel management wf in UWL), and that's the only solution I found for this. The other possibilities are too far from the SAP standard functionality, i.e.

- Changing the decision java WD

- Creating a task (including an object method and maybe a WD or BSP application) on your own in which you integrate the check on the approval power, and in the workflow replace the standard decision by that task.

I even opened a message to SAP support about the fact that their UWL decision WD does not support program exits. After months of frustrating discussions I have got the standard answer that "this works as designed". I have a development request opened at SAP since almost a year, with no feedback so far.

Hope this helps. In any case, I would really appreciate if you could post here what solution you end up with.

Thanks and regards,

Patrick

Former Member
0 Kudos

Hi Michell,

You can validate the same in your JAVA or ABAP Web dynpro in Initialization itself and throw error.

You can use transaction SWIA to forward the same to previous manager