cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger WF manually ?

former_member190818
Active Contributor
0 Kudos

Hi,

Is there any possibility of triggering WF manually ?

I'm using RE Contract WF. They dont need to trigger wf when the contract is created. May be after sometime the user has to trigger the workflow. If we know the time we can put in Request Start Tab. But they may trigger at any time. May be they will change some values in contract at the time of triggering. The BO is BUS1505. There is no change event. I can create change event in SWEC. But the WF goes for various approvals. And everytime it gets change and it will trigger again and again. So i think change document wont work in this case.

Do anyone know to trigger wf manually ???

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. Yes, it is possible to trigger the workflow manually. Use SAP_WAPI_START_WORKFLOW.

2. However, you still need to have clarity on when exactly you wanted to start your workflow. As per your query below, may be you can develop a report with a call to above FM and give this transaction to user so that they can run it whenever they want. Put some good authorization checks to avoid misuse of this transaction.

Regards

Krishna Mohan

former_member190818
Active Contributor
0 Kudos

Hi Krishna,

When i test this FM, it returns the value for subrc as 4. The message is You are not one of the possible agents of task 'WS********'. How to make the user as possible agent.

And one more is when i use this FM, is it necessay to activate the linkage ???

Former Member
0 Kudos

Hi,

Yes, when we use this FM to start a workflow, we should make sure that the one who executing this FM is one of the possible agent of the workflow.

However In general, you can make your workflow as 'General' so that all users will be possible agents of the workflow.

You can make your workflow general by doing below: Go to PFTC -> give your workflow number -> Additional Data -> Classification -> Create and enable 'General Task'.

Reg your other question, event linkage comes into picture only when your workflow is event based workflow, meaning you have a triggering event defined for your workflow. Only in this case you need make sure event linkage is active. If your workflow is not an event based workflow, there is no point of event linkage.

Hope this helps you !!

Regards

Krishna Mohan

former_member190818
Active Contributor
0 Kudos

Hi Krishna,

I've given as General Task and now tat error is solved. But i got another error. The message was,

No status object is available for REC Undefined

Message no. BS001

Diagnosis

When trying to read the status of an object (REC Undefined), a system error occurred: For object number IS there is no status object.

I know about the event triggering. But i want to know when we are using this FM, do we need to activate event or not ? Is this FM needs event linkage activated ?

Answers (1)

Answers (1)

KKilhavn
Active Contributor
0 Kudos

If the Generic Object Services are available in your transaction there is no need to code anything to start the workflow. Define possible users (or make the task a generic task) - then users can simply choose Workflow => Start workflow in the GOS menu.

Sweet, isn't it? Generic Object Services are fantastic!

former_member190818
Active Contributor
0 Kudos

Hi Kilhavn,

Generic Object Service is that which is there in Title bar. Is it so ?

If yes, i don find any workflow there. I've given General Task in PFTC.

I think i can write an program calling the FM SWE_CREATE_EVENT and the user can run that program whenever he needs to trigger WF.

Former Member
0 Kudos

yaa that you can do or you can simply use FM

SAP_WAPI_START_Workflow in that program.

Thanks

Arghadip

former_member190818
Active Contributor
0 Kudos

Hi Arghadip,

As i already mentioned if i use the FM SAP_WAPI_START_WORKFLOW, there is some error showing. The message i posted before itself. Check that message and say if u know the solution.

KKilhavn
Active Contributor
0 Kudos

Yes, GOS is the icon in the title bar.

You need to be a possible agent (General Task should solve that - have the buffers been refreshed?)

The workflow must take an object of the published type as (mandatory?) importing element - and it is possible there must not be any other mandatory importing elements.