cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Fiori - Approve Leave Request (Version 2) issue

Former Member
0 Kudos

Hi Experts,

I have a problem with my SAP Fiori App "Approve Leave Requests (Version 2)".

The app opens without any problem and all work-items are displayed.

But if I want to approve or reject the request of leave, an error pop-up appears and says "User decision 000005111282 has no alternative to index 0000"

Our workflow differs a little bit from the SAP standard workflow. We added a user decision, where the workflow waits for the decision in the SAP Fiori App. 

In the SAP Fiori My Inbox App the approval/rejection of the request of leave works without any problems.

Have you any ideas?

Thank you!

Best regards,

Maximilian Haala

Accepted Solutions (0)

Answers (1)

Answers (1)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Maximilian,

I'm a little confused about what you are doing with that extra user decision?  Approval/Rejection should behave the same regardless of which inbox you are in.  There shouldn't be a need to wait for the Fiori approval...unless you have a competing way that the leave requests can be approved.

Or are you trying to add additional levels of approval? (In which case just adding it in the workflow may not be enough - it still needs to respect the leave request application behaviour).

Can you clarify what you are trying to achieve?

From a workflow perspective... do you mean that have you have added an extra user decision before? or after? the approval?

What answers (i.e. decision keys) have you added to your user decision?

Every user decision is a question with a selection of answers. The way I would read that error message is either:

a) the system can't work out what are the answers on your user decision - I assume it's not that otherwise it wouldn't work in My Inbox

b) there are answers but the system can't work out which one to choose - which would you mean you are somehow processing the user decision in background?

c) by adding a user decision it's possible the approve requests app can't interpret whether the request has been correctly approved or rejected, because the expected values aren't being set in the workflow &/or on the leave request. This is the most likely situation.

Fiori My Inbox automatically converts user decision answers into buttons which is why the user decision would work... but that doesn't necessarily mean the leave request is being approved or rejected as that would need to be handled separately.

It would help to know what if any impact on the workflow you are seeing in the workflow log.

Rgds,

Jocelyn

Former Member
0 Kudos

Maybe I didn't explain that well. I made two screenshots of the standard workflow and our specified workflow, so you can understand the situation better.

After the approve with the My Inbox App the Leave Request is also in backend approved. So the approvement works. Only the "Approve Leave Requests" App don't works.

standard:                                                            

our workflow:

    

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Ok ... so working my way slowly through the German I take it that you have replaced the standard approval step with a user decision approval step?

Which is fine from a workflow perspective and explains why the workflow works.

The problem is most likely that Approve Leave Requests isn't looking at the workflow but more likely at the leave request status as per the configuration in transaction PTARQ... That would be my guess anyway based on what I've experienced with the wonderful world of leave requests before.

So my suggestion to fix this would be as follows:

  • For the Approve Leave Requests app, identify the OData service and method that performs the approve/reject
  • Redefine it using the usual OData extension options so that instead of performing the standard approve/reject, it instead updates the work item. 
    • So you'll need to find the work item related to the leave request (the PTARQ header table holds a reference to the top level workflow id as I recall - and you should be able to find the specific work item from that using the WAPI function modules)
    • And then complete the user decision using the appropriate key e.g. by calling SAP_WAPI_DECISION_COMPLETE or similar
    • Map the response back to whatever the standard approve/reject expects as a response

In other words, you need to adjust the behaviour of Approve Leave Requests so that it approve/rejects via the workflow instead of with the standard PTARQ approval.

Before you get going though... my question would be whether the custom workflow was changed prior to the Fiori app being introduced or as a result of the Fiori app being introduced?

If your custom workflow already existed before you introduced the Fiori app then that's fine.. you just need to adjust the app behaviour to match. 

But if you changed your workflow to try and make the Fiori app behave differently... that may not be the best approach... generally it's better to look at what the extensibility options on the Fiori app give you first and see if there's another alternative.  I'm not saying there is definitely a better way as I don't know the Approve Leave Requests app intimately.... just wanting to make sure that the relevant due diligence has been done at your site.

Former Member
0 Kudos

Thanks for the explanation!
I will try to fix the problem in the next days. If it didn`t work I would like to get in touch with you here again, because I write my diploma project about SAP Fiori and SAP is still knew for me