cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger workflow starting from Webdynpro

Former Member
0 Kudos

Hi all,

DO any one knows how to trigger workflow starting through webdynpro application. Please reply.

Thank you

Maruthi

Accepted Solutions (1)

Accepted Solutions (1)

former_member189631
Active Contributor
0 Kudos

Hi Maruti,

To trigger a workflow please Follow these steps,

  • Create a Adaptive RFC model for "SWE_EVENT_CREATE" and "BAPI_TRANSACTION_COMMIT".

  • Pass the values to Key, Object Type, Event Id.

  • Execute SWE_EVENT_CREATE" and "BAPI_TRANSACTION_COMMIT".

Regards,

<b>Ramganesan K</b>

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I don't think the others understand your question correctly as they are just describing how to create and then raise events in Web Dynpro - not how to call Workflow...

Are you trying to call SAP workflow on an R3 system?

I don't know anything about SAP workflow unfortunately but one option may be to use standard SAP RFC modules if they exist for triggering your workflow events, or even writing custom RFC modules to do this.

If this is the case have a look at the BAPI/RFC Web Dynpro tutorials on SDN for creating an adaptive RFC model.

Hope this helps,

Gareth.

Former Member
0 Kudos

It is very general question. Probably, if you following MVC methodology, you model is in JavaBeans, and workflow in WebDynpro Controller (eq. MyController). You want start workflow clicking on some button in View (calling function eq. startWorkFlow() in Controller).

If is that correct, View must have Data Link (in Diagram View) and on Button’s event onAction put

wdThis.wdGet<controller name>Controller().<function name>();

or like upper

wdThis.wdGetMyControllerController().startWorkFlow();

former_member193771
Contributor
0 Kudos

thank you very much verdan, if u cud say how we can associate the event with the workflow for the trigerring to happen that would be of great help.

regards,

sukumar.

former_member286976
Active Participant
0 Kudos

Ok, let's consider Component controller and View controller

Steps to follow

1. Create an event in the Component Contoller

2. Create a method in Component contoller and from this method fire the event

3. Call this controller method from view action

4. So when the action takes place in view, this event gets triggered

5. You can write the code to manipulate the event again in the view controller

Create another method in ur view contoller with Event Source and Subscriber Event.

Then manupulate the evnt action there

<b>

Component Controller
--------------------
Event: EventXYZ

Method()				----------------->3rd step (Control comes here)
{
  wdThis.wdFireEventEventXYZ();     --------------------->4th step (Fire the event)
}


View Controller
---------------
onButtonClick()					--------->1st action (Button click in view)
{
  wdThis.wdGetComponentController().fireMethod();  ------>2nd Action (calls Method() in component controller)
}

handleEvent() 					     ---->5th step (Control comes here to do event handling, since we had set set Event Source and Subscriber Event in this method)
{
 //event hadling code
}

</b>

Regards,

Sudeep.

Sharadha1
Active Contributor
0 Kudos

Hi sukumar,

If you want to trigger a workflow when an event occurs, you have to add that event in the 'Triggering events' tab when you define the workflow.

Regards,

Sharadha