on 09-06-2016 8:59 AM
Hello Experts,
I am new to classes and objects and also to class based workflow. Before this I have created workflows only using BOR.
I have a requirement of adding one more level in standard leave request workflow.
For that I made a copy of standard workflow template and also created a subclass of ZCL_PT_REQ_WF_ATTRIBS called ZCL_PT_REQ_WF_ATTRIBS_COPY (since ZCL_PT_REQ_WF_ATTRIBS was already created and used by other workflow templates and not allowing me to add my method).
Then I added my method in ZCL_PT_REQ_WF_ATTRIBS_COPY called REVERT_REQUEST_STATUS.
When I executed my workflow the method went into error raising exeption CX_SY_REF_IS_INITIA.
I tried to debug my method by adding an infinite do...enddo loop in my code, also tried function module K_PLAN_WAIT_FOR_DEBUGGING and K_PLAN_WAIT_FOR_DEBUGGING_CTRL, also tried following the instruction in SAP note 1782731 but with any of these methods I am unable to see my class method in SM50.
I checked SCN for similar threads but couldn't get the solution.
I checked WF-BATCH authorizations which seems to be correct since I am able to debug methods of BOR by creating infinite loop in my BOR method.
I certainly don't know where I am going wrong and why I am not able to see my class method in SM50.
Experts Please help.
Regards,
Shraddha.
Hi Shraddha,
Could you please execute the method directly from SE24 as method CREATED declared as STATIC & check whether coming in SM50 or not.As per your screenshots DO-ENDO should display in SM50 from workflow execution.
Regards,
Shailesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
The below link will guide you ........
Customizing the ESS Leave Approval using Business Workflow - ERP Human Capital Management - SCN Wiki
Regards,
Shamsu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have several application servers, use SM66 instead of SM50. Make sure that the method you want to debug is triggered by forcing it to short dump (MESSAGE 'test' TYPE 'X'), then if it dumps, replace the MESSAGE line with endless loop DO ... ENDDO. I never saw an issue with that endless loop, the workprocess could be seen with SM50/SM66.
But the problem is- the step in which the endless loop is defined is not hanging, it gets executed.
I have resolved my error of class instantiation, but still couldn't debug the method.
Leave request workflow is triggered via SAP_WAPI_START_WORKFLOW from a BADI PT_GEN_REQ and not with the help of triggering event, could that be the problem?
Your code is all right. No reason to not loop endless. I don't understand what happens. Use message 'test' type 'X' to make sure your code is reached. If there's no short dump then it means your code is not reached.
PS: do. enddo. is sufficient (because at runtime you may jump after the enddo via the debug menu "jump to statement").
Hi Shraddha,
Request you to check whether you selected Background processing option in Standard Task.
As you shared, you copied standard workflow , then u must have container element of TYPE REF to CL_PT_REQ_WF_ATTRIBS or your Zclass.
If your method declared as instance method then above container must have instantiated.
Please check this & this may help out to debug your method by adding DO-ENDDO.
Before this first try to debug method from SE24 by adding DO-ENDDO , if its working from SE24 then it should work with workflow.
Regards,
Shailesh
Just a guess: you must implement the method IF_WORKFLOW~FIND_BY_LPOR, to return an instance of your class. Refer to the numerous threads in SCN, and in the SAP library.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.