Skip to Content

How to read workflow history

hi there,

i have the following requirement: i have some workflows where user can e.g. approve purchase orders, recject purchase orders or forward the workitem to another user. this can happen often inside one workflow.

now my customer wants to see the history of the workflow in a list -> simply said "who has done what and when"-> for example:

User A has forwarded workflow to User B on date yyyy.mm.tt

User B has forwarded workflow to User C on date yyyy.mm.tt

User C has approved workflow on date yyyy.mm.tt

Is there any suitable FM for that ? I can't find anything 😔

br Martin

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 08, 2016 at 10:41 PM

    SAP_WAPI* fms are very useful for reporting.

    SAP_WAPI_FORWARDING_INFO_GET

    SAP_WAPI_GET_WORKITEM_DETAIL

    SAP_WAPI_READ_CONTAINER

    SAP_WAPI_GET_DEPENDENT_WIS

    etc

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 08, 2016 at 11:27 PM

    Hi Martin,

    Unfortunately you would have to dig into the log for some of these. The WAPI functions will let you retrieve some of the basic info, such as getting dialog items. You would need to use something like SWW_WI_LOG_READ and pull apart the results to get information like forwarding etc.

    Not a small task, but doable.

    Regards,

    Mike

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 10, 2016 at 10:44 AM

    Dear Martin,

    If i understood your requirement then you will get all the information referred below.

    In the user decision step go to control tab.

    Go for binding in the control tab.

    In the right hand side you can system variable. In that Expand the BOR (_WORKITEM) .

    In this you will find all the system variables related to Work item. (Who executed, who forwarded, when completed etc)

    Create local container in the work flow and map required variables from User decision step to workflow by this way u will get the values in workflow then you can use it further in mail sending step also approved/rejected/forwarded on this date.

    Below screen shot for your reference.

    Thanks,

    Anand


    binding.wf.PNG (61.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10, 2016 at 08:23 AM

    Hi Mike, hi Rick,

    thank you both for the hints. @Rick: you are doing a great jobs for many years here in the forum 😊

    now i see the problem: reading out the forwardings of an workflow is different to reading out the decisions.

    the other problem is that i have to read ALL workitems of a workflow.

    so that will be a little bit more of logic and coding as i expected 😳

    br Martin

    Add comment
    10|10000 characters needed characters exceeded