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

workflow call from ABAP program

Business WorkFlow

Moderators: Snowy, thx4allthefish

workflow call from ABAP program

Postby toms3501 » Wed Mar 05, 2008 5:31 pm

I created a zbusiness object (ZPRODH)with
one key field product hierarchy,
one attribute level number and
one method display.

I tested that zobject and it is displaying it. now I created a workflow to display this and have to call it from one abap program.

In the abap program I am calling the funcion module, I need to pass the product hierarcy ( how can I pass it)
data: p_workitem LIKE SWR_STRUCT-WORKITEMID,
p_subrc like sy-subrc.

CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
TASK = 'WS99900007'
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE = p_subrc
WORKITEM_ID = p_workitem
but it is not working, can anybody tell me what is the issue. this is my first workflow. so I am not sure I am missing anything for not. Please help me

Thanks in advance
toms3501
 
Posts: 9
Joined: Fri Jun 23, 2006 12:57 pm
Location: US

Postby bucka » Thu Mar 06, 2008 3:38 am

Hi,

When you say not working what do you mean?
Is the workflow starting or is there errors after the Workflow fires off?
Kind Regards,

Ron Johns.

The older I get the better I was.
bucka
 
Posts: 291
Joined: Sat Jun 18, 2005 2:09 am
Location: Ballarat, Victoria, Australia

Postby bucka » Thu Mar 06, 2008 3:45 am

Hi,

You could also use the message Structure for debugging purposes...

TABLES
message_struct = lt_wf_error_tab.
Kind Regards,

Ron Johns.

The older I get the better I was.
bucka
 
Posts: 291
Joined: Sat Jun 18, 2005 2:09 am
Location: Ballarat, Victoria, Australia

workflow

Postby toms3501 » Thu Mar 06, 2008 10:49 am

when I ran this report, it is going throug the workflow, and subrc coming as 0, but the workflow is not triggering it out. When I check the SBWP, it is not there
toms3501
 
Posts: 9
Joined: Fri Jun 23, 2006 12:57 pm
Location: US

Postby maorriyan » Fri Mar 14, 2008 11:59 am

Have you check your workflow log?
Try to make "general task" in your workflow
maorriyan
 
Posts: 38
Joined: Thu Jun 19, 2003 10:46 am

Re: workflow call from ABAP program

Postby ssii » Sun Mar 23, 2008 7:36 am

Workflow should be started by triggering event.

so you should define an event in your Zobject et then trigger this event in your report. The workflow will start if it's linked to the event.
SSII is back
ssii
 
Posts: 222
Joined: Sat Nov 11, 2006 9:57 am
Location: France

Re: workflow call from ABAP program

Postby new2sapfans » Sat Jan 31, 2009 2:20 pm

Sorry for resurrecting an old thread,
but I am in this exact situation.

I created a role to which an user was assigned (other than myself, or current sy-uname).
I want a workflow to be started by any user who executes a ABAP report, and then
the user assigned in the "role" to get a user decision in his Biz Workplace.

I created my first WF, which had nothing but a User Decision.

I tried to trigger the workflow from a ABAP report using SAP_WAPI_START_WORKFLOW, but it was giving
an error - WZ(713) You are not one of the possible agents of task '&1'

So, as per this thread I tried to create an event in my Z business object, and defined that as the Triggering event in my workflow header.
I programmatically triggered the event in my ABAP report via SAP_WAPI_CREATE_EVENT,
I get an event id back in my ABAP (and also WZ(736) Event created - at least one receiver found)
but now when I call SAP_WAPI_START_WORKFLOW, I get the same error WZ(713) You are not one of the possible agents of task '&1'


Can someone please help?
new2sapfans
 
Posts: 71
Joined: Thu Jan 01, 2009 11:01 am

Re: workflow call from ABAP program

Postby new2sapfans » Tue Feb 03, 2009 10:35 pm

I got to triggering the WF using SWE_EVENT_CREATE, but now my first task (user decision) is ending in an error.
I had defined a new role using PFCG, and assigned one user to the role.
But SWI1 shows that my workflow ended in ERROR because "No Agent Available"

I even tried assigning the workflow initiator as the the Agent for my task, yet my SWI1 shows "No Agent Available" :-(

Can anyone pls help?
new2sapfans
 
Posts: 71
Joined: Thu Jan 01, 2009 11:01 am

Re: workflow call from ABAP program

Postby harishkollipara » Sun Jan 10, 2010 11:50 pm

Even I tried using this the above mentioned Function module for calling a workflow through a report program.
When I give a sy-subrc after executing the FM,it is successful,but thw given workflow is not being triggered.
Please help.

Harish Kollipara
harishkollipara
 
Posts: 2
Joined: Tue Nov 24, 2009 12:52 am


Return to Business WorkFlow

Who is online

Users browsing this forum: No registered users and 2 guests





loading...


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