cancel
Showing results for 
Search instead for 
Did you mean: 

Problem, that asynchronous method call opends up a new session

Former Member
0 Kudos

Dear Workflow Experts,

I have a problem, when calling an asynchronous method from another BOR object instance, as that always opens a new session and it's not processed with the same Workplace' session. So I need some help, if anyone has ideas, how to solve it.

Problem Description

Called method:     BUS2081.edit()    which is defined as "dialog" and "asynchronous"

Calling method:    ZWFINV.edit()    which is also defined as being "dialog" and "asynchronous"

Within the calling method, there's a switch, which business object is to be called, so subtyping the BUS2081.edit() method is not an option here.

The coding within the ZWFINV.edit() method is as following

 

BEGIN_METHOD EDIT CHANGING CONTAINER.

* ... some other stuff here

   swc_call_method_asynch bor_2081 'EDIT' container.

END_METHOD.

Now what happends, when I use a Workflow-Task, defined for ZWFINV.edit-Execution (also asynchronous dialog task) the workitem execution always opens a new session, in which the BUS2081.edit() method is processed.

Requested behaviour

I'd like to use the current session for the method execution.

Further information

A task that directly executes a BUS2081.edit() method is working fine, and no additional session is execute.

When I change the algorithm from within the ZWFINV.edit() method in a way, that the BUS2081.edit() method is called synchronously, I get another problem.

BEGIN_METHOD EDIT CHANGING CONTAINER.

* ... some other stuff here

   swc_call_method bor_2081 'EDIT' container.

END_METHOD.

Now instead nothing happends: A double click on the workitem does not execute the BUS2081.edit() method at all.

I also have no opportunity for a system-wide delegation, as the BUS2081 object is used at a different project, so I cannot extend or subtype it.

... and yes, I usually use ABAP-OO-Workflow, where all these problems don't exists ... and there're other one in return 🙂

Are there any ideas how to handle that?

With the very best wishes

   Florin

Accepted Solutions (1)

Accepted Solutions (1)

anjan_paul
Active Contributor
0 Kudos

Hi,

  I don't know, but please in ZWFINV.edit() , write the code

Call transaction MIR4 (it is written in BUS2081.EDIT)

and check it is workin or not

Former Member
0 Kudos

Hello Anjan,

yes, a direct call to transaction MIR4 is working as expected. In other words: If the coding is copied from the originally called method into the calling method, its working and no additional window opens.

As I'm calling different methods from different object types within the ZWFINV.edit() methods, I'd really like to avoid the coding-copy, as when the original method BUS2081.edit() would be redefined, the calling coding does not re-iterate the change of coding, when it was copied.

Thanks for checking

   Florin

anjan_paul
Active Contributor
0 Kudos

Hi,

  I understand, I think the problem is you are calling the asynchronous method sychronously from a
asynchronous method. Thats why it is not executin

Answers (0)