Get insider knowledge about product lifecycle management software from SAP. Tap into insights and real-world experiences with community member blog posts.
I’m writing this blog to make you understand the importance of debugging hooks which is available in EHSM module. It’s a very useful mode for debugging background activity which through normal breakpoints is not achievable.
During my time working in EHSM module I observed that many EHSM programs (mainly class) have debugging hooks which SAP has provided. So I started wondering why SAP has provided this line of code in standard class (then wore my Thinking Cap :smile: ) .After few days I got the idea behind the debugging hooks in EHSM.I will share the same with you in Layman language :smile: .
Two things you need to know one is a class ‘CL_EHFND_WFF_DEBUGGING’ which is a utility class mainly used in workflow related methods and second a table ‘EHFNDD_DEBUG’ .Normally this class is used mainly for workflow method whose activity is background processing. This class contains many methods but we will be using method : ‘debug_location’.
For example suppose in standard workflow activity there is some data issue and you require a debugging on the activity to check the issue. Normally it requires a lot of struggle to get the debugging running but with this particular class it’s easier to debugging standard workflow.
Below is the code that I have added in my custom workflow for incident creation. Through this you can set breakpoint.
So here if you see in parameter I’m specifying a value which is nothing but the class name and its method. You can give any name but for better understanding and readability it’s good if you follow in this manner.
Now you might wonder what does this piece code do and how does it set breakpointJ. It’s simple the code performs an infinite loop using do enddoJ( but the code is bit different in that method it’s not simple do enddo). Then use SM50 to debug the program.
Next you need to update the value mentioned above i.e. 'ZCL_EHHSS_PCO_INC_LC_NEW->SEND_MAIL_NOTIF' in the below table.
Now the configuration is almost done. If you want to activate the debugging point you just need to mention ‘X’ in value column as show in the below screenshot.
Hope you understood :smile: .If any doubts please feel free to comment below i will try answering it.