Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Starting new foreground sessions from ABAP program.

Former Member
0 Kudos

I am trying to start multiple foreground sessions from a 'driver' module asynchronously.

I have tried various forms of the call transaction, submit report and wrapping the code in a function module that I have called asynchronously. The function module will start an independent session, but as a background task instead of foreground one.

Anyone have any ideas or tried this before?

Thanks.

2 REPLIES 2

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you can do it like this.




report zrich_0001.

data: session_name type string.


do 3 times.

  session_name = sy-index.


  call function 'ABAP4_CALL_TRANSACTION'
      starting new task session_name
          destination 'NONE'
               exporting
                 tcode                         = 'SM50'
               exceptions
                 call_transaction_denied       = 1
                 tcode_invalid                 = 2
                 others                        = 3.

enddo.

Regards,

Rich Heilman

0 Kudos

Hi Rich,

Sorry about the lag in my response. The place I work shuts down over XMAS and I took some extra vacation.

I tried the function module you suggested. It works with the Dialog transactions I tried it with. I had tried doing something similar with a function module I wrote, ie using a call transaction in the function module, as well as using a submit report and recording the execution of the report in a BDC and wrapping it a function module and calling it asynchronously. None of them work, although the asynchronous call opens a new session. All I can figure is reports, ABAP or Painter, work different than the Dialog?

Any other ideas.

Thanks, Russ.