cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow-Background task in In-Process status

Former Member
0 Kudos

Dear All,

We have been using event based custom workflow to set the usage decision of inspection lot automatically and to create TO for the TR's.

It is a background task and delegated the std BUS2045 with the custom objects and methods.

It is working perfectly in the sandbox environment.

But it is not working in Development environment, in which the background task is not getting completed and showing the status In-process.

It completed the first step of the task (automatic usage decision), but its not creating the TO from TR. I have read many forums and tried to trace the problem. Its working perfectly if i run it in foreground task. I have verified the workflow configurations by 'Verification workflow in SWU3'.

Did anyone face problem like this??

Thanks & Regards,

Arun.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Dear All,

The Problem is solved and is due to the default printer assignment to the WF-BATCH user.

In Sandbox, the TO printing form is SAP script and in development environment, we changed that to smartform, which expects the default printer.

Thanks Rick and others for the prompt response.

Whats the role of default printer in printing object in background process? for Transfer order, already we will maintain the printer location.

Even while sending the PO as PDF output in email, there will be no content in the email PDF attachment if the default printer is not set in the user profile parameters.

Thanks & Regards,

Arun Prasath Kumar.

suresh_subramanian2
Active Contributor
0 Kudos

Hello Arun !

          You've asked the following question:

                    "Whats the role of default printer in printing object in background process?"

            

          Answer for this question is master data will always bite you.

Regards,

S.Suresh. 

former_member185167
Active Contributor
0 Kudos

Hi Arun,

Thanks for following up and congratulations on solving the problem.

As per Susan's blog, did you ever see the default printer in an error message anywhere?

Could you verify what the situation was:

- WF-BATCH did not have a default printer set

- background task remained In Process

- you set the default printer (to what, exactly?) and now the background task is okay

Is that correct?

regards

Rick

Former Member
0 Kudos

Hi Suresh,

Thanks for sharing the link.

Hi Rick,

I did not get any error message anywhere in the workflow.  Yes, you are absolutely correct.

Actually in my case, i checked the default printer configuration also. But I didn't bother much about that, as it was working fine in Sandbox environment without this default printer. Then only came to know the twist the printing form was SAP Script in Sandbox and Smart form in Development environment.

Thanks,

Arun Prasath Kumar.

keohanster
Active Contributor
0 Kudos

Hi Rick,

In my case, the error which caused the workflow to fail (when run under WF-BATCH) was:

When I changed the default printer to LP01 for WF-BATCH, everything went along smoothly.

The most frustrating thing was that if I debugged thru this Smartform/PDF generation task, I would NOT get the error message, and everything went along just fine.

former_member185167
Active Contributor
0 Kudos

Thanks Sue!

Rushikesh_Yeole
Contributor
0 Kudos

Hvae you checked runtime errors ST22? mostly due to runtime errors, task is remains in process. Just try to complete manually that task and check results. U will get idea of fault.

former_member16044
Active Participant
0 Kudos

Hi Arun,

The background task might be doing some update using BAPI or fetching the info using BAPI and when you do the stand alone test, the BO method may give you the proper results. Try to involve some delay so that the information is available(but this will pose a performance threat).

And in case you are using a BDC recording in the method, ensure that the mode is background.

Regards,

Rahul Kulkarni

suresh_subramanian2
Active Contributor
0 Kudos

Hello Arun !

          Is this background method behaves as expected when it is tested in SWO1 transaction ?

          If yes, check this method is asynchronous method.

Regards,

S.Suresh.

Former Member
0 Kudos

Hi Suresh,

Background task is working fine in SWO1 transaction and the method associated is synchronous only.

When i checked the graphical log in the sandbox and development environment, i found the following differences,

1. Workflow will start by triggering event, but it is starting from the default 'Workflow started task' in DEV. In Sandbox enviroment, it is starting from the event task.

2. Also the receiver type- object key is not available in the custom event, when i checked the event trace in SWEL.

3. There are only 2 steps(Background task started, (Sub) workflow item created) in the step history of DEV environment, when i checked the log. but in Sandbox, there are 4 tasks(Start Event received, (Sub) Workflow created, workflow started, Work item processing complete).

I want to know, why this workflow is not started from the 'Event triggered step'.

I checked the event linkage(SWE2), PFTC triggering event etc..

Thanks & Regards

Arun Prasath.

suresh_subramanian2
Active Contributor
0 Kudos

Hello Arun !

          You've spotted some differences in sand box and development system.

          Incorporate changes in development system suct that it reflects the configurations maintained in sand box for this workflow.

          Trigger the workflow via event. To trigger the event, maintain the proper configurations as in sand box. In addition, make sure event binding is perfect. Also, ensure the all required parameters  passed through binding for the back ground task to attain successful execution.

Regards,

S.Suresh.

Former Member
0 Kudos

Hi Suresh & Rick,

I have compared the workflow in both the systems, even then i couldn't able to make out any difference.

Could you please tell me the mandatory configurations in SWU3?

Thanks & Regards

Arun Prasath Kumar.

former_member185167
Active Contributor
0 Kudos

Hello,

Does the verification workflow work if you choose the execute in background option?

regards

Rick

Former Member
0 Kudos

Hi Rick,

Verification workflow is working fine.

I just changed the background task to Dialog in SWO1, PFTC task and assigned myself as agent in SWDD. I tested the same scenario, it came to my inbox for decision. When i gave the decision, it worked fine without any errors.

But its not working fine, when i run it as background task with the WF-BATCH user.

Thanks & Regards

Arun Prasath Kumar.

former_member185167
Active Contributor
0 Kudos

Hi Arun,

What does the background task do?

Did you look in ST22, as suggested above?

regards

Rick Bakker

Former Member
0 Kudos

Hi Rick,

There are no dumps in ST22.

Background task will perform two process.

1. Automatic usage decision of the inspection lot using BAPI_INSPLOT_SETUSAGEDECISION.

2. Automatic creation of TO from TR using the Function module, 'L_TO_CREATE_TR'.

Here first step is working fine and its not creating the TO automatically in background task. The workflow overview in QA03 inspection lot shows that its still in in process.

When i checked the events in SWEL, my custom event is getting triggered,but there exists no work item & object key in the receiver type. If the workflow is started using the trigger event, it would have got the receiver parent work item.

Thanks & Regards

Arun Prasath Kumar.

former_member185167
Active Contributor
0 Kudos

Hello,

"When i checked the events in SWEL, my custom event is getting triggered,but there exists no work item & object key in the receiver type."

When does this custom event get created? Is this part of the background task?

regards

Rick

Rushikesh_Yeole
Contributor
0 Kudos

FM 'L_TO_CREATE_TR' directly throws errro if some thing is mising.

If it is custom method, then add in exception list of above FM as ERROR_MESSAGE = 7.

then trry.

otheriwse i will suggest debug the workflow in runtime. put a breatpoint in method.

suresh_subramanian2
Active Contributor
0 Kudos

Hello Arun !

           You've stated that background task under goes two process.

           I suppose, there is some dependency between first process and second process. In other words, some data has to be passed from first process to second process. Either no data or some missing data or data in improper format is passed to first process or second process.

           Ensure first process attains completion as expected i.e.,  with necessary data for successful execution of second process.

          In addition, check whether any terminating events has to be raised for successful execution of this method. If so, check whether it is triggered with necessary parameters.

Regards,

S.Suresh.

Former Member
0 Kudos

Hi Rick,

I have created a custom BOR and delegated to the standard BUS2045. My workflow is event based and have given my custom event as tiggering event.

When the results recording for the inspection lot is done, which will trigger the events of the BUS2045 and my custom event. This custom event will start the workflow to perform the process.

Thanks ,

Arun Prasath.

former_member185167
Active Contributor
0 Kudos

Hi Arun,

Okay, your workflow with the problem is being started by a custom event.

You said:

"When i checked the events in SWEL, my custom event is getting triggered,but there exists no work item & object key in the receiver type."

And yet there must've been a workflow created, because otherwise you wouldn't have a workitem of In Process status. If you look in the workflow log, does it have an instance of the BUS2045 object?

regards

Rick

Former Member
0 Kudos

Hi Arun,

What's the purpose of the background job ?

  1. Check all bindings syntactically correct or not ?
  2. Any parameters missing on the background task binding ?
  3. Check complete workflow active versions including binding
  4. While updating database using this background task make sure any create or change transaction of the related document should not be in open mode..

Regards,

Ragav

former_member185167
Active Contributor
0 Kudos

Hello,

Check that WF-BATCH has SAP_ALL and SAP_NEW.

regards

Rick

Former Member
0 Kudos

Hi Rick,

We have given full authorizations SAP_ALL & SAP_NEW to the WF-BATCH user.

We are able to run the workflow. In the background task, one of the process 'Automatic usage decision' is happening, but the second process is 'Automatic TO creation; is not happening.

I have checked event linkages, task, workflow etc. I am not sure whether i have done the binding properly.

Is there any way to check whether i have binded container information correctly.

Thanks & Regards,

Arun Prasath Kumar.

former_member185167
Active Contributor
0 Kudos

Hello,

"Is there any way to check whether i have binded container information correctly."

I would compare the bindings on the system that works with the system that doesn't work.

Don't worry too much about the graphical log, look at the chronological log instead.

regards

Rick Bakker

Former Member
0 Kudos

Many Thanks