cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting Posted Request in portal

0 Kudos

Hello All,

I am working on leave request approval workflow.

Our requirement is to send only notification email in case of deletion of request. We have two sets of request type. One is for which approval not required and other one for which approval required ( settings done in customization PTARQ ).

Now when i delete posted request for which approval is not required, as it is pre approved, its status on levae overview page is Approved and my workflow works fine with its withdrawn status. and we are able to post the request.

But the problem is in case of deletion of request where approval is required. after deletion its status on leave overview page is SENT and it creates new workitem and send it to approver for approval process. This is where its going wrong. As its still in SENT status we are not able to post the request.In workflow i will be able to manage somehow to send notification email instead of workitem, but because of the SENT status in portal, the request will not be posted.

Could you please help me here? Please let me know how to handle this kind of situation.

Thanks in advance.

Regards,

Rachna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Rachna,

In the deletion workflow, Insert the code to change the status from SENT to APPROVED and then call a send mail step for notification.

The below link will help you to get the code for changing the Status of Leave.

http://wiki.scn.sap.com/wiki/display/ERPHCM/Customizing+the+ESS+Leave+Approval+using+Business+Workfl...

Thanks,

Vijay.

Answers (3)

Answers (3)

0 Kudos

Thanks Your replies solved my query

Former Member
0 Kudos

So, basically you have set up two different leave types: some require approval and some do not. Now, if you create a leave request that requires approval, it needs to get status APPROVED before it gets posted to the infotype. Now, if you want to remove/delete a leave that required approval, also the deletion requires an approval. (Maybe the manager does not agree with the change of holiday plans that he already approved etc.). Now, when you delete the leave, it gets status SENT (and is sent to the manager, right?). Actually it is not the leave the is in status SENT, but it is actually a "request for deletion". After approval the leave gets deleted.

If you want to change this, you might need to do some additional development. Basically you could set the status automatically to APPROVED as a separate step in your workflow. Of course you need to check that you are doing it for the "deletion request" (operation is 'DEL'). The approval can be done with method CL_PT_REQ_WF_ATTRIBS->APPROVE. Or if this method does not work, you can at least see how a status of leave request can be changed with code.

Regards,

Karri

ronen_weisz
Active Contributor
0 Kudos

Well, the workflow objects/classes usually call BAPIs or classes of the relevant module, lets say you have no active workflow, can you set the relevant status using a function module/class?

If you can, you can create a workflow task calling the same function module/class method and add it to your workflow.