cancel
Showing results for 
Search instead for 
Did you mean: 

How to initiate a workflow event from a webdynpro application

Former Member
0 Kudos

Hello Everyone,

I am working on an assignment for webdynpro, I am very new to this concept and haven't worked much on web Dynpro so far. The requirement is we are trying to a create a web dynpro application that will allow the user to post the invoice and following are the basic requiremnts/functionality.

1. In the first step the user will login to the portal and will enter the required details and then will have the option to SAVE the data (that will in the back end will do the data validation)..once the data is consistent the web dynpro should kickoff/trigger a workflow that will send a notification to the desired user (in our case the centeral user).

2. In the second step the centeral user will look at the data that he got along with the notification and will have the capability to either Post the data or to Reject the data, the post option will do an actual posting of invoice and the reject option will send a notification to the user who entered the data.

I am not able to understand how to kicoff/trigger the workflow event once the user hit SAVE button in the web dynpro application.

Your help is always appreciated.

Thanks,

Rajat

Edited by: rajatg on Apr 29, 2010 4:56 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member187452
Contributor
0 Kudos

Hi,

For this you need to create an BOR object and in that create an event.

then use FM SWC_ELEMENT_SET and SWE_EVENT_CREATE.

using this you can trigger workflow from webdynpro application.

Regards,

Bharat

Former Member
0 Kudos

Thanks for the reply Bharat, we have created a custom Business object and added the event to it but now the problem is when I try to use the FM to trigger the workflow I am not able to understand what do I need to pass in the following Exporting parameters:

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

OBJTYPE

OBJKEY

Thanks for your help.

Rajat

Former Member
0 Kudos

Hello and greetings from workflow forum,

I really recommend that you will use function SAP_WAPI_CREATE_EVENT instead of the one that you are now trying to use. Both will work, but the one that I mention is a newer one and it is recommend to be used.

The following thread (check Saumya Govil's answer) will give you an example of how to use the function that I mentioned:

The object key is the key of your business object (the same key that you can use to instantiate the object in SWO1).

And after that you think that your code is OK, test it, and check if the event is triggered in SWEL (before that put the event trace on in SWELS).

Regards,

Karri

Edited by: Karri Kemppi on May 11, 2010 11:07 PM

Answers (2)

Answers (2)

former_member628395
Active Participant
0 Kudos

Hi,

Please check the following thread for the same.

[SDN - Trigger Workflow from WDA|;

Hope this helps.

Regards,

Sagar

Former Member
0 Kudos

Hi ..

It will be similar to the how the event is trigger in ABAP Code. U can use the FM 'SWE_EVENT_CREATE' to trigger the Event in the SAVE button Action.

Ranganathan.

Former Member
0 Kudos

Thanks for the information... I am very new to Web dynpro and Workflow ... What I can see for now is I will need to use the Business Object BUS6035, can you please tell little more about it. I mean what should be the process that I need to follow and what all I need to do in the business object.

Thanks again.

Former Member
0 Kudos

Sorry .. I am not a workflow person.. and also this is not the right forum to put the workflow related query.

Former Member
0 Kudos

Try to use the below FM in SAVE button event handler:

DATA: obj_key LIKE swr_struct-object_key,

eventid LIKE swr_struct-event_id,

retcode LIKE sy-subrc,

msg_lines LIKE sy-linct,

msg LIKE swr_messag OCCURS 2 WITH HEADER LINE.

obj_key = kukey.

*-- workitem zur Buchung anlegen --

CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'

EXPORTING

object_type = objtype_finsta

object_key = obj_key

event = c_event_post_finsta

commit_work = ' '

IMPORTING

return_code = retcode

event_id = eventid

TABLES

  • input_container =

message_lines = msg

EXCEPTIONS

OTHERS = 1.

Hope it works for you...

Former Member
0 Kudos

HI Sanket,

Thanks for the reply,,, what value do I need to pass in the parametes like OBJECT KEY, OBJECT TYPE parameters in my case.

Former Member
0 Kudos

Any More clue please.