Skip to Content
Author's profile photo Former Member

_WORKITEM Container element in SAP Workflow

Hi All,

I just thought to share the importance of _WORKITEM standard container element in any SAP workflow.

This blog might be a smallest on SDN but it could save lots of time for a workflow developer if he knows the usage and importamce of _WORKITEM container.

SAP standard container _WORKITEM is of business object type FLOWITEM. It has got plenty of attributes which can be used in workflow developement instead of using the Class/Business object method and fetching the same values again which are there in _WORKITEM.

Whenever any workflow starts, this container element get filled automatically by SAP.

_WORKITEM Container.png

Below are some of the important attrbiutes of _WORKITEM which can be used in workflow developement.

  • CreatedByUser: This attribute is of type USR01 business object.At the start of workflow, it gets filled with initiator’s details.  This can be very useful in other workflow steps. It has attribute such as Name (from user master reecord i.e.SU01D), Employee which is of type EMPOYEET business object. EMPLOYEE attrbiute of CreatedByUser containes information about various infotypes from HR master data e.g. HR infotype 0002 for employee personnel data (first name, last name, title etc.), infotype 0006 (for employee addres information). It has also got an attribute for INTERNET ADDRESS from infotype 0105 sub type 0010. This internet address can be used for sending an email notification to workflow CREATOR depending upon certain business condition. Hence instead of writing a dedicated method for determining these informations about workflow CREATOR, we can make use of these statndard workflow containers and bind them to our task containers as the requirements.

_WORKITEM_CREATEDBYUSER.png

  • ExecutedByUser: This attribute is also of type of business object USR01. It stores information of user by whose USER ID particular workflow step was executed.Hence the the HR infotype will also get populated for the user executing the user decision work item, which can be then used in other workflow steps and email notifications.  sometimes there is a requirement to send an email notification to workflow initiator with the details of agent/manager who executed the work item. In this case we can bind ExecutedByUser.Name attribute from user decision task back to workflow container. The corresponding workflow container will then store the agent name who executed the work item.
  • Adminitrator: It stores details of workflow admin in the system. Hence it can be used in other workflow steps for further operations for example for sending email when some unwanted situation arises.

_WORKITEM_ADMIN.png

  • Similary there are other very useful attributes such as WorkitemCreationDate, Workitemcreationtime, different types of deadline dates.

All these attributes can be directly binded to some workflow container elements as per the need and used in other workflow steps. This will considerably reduce the time involved in creating separate methods and fetching these already populated values.

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi,

      Good attempt.Keep it up.

      All the best for upcoming documents. 😉

      Regards,

      Ragav

      Author's profile photo Former Member
      Former Member

      hi,

      good work. keep posting such content. All the best

      Author's profile photo Former Member
      Former Member

      Hi Ibrahim,

      This document is really useful.

      Author's profile photo Former Member
      Former Member

      Hi Ibrahim,

      nice work keep posting such important details regarding workflows.

      with regards,

      ch.ravi shankar

      Author's profile photo Murali Krishna
      Murali Krishna

      Thanks for sharing useful information.

      Best Regards,

      Murali Krishna.

      Author's profile photo Nitish Chawla
      Nitish Chawla

      Exceptional and useful document. Was searching for this kind of document for long time 🙂

      It would be quite helpful if you could create a document for bindings between diff. containers (rule/method/task) and the mandatory fields that should be bind.