cancel
Showing results for 
Search instead for 
Did you mean: 

Error in executing workflow service

Former Member
0 Kudos

Hi All,

I have followed this blog to consume workflow service and take decisions on workitems. Everything was fine except the last step. When I execute application URL with apply decision i am getting following error.. Please help me to resolve this.

Thanks,

Suman

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi Suman,

Only the workflow items which are in status "STARTED" or having status text as "In Process" will be processed.

   

    

<d:status>STARTED</d:status>

<d:status_txt>In Process</d:status_txt>


s Now you can go to worflow inbox and execute workflow item and then click on back button without approve/reject. same is explained in step 12 of page 12 in the blog
e Once your workitem is in STARTED status, you will be able to approve it.
  Regards,
  Chandra
nabheetscn
Active Contributor
0 Kudos

Hi Chandrashekhar Mahajan

First of all thanks for the wonderful contribution you are making to the community.

Few of my doubts related to your post above..

Why do we need to have it in STARTED/In process status..? There is no benefit of it at all if we will have to first make the workitem in process. 

I think the issue has more to do with

  • First whether OP sees the workitem in his inbox SBWP if yes then only he can proceed.
  • Secondly does he has the right authorization.
  • Thirdly he might have missed some step

@Suman: Can you please put a debugger in the BADI method and see what is the issue if it stops their.

Nabheet

Former Member
0 Kudos

Hi Chandrashekar,

All my workitems are in READY status. I was seeing workitems and data in WorkFlowTaskCollection. i am getting above error when I am trying to apply decision using the URL below as mentioned in the Blog. I hope you also used same blog and built andriod app for consuming workflow service.

http://portaddress/sap/opu/odata/IWWRK/WFSERVICE/ApplyDecision?workitem_id='000017240572'&dec_key='0... absence is approved'

I am not sure what went wrong I followed each and every step of blog.

I saw SU53 for authorizations very immediately after i execute the URL. But it was saying all authorizations are successful.

I want to check with is there anything I have to do with subscription setup from gateway to backend. Please let me know what steps you have followed when you implement this blog for android application.

Thanks,

Suman

nabheetscn
Active Contributor
0 Kudos

Suman did you a put a break point in your method at ABAP and was the oData call made..?

Nabheet

ChandraMahajan
Active Contributor
0 Kudos

Hi nabheet madan

I recreated this issue in my system and I was also getting same error.

On further debugging, I found that the error comes from class /IWWRK/CL_WF_READ_WORKITEM in the method READ_ITEM_VALIDATION.

Internal table mt_wi_wapi_agents is read with sy-uname.

This internal table  mt_wi_wapi_agents is getting filed by FM SAP_WAPI_GET_WI_AGENTS in other method within same Class.

I checked with below workflow id which are there in my inbox. 2 are in In Process status and one is in Ready status.

so the items which are in 'In Process' status will get approved as per standard logic. and to make the item which is in Ready status to In process, We need to execute it in SWBP inbox and then need not to approve/reject as mentioned in earlier response.

I do agree with you that even items which are in Ready status should be processed without error but this is how the validation logic is there in standard method.

Regards,

Chandra

ChandraMahajan
Active Contributor
0 Kudos

Hi Suman,

As mentioned in earlier response, just make the items in "In Process" status.

Regards,

Chandra

Former Member
0 Kudos

Hi Nabheet,

Yesterday I tried to debug from application but debugging was not triggering. I am rechecking it now. I will update you once I am done.

Thanks,

Suman

Former Member
0 Kudos

Hi Chandra,

Thanks for your suggestion I will change the status and test the application once again.

Regards,

Suman

Former Member
0 Kudos

Hi Chandra,

I changed status from READY to In Process but still i am getting the same error. Also I am not able to debug as well. I kept the external break-point in classes implemented for absence get details and absence decision but none of the break points were triggered.

I have 3 workitesm in my inbox 1 is in READY status and other 2 are in 'InProcess' status. Here the strange thing is I am getting only one workiem in WorkFlowTaskCollection which is in READY status I am not getting remaining two items in WorkFlowTaskCollection. But for applying decision I tried with workitems which are in 'InProcess', still getting same error. Let me tell you how I am testing.

1. I select the service and clicked on gateway client from service maintenance.

2. Select POST method and entered this URL in URL section and clicked on execute.

sap/opu/odata/IWWRK/WFSERVICE/ApplyDecision?workitem_id='000017240572'&dec_key='0001'&comments='Your absence is approved'

3. Getting error in response screen.

Please let me know if I am missing anything while executing. Also tell me how to debug.

Thanks,

Suman

Former Member
0 Kudos

Hi Nabeet,

After execute the application the break point is not triggering. I kept external break point for my user id however it is not triggering. Can you please tell me how to debug the application.

Thanks,

Suman

ChandraMahajan
Active Contributor
0 Kudos

This is strange. For /WorkFlowTaskCollection, I am getting all workitems which are in 'In Process' and 'Ready' status.

Can you put external breakpoint in the methods which I mentioned in above reply? Please try with that and check where it is failing for approval.

Regards,

Chandra

Former Member
0 Kudos

Hi Chandra,

I kept the external break-point with my user id in the method READ_ITEM_VALIDATION but break-point is not getting triggered. Also getting same error after execute the URL.

Is it possible can we meet online to show you the issue in our system.So that you can help us to identify the issue. I have been trying to solve this issue for long time.

Please let me know so that I will share meeting details.

Thanks,

Suman

nabheetscn
Active Contributor
0 Kudos

Hi Chandra

Looking at the screen shot i understand the reason. Actually the workflow is sending the workitems to SAP userid as it is classified as general task but no approver is found. The moment you execute one it gets reserved under you name. So the two tasks which you have found with your name are those and if you look at the READY status task it does not have any approver(since it is in everyone inbox) it does not allow you to process it. Simple solution is to correct the workflow agent determination logic

Just to add i was successfully able to implement this approval stuff without the need of making my workitems from Ready to In process because of the reason mentioned above.

Thanks

Nabheet

Former Member
0 Kudos

Hi Chandra,

I was able to debug the issue and identified that agents are not getting determined from FM SAP_WAPI_GET_AGENTS for workitem. When i check the sy-uname it is taking admin user(GW_ADMIN) not my user id hence getting the error.

However when i tried to execute the FM standalone with workitem id and my user name I am not getting entries in agents table. I am not sure why is it so.

Now the problem is identified but not getting how to resolve this issue. Only possibility I am thinking is I have to login with admin credentials and create workitem and execute the application. Can you tell me is there any other possibilities we have.

Thanks,

Suman

Former Member
0 Kudos

Hi Nabheet,

Thanks for your suggestions. I think you made agent assignment as normal instead of general task. Am i correct. Please let me know what steps you have followed.

Thanks,

Suman

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Suman,


When i check the sy-uname it is taking admin user(GW_ADMIN) not my user id hence getting the error.

Please double check the system alias for the service and the RFC destination setting. You might hard code GW_ADMIN user in RFC logon information.

Regards, Masa

SAP Customer Experience Group - CEG

nabheetscn
Active Contributor
0 Kudos

Hi Suman

Simply your issue is with agent assignment. In my case i have kept the WF initiator as the creatore and approver. Make the below mentioned changes in worklfow task. Admin id is working becoz administrator has the authorization to process items for whom we dont have approver. Do as shown below. do it for step 48 and 87 same in document. After activating just execute tcode SWU_OBUF and press button syncronize

Thanks

Nabheet

Former Member
0 Kudos

Hi Nabheet,

I did changes as you mentioned and it is working fine in Gateway Client. I was able to apply decision and complete the workitem from gateway client but when I try to execute from android application I am getting Http error. I am not sure what went wrong.

I deleted existing application from eclipse and recreated but still getting same error. Even I checked with InProcess workitems as well but no luck.

Can you please help me how to resolve this. Please check the screen shot below.

Former Member
0 Kudos

Hi Masa,

I have double checked the system alias and RFC destination with our BASIS consultant and alias given for service. There is no issue with that. But as you said we have harded coded GW_ADMIN user in RFC logon information.

I am able to execute the application from Gateway Client but not able execute the same workitem from andriod application. Can you please help me to resolve this issue.

Thanks,

Suman

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Suman,

Please try with RFC destination like LOCAL which does not have any user and password.

Regards, Masa

SAP Customer Experience Group - CEG

Former Member
0 Kudos

Hi Masa,

If we make the destination as LOCAL and if we execute the application from android application then RFC connection will fail. Please advice. However I will try it once and will update you.

Thanks,

Suman

masa_139
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Suman,

Did it work from Gateway client?

Where are workitems stored? on Gateway or on ERP?

Regards, Masa

SAP Customer Experience Group - CEG

Former Member
0 Kudos

Hi Masa,

Yes it worked from gateway client with the following url submitted in gateway client.

http://......./sap/opu/odata/IWWRK/WFSERVICE/ApplyDecision?workitem_id='000017240572'&dec_key='0001'...'


But when I tested it from andriod application after consuming the workflow service getting Http error when I click on Approve button in mobile application.


The workitems are stored on ERP.


Please help me how to resolve this issue.


Thanks,

Suman

nabheetscn
Active Contributor
0 Kudos

What exactly are the error details please share with us

Former Member
0 Kudos

Hi Nabheet,

When I click on approve button I am getting Http Error on screen like below. This Image I already posted earlier. But getting the error when I go back check the error log(/iwfnd/error_log) I don't see any errors. I am not sure how to troubleshoot this. Is it possible can we meet once to show you the issue.

ChandraMahajan
Active Contributor
0 Kudos

Hi,

Under LogCat window, you can see the error log. check what kind of error details are you getting.

Regards,

Chandra

P.S - you can check my blog where I explained about LogCat.

Former Member
0 Kudos

Hi Chandra,

Thanks for your reply. Please find the log of the application below. I see that the URL for posting is perfectly populating but seeing error 403 not sure what is missing here. Can you please tell me what to do to resolve this error.I am thinking that after seeing the log there might be something issue with Http header or authentication but not sure what kind of authentication it is looking for.

Thanks,

Suman

ChandraMahajan
Active Contributor
0 Kudos

Hi Suman,

I checked with LogCat for my application. I got http code 200 i.e successful and able to approve the workitem. then I kept my application idle for sometime and then tried to approve 2nd item for which I got HTTP error with status code 403.

Hence I guess because of timeout, I may have got this error 2nd time but for your case I am not sure if it is because of timeout or authorization. I will suggest you to again start AVD (android virtual device) emulator and try to approve the workitem.

AVD is very huge application and most of the time it takes time to open and launch the Android application. and yes sometime even I got HTTTP error while approving workitems.

Regards,

Chandra

Former Member
0 Kudos

Hi Chandra,

I agree with you but here AVD is already launched and application is executing. Only the final action was failing. Maybe there is issue for POST method i am not sure.

I need to develop some mobile application consuming workflow service. If not android can we do with iOS application. I have developed iOS application during very initial days of netweaver gateway before GWPAM. Can you advise me how to develop iOS application now to implement workflow service. Lets try that way as well.

Thanks,
Suman

ChandraMahajan
Active Contributor
0 Kudos

You can try out iOS application based on this blog

This is possible with GWPA plugin.

Regards,

Chandra

former_member206574
Active Participant
0 Kudos

Hi,

I am facing the same error.

Here I am applying decison on Workitem id 000001895997, but it is showingWork item 000001895995 cannot be read..


can you please help to sove this issue


Regards,

Venu

Former Member
0 Kudos

Hi Chandra,

We recently refreshed our system hence I have to rebuild the application. I did implement as is given in the blog. When I execuet the service I am getting error "Error in worklist determination for user GW_ADMIN". Please see the screen shot below. can you please help me to resolve this issue.

Thanks,

Suman

0 Kudos

Hi Suman ,

               I am trying  to   consume sap  leave  request approval workflow  in  gateway service ,but  i am  not  able execute  workitem .

/sap/opu/odata/IWWRK/WFSERVICE/ApplyDecision?workitem_id='000001405655'&dec_key='0001'&comments='Your Absence Approved'

0 Kudos

Hi Chandra,

                     I am new  to workflow,  i don't  have an  idea how  to consume  custom  workflow  in sap  gateway service ,please   guide me.

Regard

praksh

vishnucta
Active Participant
0 Kudos

Hi Prakash,

try these links,

Regards,

Vishnu

Answers (2)

Answers (2)

0 Kudos

Hi Vishnu,

                 Thanks  for  response.

vishnucta
Active Participant
0 Kudos

there will be two namespaces one for hub system and other if there is no hub system.i.e in  document there will be two separate url for the above two cases.

Regards,

Vishnu