cancel
Showing results for 
Search instead for 
Did you mean: 

how to execute background task as a user rather than wf-batch?

Former Member
0 Kudos

Hi Folks,

We have a situation whereby wf-batch used to exeute a background task which was assigned a z method in a BO.  This method simulated a pre-hire in pa40 and so executes hr_maintain_masterdata.

This process used to work fine, but something has changed in the system and the FM now returns an error when wf-batch tries to execute (start date before initial entry date).  It should be noted that when a user executes this method, the pre-hire is completed without incident.

So looking on this site, I found a blog where nabheet madan states:

Change user name of WF-BATCH which is posting a document in background to the user who lastly approved the release. .In those cases we can bind back the actual agent who executed the previous work item and change the background task to dialog task with advance with dialog set. The workflow system will use the correct user to execute the following step without interrupting it .

Any ideas on how to achieve this?  I have tried passing wf-initiator as the actual agent and have unticked background processing on the task but in swia it is hanging as no agent is assigned.

How can I get around this issue?

Thanks in advance,

Liz.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

WF-Batch was missing parameters.  Once these added, workflow working as expected.

former_member185167
Active Contributor
0 Kudos

Hello,

Good to hear it was fixed but which parameters were these? I can't think what you mean.

If someone else fixed it, make sure you find out exactly what they did and then please post it here - it could be useful for others.

regards

Rick

Answers (2)

Answers (2)

former_member185167
Active Contributor
0 Kudos

Hello,

WF-BATCH is for the background jobs, there is no point in running this as a different user.

I predict you will have the same problem if you manage to do so, so you would be better off trying to figure out why it happens for WF-BATCH. Does it have SAP_ALL and SAP_NEW?

regards

Rick Bakker / hanabi technology

Former Member
0 Kudos

Hi Rick,

I have checked and wf-batch has both those roles assigned.

Thanks,

Liz.

Former Member
0 Kudos

Hi Rick,

We used to be able to this but after an upgrade we can no longer do the infinite loop sm50 debug unfortunately.

Thanks,

Liz.

former_member185167
Active Contributor
0 Kudos

Hi Liz,

Really? Which upgrade? What happens when you try the infinite loop trick?

Here's another way:

SE38 > Utilities > Settings > Debugging

You can set the userid you want to debug for. This includes background

users like WF-BATCH. It will stop on any 'external breakpoint' you then set.

regards

Rick

SandySingh
Active Contributor
0 Kudos

Hi Liz,

Is there any dumps in Transaction ST22 logged under WF-BATCH user ID. Could you specify what sort of dump or error message is encountered.

Regards

Sandy

Former Member
0 Kudos

Hi Sandy,

There are no short dumps in st22 for wf-batch.  The error returned is from the execution of my z function module which calls FM hr_maintain masterdata and it states "start date after initial entry date".

if a user executes this same fm, it completes without incident.

Thanks,

Liz.

former_member185167
Active Contributor
0 Kudos

Hello,

I would put an infinite loop in the z method and then use SM50 to attach to it and debug it.

regards

Rick