This website is not affiliated with, sponsored by, or approved by SAP AG.

Call purchase requisition approval workflow in abap program

Business WorkFlow

Moderators: Snowy, thx4allthefish

Call purchase requisition approval workflow in abap program

Postby efren23 » Tue May 24, 2011 12:51 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.

Code: Select all
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
Last edited by Gothmog on Wed May 25, 2011 1:29 am, edited 1 time in total.
Reason: code tags
efren23
 
Posts: 5
Joined: Fri Apr 15, 2011 12:58 am

Return to Business WorkFlow

Who is online

Users browsing this forum: No registered users and 1 guest





This website is not affiliated with, sponsored by, or approved by SAP AG.