on 08-27-2014 3:49 PM
Dear All,
We are trying to create a custom workflow for leave with multiple level approvals. We are using the task TS21500003 just like in the standard and this is called in a loop for the various levels of approval.
The task has been registered in xml and SWFVISU to point to POWL. Below is the code in xml for the task.
Now the problem we are facing is that, when the first approver receives the work item and he clicks on the same and opens the POWL. He checks the leave and click on approve. Once he does this, the document status is changed from SENT to APPROVED. The workflow now proceeds to the next level approver but when he tries to approve, there is no document to approve.
What are we doing wrong here? How can we ensure that the document status changes only after the final level of approval is done and the workflow exists the loop.
Please let me know your inputs.
<ItemType name="uwl.task.webflow.TS21500003.SAP_ECC_HumanResources" connector="WebFlowConnector" defaultView="DefaultView" defaultAction="launchWebDynPro" executionMode="default">
<ItemTypeCriteria systemId="SAP_ECC_HumanResources" externalType="TS21500003" connector="WebFlowConnector"/>
<Actions>
<Action name="launchWebDynPro" groupAction="" handler="SAPWebDynproABAPLauncher" returnToDetailViewAllowed="yes" launchInNewWindow="yes" launchNewWindowFeatures="resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no">
<Properties>
<Property name="display_order_priority" value="5"/>
<Property name="newWindowFeatures" value="resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no"/>
<Property name="WebDynproApplication" value="HRESS_A_PTARQ_LEAVREQ_APPL"/>
<Property name="WebDynproNamespace" value="SAP"/>
<Property name="openInNewWindow" value="yes"/>
<Property name="System" value="SAP_ECC_HumanResources"/>
<Property name="WebDynproConfiguration" value="HRESS_AC_PTARQ_LEAVREQ"/>
<Property name="DynamicParameter" value="LRF_ARQ_MODE=A&LRF_WITEM_ID=${item.externalId}"/>
</Properties>
<Descriptions default=""/>
</Action>
</Actions>
</ItemType>
You are in which release? You can follow similar steps here http://wiki.scn.sap.com/wiki/display/ERPHCM/Customizing+the+ESS+Leave+Approval+using+Business+Workfl... Or if you are in HR Renewal, you can check here http://scn.sap.com/docs/DOC-41537
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Siddharth,
We used the method suggested by you. We are not on HR Renewal.
Now first level approver approves successfully and it resets the status.
It then goes to second level approver. When he clicks on approve, Error is displayed "ERROR: Field symbol has not been assigned yet."
We debugged the issue and found that it is trying to retrieve values from ptreq_approver and with the request id it is searching, the table has entries for the first approver and the latest version says already approved. Hence no values are returned and program runs into an error. In the background workflow is set to completed but the screen shows dump.
Any comments? Below is the code and field symbol <ls_approver> which returns blank.
Regards,
Rahul
"get request approves
IF lo_approver_list IS NOT INITIAL.
lo_approver_list->get_req_approvers( EXPORTING is_req_id = request_i
IMPORTING et_approver = lt_app
ex_has_error = lv_has
IF lv_has_error = abap_false.
"get request current approver
SORT lt_approver BY seqnr ASCENDING.
LOOP AT lt_approver ASSIGNING <ls_approver> WHERE status = 'T'.
EXIT.
ENDLOOP.
Sidhharth.. one question..
We are on EA-HR 607 SP 23.. So we can work on HR Renewal but we are going with the default ESS.
Being this the case, do we need to follow this? http://scn.sap.com/docs/DOC-41537
In the comments to this article I saw this:
- It's important to set sequencer number in the extract structure
- SAP delivers a new workflow template WS33700137 which regards the multiple approvers stored in the new DDIC table PTREQ_APPROVER
Siddharth,
We will try that and revert. We are implementing the badi to see if it helps.
Mean while I also got one more query:
For Clock-In/Out corrections I have used the standard workflow WS21500001. The workflow is triggered. I have registered task TS21500003 as per note 1773641. Hence it will open the HRESS_A_PTARQ_LEAVREQ_APPL application.
When I click on the clock-in/out request from UWL which also uses this task, it opens the leave approval page and there are no requests.
For clock-in/out approval from UWL, which is the application that needs to be called. If we copy standard task TS21500003 into custom and use for Clock-in/out, then what should the new custom task point to in SWFVISU. Please guide.
Regards,
Rahul
Same thing happened with me.
I checked why it was giving a dump.
This execute_approver_update subroutine takes approval data from table ptreq_approver .
I filled this with resp actor id after request is approved and status is changed to sent.
For every emp its unique actor id is saved in ptreq_actor table agaist his pernr.
SELECT SINGLE actor_id FROM PTREQ_ACTOR INTO actor_id WHERE objid = nextApprover_pernr.
wa_appr-mandt = sy-mandt.
wa_appr-request_id = Request_ID. "Req.requestID ( from Workflow )
wa_appr-version_no = version_no. "Req.Version ( from Workflow )
wa_appr-seqnr = seqnr. "Same as version no but in char
wa_appr-approver_ins = actor_id. "Employee actor id from ptreq_actor
wa_appr-status = 'T'. "Manual
append wa_appr to it_appr.
INSERT PTREQ_APPROVER FROM TABLE it_appr .
commit work and wait.
This code resolved my issue.
We have successfully done the leave workflow using steps
The workflow used is WS33700137 and it is working well.
We need to incorporate multiple approvers in Clock-in/out as well. Can the same workflow be used WS33700137? If so then similar to leave can we set the multiple approvers in a BADI?
Kindly let me know your inputs. I can open a new post if required.
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.