cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to open Custom WDA in UWL of SRM Portal

former_member187651
Active Participant
0 Kudos

Hello Gurus,

I am trying to configure a custom workflow in SRM where I need to open a WDA link with some parameters passing to it. I have made the configuration in Tcode: SWFVISU as said in many SDN links but still not able to open the link with click on work item in the work list of user.

Its says: Invalid to perform action because system return invalid URL. Here I am opening the link from a FM created in "ZbusinessObject". Please let me know where I am missing..

Regards,

Chandan

Accepted Solutions (1)

Accepted Solutions (1)

former_member187651
Active Participant
0 Kudos

Dear all,

with some changes in configuration I am able to open WDA through Work Item. Here I am using FM:  SAP_WAPI_WORKITEM_COMPLETE  to complete the WI while click on Confirm button on WDA.

******************************************************

l_cont_line-element = 'COMMENT'.
l_cont_line-value = 'hello'.
append l_cont_line to l_cont.

l_cont_line-element = '_RESULT'.
l_cont_line-value = '0001'.
append l_cont_line to l_cont.

l_cont_line-element = '_WI_RESULT'.
l_cont_line-value = '0001'.
append l_cont_line to l_cont.


CALL FUNCTION 'SAP_WAPI_WORKITEM_COMPLETE'
   EXPORTING
     WORKITEM_ID                     = LV_WI
*   ACTUAL_AGENT                    = SY-UNAME
*   LANGUAGE                        = SY-LANGU
*   SET_OBSOLET                     = ' '
    DO_COMMIT                       = 'X'
*   DO_CALLBACK_IN_BACKGROUND       = 'X'
*   IFS_XML_CONTAINER               =
  IMPORTING
    RETURN_CODE                     = rc
    NEW_STATUS                      = lv_status
  TABLES
    SIMPLE_CONTAINER                = l_cont
*   MESSAGE_LINES                   =
*   MESSAGE_STRUCT                  =
           .

*********************************************************************

Now I have issue to get the vale of value of _WI_RESULT and _RESULT in my workflow template(SWDD) to configure some further steps depending on this value..

Please let me know..

Regards,

Chandan 

I042439
Employee
Employee
0 Kudos

Hi Chandan

Is your work item of type DECISION?

If yes, try using SAP_WAPI_DECISION_COMPLETE.

Regards,

Modak

former_member187651
Active Participant
0 Kudos

Thanks Guptaji for your reply.

I have also tried to use FM: SAP_WAPI_DECISION_COMPLETE. but don't know how to get the value:  DECISION_KEY = '0001'  to my Workflow template. so that I can use it to configure my condition.

I have used Custom template to design the WF. Please let me know steps to flow..

Regards,

Chandan

I042439
Employee
Employee
0 Kudos

Hi Chandan

DECISION_KEY '0001' refers the first decision option, '0002' for the second decision option...and so on ......(as seen in SWDD)

Say, if Your decisions (in SWDD) are : APPROVE, REJECT then 0001 will set the WI to Approved and 0002 will set to REJECTED.

OR If in SWDD, REJECTED is listed first, then decision key 0001 will point to rejection.

Just pass the necessary data, Work item ID and key and the decision should proceed without you having to update the container for result.

Setting the Key should depend on your logic of what user has selected

For setting the comment, refer to

Regards,

Modak

former_member187651
Active Participant
0 Kudos

Thanks Modak..

Suppose I had set the DECISION_KEY '0001' or '0002' in my WDA with confirm/reject option to user.

Now I need to get the value of DECISION_KEY in SWDD. So that I can use it for further step..

If possible, please provide any document or steps that should I follow.

Thanks.

Chandan

I042439
Employee
Employee
0 Kudos

Hi Chandan

As far as I know, you need not set the value explicitly - did you try coding and executing a test? What are the results?

I am sorry, I do not have a ready code with me (or a link)

Regards,

Modak

former_member187651
Active Participant
0 Kudos

Modak,

I am getting details of Internal Table filled in WDA while calling the FM: 'SAP_WAPI_WORKITEM_COMPLETE'

CALL FUNCTION 'SAP_WAPI_WORKITEM_COMPLETE'
   EXPORTING
     WORKITEM_ID                     = LV_WI
*   ACTUAL_AGENT                    = SY-UNAME
*   LANGUAGE                        = SY-LANGU
*   SET_OBSOLET                     = ' '
    DO_COMMIT                       = 'X'
*   DO_CALLBACK_IN_BACKGROUND       = 'X'
*   IFS_XML_CONTAINER               =
  IMPORTING
    RETURN_CODE                     = rc
    NEW_STATUS                      = lv_status
  TABLES
    SIMPLE_CONTAINER                = l_cont
*   MESSAGE_LINES                   =
*   MESSAGE_STRUCT                  =
           .


l_cont is the itab which contains all the details that i need in SWDD. Although I get in SWDD Workflow log -- > Technical details. but don't know how to use it...as I can see these container in Workflow log -- > Technical details only after completion of WI. So I can not use it binding and all.


Can you guide me .. what should I do??


Regards,

Chandan


I042439
Employee
Employee
0 Kudos

Hi Chandan

Firstly, you still not have answered my earlier question.......did you actually try using DECISION_COMPLETE?

Secondly, Please elaborate what we are trying to do with contents of L_CONT?  are we trying to pass back to WD? or are you hinting that you need to update the container?

If you need to pass back to WD - use SAP_WAPI*cont*read (dont have system access right now...search with SAP_WAPI*cont*read or *read*cont) the WAPI gives the contents of container and you can pass them back to WD

or

If you are trying to set values in container, which values? why do you want to set them?

What i understood till now is that you are using WD to get the approval and then calling the BO methods to process the approval further using SAP_WAPI_WORKITEM_COMPLETE. Hence I suggested DECISION_COMPLETE which will complete your decision item and update the result container elements.....isn't that happening?

I can only help if you give clear details and also mention your results on the suggestions provided.

regards,

Modak

former_member187651
Active Participant
0 Kudos

Dear Modak,

I am using FM: SAP_WAPI_DECISION_COMPLETE but to to complete the WI I am using FM: SAP_WAPI_WORKITEM_COMPLETE .

Now as you said I just need to get the flow according to the decision made by user on WDA. Like if user has pressed "Confirmed" on link given on WDA that is opening from WI click...it should go to another user to be approve(designed in SWDD) but if user has rejected (press Rejected button on WDA). Workflow should get completed (not go to another user UWL)...and WI should be removed from the UWL of user.

I have seen that Simple_container  "l_cont" value is visible in SWDD technical detail in workflow log at runtime but don't know how to use it..


Regards,

Chandan

I042439
Employee
Employee
0 Kudos

Hi Chandan

Why dont we design the 'Rejection' in the workflow and handle it by WAPI for decision and set to rejected - say in the rejected branch in SWDD, use a process control to set the workflow to complete.

This way, next user will not get the workitem as well as the current item will also be completed (after rejection).

one thing is still puzzling me, after using SAP_WAPI_DECISION_COMPLETE, isn't the decision getting completed automatically? Why are we using SAP_WAPI_WORKITEM_COMPLETE? Is it that we are trying to complete the 'Workflow' and not just the 'Work item' ?

Regards,

Modak

former_member187651
Active Participant
0 Kudos

Hi Modak,

I would like to answer your 2nd question first..I have used the FM: SAP_WAPI_WORKITEM_COMPLETE just because WI should be completed and removed from user UWL and go to second user. WI doesn't get complete if I use only FM: SAP_WAPI_DECISION_COMPLETE. Is it some problem???

I have tried with the idea of using decision step in SWDD and get the user value in it, but not succeeded. After completing the 1st step and user selects any option(Confirm/Reject) on WDA(Webdynpro Application) open to the user after click on WI. Again one workitem comes to the inbox with USER DECISION (name of the decision step) and user have to click on it , select Approve/Reject and close window...Now work item get finished..

My problem is why we need to execute with WI two times for same purpose..this is not ok..

Is there any way so that I can get the value of my FM: SAP_WAPI_DECISION_COMPLETE to the DECISION STEP in SWDD (standard) and execute accordingly in the background...I mean without manual intervation on it..

Please let me know...is it clear?

Regatds,

Chandan

I042439
Employee
Employee
0 Kudos

Hi Chandan

For once you made me feel that I may be wrong with WAPi DECISION COMPLTE.

You actually made me connect to a system and do a prototype test!!

Here are my testing results:

A pending decision item in the inbox : Note the Work item ID (of the DECISION ITEM and not the WF - the top level is WF)

I approved it via SE37, SAP_WAPI_DECISION_COMPLETE - note the input parameters (i have masked the UNAME)

Decision got completed in Workflow without doing any write to container or anything else:

so, we see that the WAPI Works!!! AND does not require you to do anything additional!

There is definately some more things going on in your case; here are some questions for you:

1) Reconfirm if you are using a DECISION ITEM or an ACTIVITY STEP?

2) Which Work item are you passing to it? Decision item WI or the Workflow WI? - check in debugging as to which WI gets passed from WD

3) Are we setting Commit work flag of the WAPI? or the WD Commit is used? Is it taking affect or not?

4) When the decision comes again to the user, is it the SAME work item ID or a New Work item ID (but the same step) - if new, the workflow is moving ahead using WAPI DECISION COMPLETE and generating another decision item - you need to check the workflow definition as to why the new item is generated

5) Is your work item marked for 'CONFIRM END OF PROCESSING' ? -> Check the TASK (TSxxxxxxxx) in PFTC, see the flag for 'CONFIRM END OF PROCESSING' - if set, the system completes the WI but waits for user confirmation, then you have to call another WAPI. After DECISIOn COMPLETE is SUCCESSFUL, that is RETURN_CODE = 0, call WAPI SAP_WAPI_WORKITEM_CONFIRM to confirm the item.

Lets hope you find a resolution in one of the above questions!!!

Regards,

Modak

former_member187651
Active Participant
0 Kudos

Thank you Modak...

Your Reply really helped to resolve my issue...Initially I was using "Activity step" rather than "Decision step". I have just change the Step and done accordingly...

My problem solved..

Can You answer my one another question..I have configured the Tcode: SWFVISU to replicate the WI to the SRM Portal. Here I have added my task (Custom task copied of standard decision task) ..Visualization type Webdynpro ABAP.

Application: WDA Application name

Namespace: SAP

DYNPARAM : ______________

I don't know how to pass dynamic parameter to the WDA opening from WI on Portal UWL.

Thanks

Chandan

I042439
Employee
Employee
0 Kudos

Hi Chandan

use the same as done forthe standard task.

I do not have an SRM system to give you full details.

You can try using   WI_ID=${item.externalId}  for Dynamic Paramter.

regards,

Modak

former_member187651
Active Participant
0 Kudos

Thanks Modak...

I will check for the dynamic Parameter.. Actually I need to pass some value to the URL dynamically at run time..

Any way my purpose for creating this discussion completed..

I am closing this thread..

Regards,

Chandan

Answers (0)