In a custom workflow for HR, i have created a task in which i have to update infotype 0006 with new changed address records. I have created an ABAP class in which i have created a method. I have used FM 'HR_INFOTYPE_OPERATION' to update the record. When i execute the method in test mode of SE24, it updates the record. But when i execute the workflow the record is not updated. As the workflow cannot be debugged, how can i check the problem?
First of all, put some error handling in your method. IF the function returns and error, return it to the task/workflow container. This is the only way you can know if something went wrong in the infotype update. Even if you get your method working in the workflow, it is highly possible that in the future sometimes the method will not work (person is locked or whatever), and you should react to those situations in workflow (at least if you want to make good design).
If the above way will not tell you what is wrong in the method, I would at least look possible authorisation errors (trace these with authorisation expert - the WF user is WF-BATCH). Do you need a commit work after the function call? What if you execute/test the task directly (With test tool), will it update the infotype? If these will nit give you result, you might want to debug the method in the workflow - this is possible (if your method is a custom method and you can add little bit code to it) - you just need to put an "eternal loop" to it - you should easily find instructions how to do this.