cancel
Showing results for 
Search instead for 
Did you mean: 

Container element not available when task is background

Former Member
0 Kudos

Hi All,

We have a task and method. the method works fine when tested individually, returns the correct values.

However when the task is executed in background mode, the element in container is not updated. If the processing mode is foreground, the element is rightly updated in container.

Clearly it has nothing to do with binding since I get the elements when I execute the task in foreground.

any ideas would be welcome.

thanks,

Gautam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please do a binding of Business Object from Wflow Container -> task container element WI_OBJECT_ID and this issue will be resolved.

Thanks

Arghadip

Former Member
0 Kudos

Arghadip,

Can you please elaborate ? Is it to do something with the data type used in the method ?

Former Member
0 Kudos

No, It is to due with the binding from Workflow to Task. Please bind the Business Object that you are using in your Workflow to WI_OBJECT_ID to task and then test I think it will work.

Thanks

Arghadip

Former Member
0 Kudos

AK,

I have an element var1 type of tab-dat1 which is imported and var2 type of tab-dat2 which is returned from the method.

The bindings are also following the same 'type'.

So should I change those type ?

Former Member
0 Kudos

No, you should change the binding of Workflow to Task. Your method is getting executed from task. Go to PFTC->Workflow Template number->Workflow Builder->Identify the Step that is executing the Task-> Change the Binding from Workflow to Task.No changes is require for binding from Task to Method.

Thanks

Arghadip

Former Member
0 Kudos

Well the bindings are workign fine since I dont face any issues when running the process in foreground, its only when i execute in backend..

Former Member
0 Kudos

It seems that you are not aware of SAP Workflow. We are here to help you and if you are not following our comments then it means you are wasting our time. If binding was done then this issue would not have arised.

Thanks

Arghadip

Former Member
0 Kudos

I definitely dont know workflow as much as you do dude, but what I am trying to explain you is I have checked the bindings, they work fine when the WF is executed and the task is set as foreground..

Once I change the task to background and execute the WF, its not returning values...I went through other threads and figured out clearly it is not binding issue..

Former Member
0 Kudos

HI,

When you say, it's not picking up the cont. element in the background task, what do you mean..that cont. element is blank or the step is struck or completed but no value..Tell us what's happening when you run this as background task.

Also, did you check if you have all the necessary auth. for WF-BATCH ?. And, when you go to wflow log in the background task, expand it and see for the last process "Result Processing" by WF-BATCH, that is the last process of execution of a witem.

More Specific details would definitely help.

venu

Answers (2)

Answers (2)

Former Member
0 Kudos

Actually, I believe the problem is related to binding.

When called in the foreground, object references (and data references) are present in memory for all subsequent processing.

You probably need to make the CONTAINER "Persistent".

In your code, call the macro SWC_CONTAINER_TO_PERSISTENT <container name here>. For example:

SWC_CONTAINER local_container.

SWC_CREATE_CONTAINER local_container.

" Set you Container elements

" SWC_SET_ELEMENT local_container 'Element01' lv_element01.

" SWC_SET_TABLE local_container 'Element02' lt_table02.

SWC_CONTAINER_TO_PERSISTENT local_container.

" Start your workflow passing local_container.

Something like this...

Hope this is relevent . . . Apologies if not . . .

Regards,

Tom Carruth

Former Member
0 Kudos

Did you check the detailed workflow log for the background task's container ?

venu

Former Member
0 Kudos

Yes Venu, thats how I derived that its not picking up value when run in background but does pick up value in foreground, For now I have tried re implementing the method using FM. Any other ideas?