We took our first steps with processes & forms and liked it. Then someone noticed that the user WF-BATCH is always displayed as the last modifier of the infotype if a process has been approved. This is a bit ugly because you can not see who is responsible for the change within the infotype.

In our case it’s about a double approval where the clerk is the last approver. So I decided to implement a soulution for this, so that the latest approver is set as latest modifier instead of WF-BATCH.

In my workflow I added the field approver to the container where i hold the actual last approver. In my last approval step before I save the workflow data I add the approver of the task to the container.

Dataflow looks like this:

So after that i have to import the latest approver from the container in my task where the data is saved to infotype.

No you can copy standard class CL_HRASR00_WF_COMPONENTS -> E.g. ZCL_HRASR00_WF_COMPONENTS

Change method save_form_data_to_db_wd:

********************************************************************** * Note 1422496: Enable the debugging for background task. * * To activate debugging execute FM: * * K_PLAN_WAIT_FOR_DEBUGGING_CTRL with the following * * parameters. * * ID_DEBUG_ID = 'HRASR' * * ID_DEBUG_LEVEL = 'SAVE_FORM_DATA_TO_DB' * * ID_USERNAME = <User_Name> * ********************************************************************** CALL FUNCTION c_debug_fm "K_PLAN_WAIT_FOR_DEBUGGING EXPORTING id_debug_id = c_debug_id id_debug_level = c_save_form_data_to_db_wd. ********************************************************************** * End Note 1422496 * ********************************************************************** * Call maintain_form_data with activated save to backend (check_only = '') sy-uname = conv #( approver_in+2 ). CALL METHOD cl_hrasr00_wf_components=>maintain_form_data_wd EXPORTING check_only = '' workitem_id = workitem_id form = form activity = activity IMPORTING procstate = procstate error_category = error_category error_messages = error_messages expert_withdraw_button_visible = expert_withdraw_button_visible.

Here the special move is to add approver to sy-uname.

You have to add the approver as parameter to the method before.

 

After that you have to change the basic info of your save task and ad your custom class:

Finally you modify the data flow for the object method and add the approver:

 

Don’t forget to add the approver to your task container:

 

After all is done, your latest approver is automatically the latest modifier of the infotyp after approval 🙂

 

 

I think it is one out of many ways but it works 😉

New NetWeaver Information at SAP.com

Very Helpfull

User Rating: Be the first one !