cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger Workflow Event via Java Web Dynpro code

Former Member
0 Kudos

Hi experts,

I have a requirement where we need to trigger a workflow from a Portal screen. This screen is created in Java Web Dynpro.

Upon clicking a button, it should trigger the event to start the workflow. What are the steps/configurations needed to do this?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

bpawanchand
Active Contributor
0 Kudos

Hi,

I hope On click of Button you can call a RFC fucntion module right by making use of some JCO connections then in that case the SAP provides some standard RFC function modules they are

SAP_WAPI_START_WORKFLOW: By using this function module you can just call the workflow directly.

or SAP_WAPI_CREATE_EVENT is another rfc funciton module.

In case if you want to pass some data from Applcation to backed then I woudl recommend to create a Wrapper RFC Function module create your own signature and then pass tha data to this function module and inside this fm make use of the any one of the funtion modules mentioned above.

Regards

Pavan

Edited by: Pavan Bhamidipati on May 24, 2011 2:39 PM

Former Member
0 Kudos

Hi,

Apart from the Pavan's answer, Made the workflow as a 'General Task'.

Also instead of SAP_WAPI_START_WORKFLOW, try to use the FM SAP_WAPI_CREATE_EVENT. Gor this function module you have to create the event and need to triiger the workflow.

It has more advantages than SAP_WAPI_START_WORKFLOW function module.

Thanks,

Viji.

Former Member
0 Kudos

Thanks for the reply Pavan and Viji. I would like to ask what is the meaning of the Java code below:

wdThis.wdGetCompController.executeTriggerEventBapi("CoderReject");

From my understanding, it triggers the event CoderReject. But I don't know how it was able to do it. Is there a way to determine the Bapi being called in NWDS? I only saw in NWDS a context for SAP_WAPI_CREATE_EVENT, though I don't understand the Java codes (I'm really not familiar with Java programming)

I added a custom event in BO FIPP and tried to copy the above java code but my event wasn't triggered.

bpawanchand
Active Contributor
0 Kudos

Hi,


wdThis.wdGetCompController.executeTriggerEventBapi("CoderReject");

In the current component, I think may it could also be possible that when ever you are trying to click on the reject button then it is raising the event CODERREJECT in the component controller, so please ask the webdynpro java consultaant to check what is the peice of code he has written in the CODER REJECT event .

By the help of one of my friend i have come to know that the above statement is trying to call the TriggerEventBapi Method and passing the parameter "coderReject" and youhave to know that what exactly this parameter is doing........ Check I hope you have to just pass your BO's FIPP key and the event that you want to raise.

@Viji

I think if you are trying to raise a event by using SAP_WAPI_CREATE_EVENT in that case you do not have to do the workflow template as general task.. Correct me if Iam wrong.

Regards

Pavan

Edited by: Pavan Bhamidipati on May 24, 2011 4:17 PM

Edited by: Pavan Bhamidipati on May 24, 2011 5:21 PM

Former Member
0 Kudos

Hi Pavan,

Great! Your friend was right, TriggerEventBapi is a method in the component controller. I tried to find it and in that method I saw the code where it calls SAP_WAPI_EVENT_CREATE. It has a check on the parameter being passed and triggers the specific BO event based on that parameter.

Thanks a lot to you, your friend, and Viji, I assigned points.

Answers (0)