on 05-24-2011 8:23 PM
Hello,
I copied the standard workflow for the approvaI of a purchase requisition WS00000038 and i tested it. I create a purchase requisition in me51n. This is triggering the event releasestepcreated which starts my workflow. Everything goes ok.
Now, i want to call this workflow in ABAP. I do not know exactly how to do it. Here is the code I tried.
data: ls_objkey type SWR_STRUCT-OBJECT_KEY,
lt_mesage type table of SWR_MESSAG,
gt_container type table of swr_cont,
gs_container type swr_cont.
gs_container-element = 'ReleaseCode'.
gs_container-value = '01'.
append gs_container to gt_container.
gs_container-element = 'requisition'.
gs_container-value = '0010000362'.
append gs_container to gt_container.
gs_container-element = 'RequisitionHeader '.
gs_container-value = '0010000362'.
append gs_container to gt_container.
ls_objkey = '0010000362'.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS2009'
object_key = ls_objkey
event = 'RELEASESTEPCREATED'
TABLES
input_container = gt_container
MESSAGE_LINES = lt_mesage.
As you can see i filled he RequisitionHeader, requisition and release code. I saw in the workflow that i copied, that these are import parameters. Requisition and release code are mandatory. 0010000362 is a purchase requisition that i created.
After i run the program i receive a work item in SBWP but it has the status error.
Can you help me?Perhaps anyone has done this. I think that i am not filling the correct data or something like that. Maybe you can look in the standard workflow WS00000038 and tell me what I should pass and how.
Thank you,
Efren
Hi Efren,
In the export parameter 'object_key' of function module SAP_WAPI_CREATE_EVENT, you should pass the Purchase requisition number.
As its a key field you should pass it to the workflow to instantiate the business object.
What error you got in the work flow? Workflow is triggered or not?
Thanks,
Viji.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Efren,
The Problem is, for the purchase requisition there is two key fields.
So when you pass the keyfiled to workflow it should be the concatenation of Purchanse requisition number and the item number.
You have to pass the object key as below.
ls_objkey = '00100003620010'.
Then only your business object will getting insatanciated.
Thanks,
Viji.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.