Skip to Content

Web Dynpro - Workflow integration

Hello,

Can someone please tell me what are the methods we can use for integrating Web Dynpro and Workflow. I have to create a custom Business Object for this purpose.

I have found out that we can use the FM 'SAP_WAPI_CREATE_EVENT' to trigger an event from the WD screen code. Please let me know if anyone has used the same and kindly share the experience.

Many thanks in advance.

Regards,

Ameya Kulkarni

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 29, 2010 at 07:21 AM

    Hi Ameya,

    You are going to use any events to trigger your workflow?

    if you need to trigger the workflow from web dynpro you can use the Function module SAP_WAPI_START_WORKFLOW.

    In this FM just pass your workflow ID.

    Also you can pass the data's from webdynpro to workflow using this function module.

    After approval you can save the data's from the workflow.

    Thanks,

    Viji.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Ameya Kulkarni

      Hi Ameya ,

      Just create a custom event in the business object.

      Then in the webdynpro screen under submit button call the FM SAP_WAPI_EVENT_CREATE and pass your Business object and Event.

      Also in the workflow template > basic data> you need to maintain the start event and activate it.

      When ever the submit button clicked the FM will trigger the Event and the Event will trigger your workflow.

      Thanks,

      Viji.

  • Nov 29, 2010 at 02:31 PM

    Hi

    The very important thing to integrate the WDA with workflow is task registration where you are sending work item to SAP inbox with url once the url is clicked the WDA page will open and where the user will take action. These are few guidlies i would suggest for your scenario:

    1) If there are approval process then go for workflow if only simple mail sending with validation do go for workflow. Everything can be handled in your screen itslef.

    2) If you want to determine the approver based on some validation then go for workflow ex. travel request based on employee group <= condition go for this level of approver else go for this level of approver.

    3) For your scenario fellow this way.

    a) Use FM SAP_WAPI_CREATE_EVENT OR SAP_WAPI_START_WORKFLOW but strictly advise to use event create FM rather than start workflow where you are hardcoding the workflow template no. So avoid it.

    b) After triggering the workflow need to validate the condition use some custom FM or class to do this. Do Not write entier code in your method of BOR which will not be helful if you want to call that method somewhere other then your workflow you cannot call it. So always write the business logic in ZFM and call inside your method which will be robost.

    c) To communicate the values from workflow and WDA use SAP_WAPI_WRITE_CONTAINER AND SAP_WAPI_READ_CONTAINER.

    d) To determine the approver create new FM write the logic for approver. Usually we will create rule but for your case its not adviced you are calling WDA screen. In the task(activity) of the workflow in the express field pass the approver user id in the workflow container element which will send the workitem to the SAP inbox.

    e) Once the workitem received the workitem to inbox once clicked it your WDA screen has to open for that need to do TASK regestration from SWFVISU t-code just check thsi its been long for me

    f) After approving by clicking on approve button the send back the data if comments are there by using the above mentioned FM.

    g) Then finally use send mail step to send mail.

    For task registartion and data exchange from workflow and WDA see the blog for BSP the same requirement is done using the BSP. Check that which will give excat idea.

    Regards

    Vijay

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      Can you please let me know how to use the SAP_WAPI_WRITE_CONTAINER and SAP_WAPI_READ_CONTAINER. From where do we get the Workitem Id required?

      And how do we receive the data in the workflow container.

      Regards,

      Ameya Kulkarni