on 02-04-2011 4:04 AM
Hi Team,
I am new to webdynpro ABAP, i have a scenario
I have a work flow id with me, i want to start this workflow from a webdynpro application,
1. wedynpro application contains a list of inputs and user1 inputs this data that i have stored node, So node contains full data.
2. Now i have a workflow id, i want to pass this node data to this workflow on a button click
I have the button action, what code is required to pass this?
(I sow few FMs in fourms but i dont know how exactly i can use it)
3. When the approver gets the workitem, he should be able to approve,reject or send backToAuthor option he will get
how to read this data back to approver screen for the approver to take correct action ?
Please help me with some code sample, i sow few things but i am not sure about the parameters which required for this.
Thanks,
PP
Hi,
1) In order to trigger the workflow from webdynpro and pass the list of inputs and your workitem id , i will suggest you to go for a business object.
2) If you have a business object than you can just trigger the workflow through the event (provided your workflow should be an event trigger workflow). As well as you can pass your parameters through it.
3) In order to trigger the workflow through your business object event u can use the following function module.
in the below code:-
it_container- contains the parameter u want to pass like workitem id in your case.
ZPOC_LEAVE- is my business object.
OPTIONAL- is my event which will trigger the workflow.
ty_object_key:- structure type of key fields of business object.
Note:-you have to define these values as per your business object.
* Trigger the event ZPOC_leave-CREATE to start the workflow
DATA: it_container TYPE TABLE OF swr_cont,
is_container LIKE LINE OF it_container.
DATA: g_return_code TYPE sy-subrc,
glf_event_id TYPE swr_struct-event_id.
DATA : ls_objkey TYPE ty_objkey.
DATA : ls_objtype TYPE swr_struct-object_typ VALUE 'ZPOC_LEAVE'.
DATA : ls_objectkey TYPE swr_struct-object_key.
DATA : ls_event TYPE swr_struct-event VALUE 'OPTIONAL'.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = ls_objtype
object_key = ls_objectkey
event = ls_event
commit_work = 'X'
event_language = sy-langu
language = sy-langu
user = sy-uname
* IFS_XML_CONTAINER =
IMPORTING
return_code = g_return_code
event_id = glf_event_id
TABLES
input_container = it_container
* MESSAGE_LINES =
* MESSAGE_STRUCT =
.
4) You also need to define the parameter(workitem id in your case) under the parameter option of your event in your business object. (you can use the transaction SWO1 for business objects).
5) Now in swdd transaction in the basic data u can mention your start event.
This should be enough to trigger your workflow and pass your workitem id to it.
Thanks and regards,
Mayank Gupta
Edited by: Mayank Gupta on Feb 4, 2011 5:52 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.