My current task in hand is optimizing a custom report which also fetches workflow information. As you might have guessed the workflow related information is taking too much time.
The report used a FM which calls bunch of standard functions to get the required information. As the standard function modules fetches a lot of data which in not required for the report, I opted for writing my own function module that would get only the required data.
The Problem: I need to figure out what basic relationship exists between different workflow related tables such as SWWWIHEAD, SWPSTEPLOG, SWWWIRET, SWWWIDEAL, SWW_CONTOB and through where i could find the agents assigned to a particular Work item?
the main function which was getting the major information was BBP_PDH_WFL_APPROVAL_SIMULATE and BBP_PDH_WFL_PARAM_APPLET_FILL2. They were being used as following:
CALL FUNCTION 'BBP_PDH_WFL_APPROVAL_SIMULATE' EXPORTING iv_object_type = g_crmd_orderadm_h-object_type iv_object_id = g_crmd_orderadm_h-object_id iv_guid = lv_guid IMPORTING ev_db_workitem_id = lv_db_workitem_id ev_start_task = lv_start_task ev_start_wi_id = lv_start_wi_id TABLES et_adhoc_agents = lt_adhoc_agents EXCEPTIONS workflow_not_found = 1 workflow_not_actual = 2 OTHERS = 3. CALL FUNCTION 'BBP_PDH_WFL_PARAM_APPLET_FILL2' EXPORTING iv_start_task = lv_start_task iv_start_wi_id = lv_start_wi_id iv_db_workitem_id = lv_db_workitem_id IV_OBJECT_TYPE = object_type TABLES ET_NODES = gT_nodes ET_LINES = gT_lines ET_AGNTS = gT_agents ET_TASKS = gT_tasks ET_WIS = gT_WIS ET_APPROVAL_NODES = gT_approval_nodes ET_WF_APPROVER = gT_wf_approver.
I would be grateful if somebody could help me out in determining workflow items, their status, agents assigned to them against confirmations or point out a performance friendly function which could deliver the same.