cancel
Showing results for 
Search instead for 
Did you mean: 

Leave Workflow resubmission problem

0 Kudos

Dear Expert

We have implemented a leave workflow base on standard workflow 12300111, which has more than one approval layer. After the second manager reject the request, the request goes to “Resubmission” and by the “Dummy” method send it back to “&_WF_INITIATOR&” of the initiator.

Now, after resubmission of the request by the initiator, SAP sends it to the second manager that is not true as our organizational process. According to our business process after each rejection the request must be send back to the initiator and then must send it to the first manager and then other higher managers. In a word after each rejection the request must throw same as new request.

We have written a background method which set the next processor as the first manager and have putted it after the Standard task “TS12300116” (Process Request by Employee) in workflow. But the method does not work and the “Next processor” does not change.

Please guide me to implement the above process.

We now use SAP ECC 6 EHP5 and use NWBC as internet based portal.

Vest Regard

Afshin

Accepted Solutions (1)

Accepted Solutions (1)

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Afshin,

Ok well the first thing to understand about the Leave Request workflow is that it is more about leave requests than about workflow.  Instead of writing a background method you should try the exit options in enhancement spot PT_GEN_REQ.

BTW that dummy method isn't really calling the method... it's calling either the Web Dynpro Java - or hopefully in EHP5 the Web Dynpro ABAP - application for the leave request via the task visualization entry in transaction SWFVISU. 

But regardless, it's the leave request app that has the real control here.. workflow is just there to launch the approver/author back into the application.

Hope that helps

Regards,

Jocelyn

0 Kudos

Hi Jocelyn

Thanks a lot for your helpful quick answer.

I now have created some new methods in class “CL_PT_REQ_WF_ATTRIBS” which on that there are some helpful standard methods i.e. “set_next_processor” and “initiate_state_transition“. Also, the standard tasks of the standard workflow of leave request, 12300111, work with this class. We used these methods by hint of thread numbers 1605468, 1934236, in order to reset the document status to “Sent” and change the next processor. After each Approval process this background method is called. The links of these threads are as below:

http://scn.sap.com/thread/1605468

http://scn.sap.com/thread/1934236

I had a glance on that BAdI (PT_GEN_REQ} and seems that it is very helpful. I have enhanced the BAdI and have created a new implementation. But I do not know anything about which method I must implement. I have set a break-point in some methods of that BAdI in order to get a big picture of its operation, but the break-points do not work same as break-points in the “CL_PT_REQ_WF_ATTRIBS”. Also as other said on SCN the code inside the method FIND_RESP_AND_DEFAULT_NEXT_PRC is fully commented.

Please guide me how I can implement our needs by this BAdI?

Furthermore I will appreciate you if you can give some information, links or standard educational books which have some detailed information about task visualization entry in transaction SWFVISU.

Best Regard

Afshin

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Afshin,

I think you'll find the standard SAP Library Help is quite sufficient to understand the operation of transaction SWFVISU. This transaction has been around for a number of years now and I would consider it essential knowledge for anyone working in workflow. This link is an example from the latest SAP Library help.

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/4b/03bd9f65322593e10000000a42189b/content.htm

As the BADI is a Leave Request BADI and not a workflow BADI, you may find it more helpful to ask your BADI specific questions in the SAP ERP Human Capital Management space where I note that there are already several discussions around the usage of this BADI.

Also you mention that code inside the method FIND_RESP_AND_DEFAULT_NEXT_PRC is fully commented. This is usually done by SAP development precisely to give you a detailed example of how you might use this BADI, so I recommend you take a close look at the commented code and try to understand it, as this is likely to be one of the best guides you can have.

I would also encourage you to make the maximum possible use of the standard enhancement options such as the BADI  before taking extraordinary measures to minimize any potential problems.

Hope that helps, and good luck!

Regards,

Jocelyn

vimalv
Active Participant
0 Kudos

Afsin,

I think you can find your answer here.

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

I have changed the Next Processor this way:

*-----------------------------------------------------------------------

CALL METHOD cl_pt_req_badi=>get_request

               EXPORTING

                 im_req_id  = i_request

               IMPORTING

                 ex_request = lcl_request.

             IF lcl_request IS NOT INITIAL.

* Set as Next Processor.

               CALL METHOD lcl_request->set_next_processor

                 EXPORTING

                   im_actor_type = 'P'

                   im_plvar      = '01'

                   im_otype      = 'P'

                   im_objid      = loc_pernr.

*------------------------------------------------------------------------

Answers (0)