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: 

Calling Transaction in a new session

muralidhar2796
Explorer
0 Kudos

Hi All,

I have a requirement wherein the scenario is 'I am in a standard transaction code say VA03 and i placed an option/button kind of thing in 'Help' menu bar. When i click on that option i call a custom transaction which should open in a separate session without killing the VA03' The thing is i tried with all possible standard FMs. What is happening is that the custom transaction opens in a new session but the standard VA03 gets killed and it automatically goes to home screen.

FMs i tried using:

ABAP4_CALL_TRANSACTION

CKEKUTIL_CALL_TRANSACTION_TASK

COPF_CALL_TRANSACTION

RFC_CALL_TRANSACTION_USING

CC_CALL_TRANSACTION_NEW_TASK

BDC_OPEN_GROUP

SAPGUI_SET_FUNCTIONCODE

and also CALL TRANSACTION(both normal and static method of a predefined class) and LEAVE TO TRANSACTION.

PS: I dont want to pass any value between the screens. The thing is custom transaction should open in a new session and standard screen should remain the same

Thanks and Regards,

Muralidhar BA

1 ACCEPTED SOLUTION

gabmarian
Active Contributor

What you can do is to use an RFC capable function module and call it thru aRFC:

CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'MYTCODE'
    EXPORTING
      tcode = 'MYTCODE'

The dialog handling of RFC calls is documented here.

11 REPLIES 11

gabmarian
Active Contributor

What you can do is to use an RFC capable function module and call it thru aRFC:

CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'MYTCODE'
    EXPORTING
      tcode = 'MYTCODE'

The dialog handling of RFC calls is documented here.

0 Kudos

Hi Gabor and Sandra,

I just tried the same. It works the same way as i mentioned. If you can help me with any other way, it would be great.

Thanks,

Muralidhar

0 Kudos

Hi Muralidhar,

I executed FM 'SAPGUI_SET_FUNCTIONCODE' in SE37, a new session is created for va03 .

    CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
      EXPORTING
        functioncode           = '/OVA03'
      EXCEPTIONS
        function_not_supported = 1
        OTHERS                 = 2.<br>

There is no authorization control with SAPGUI_SET_FUNCTIONCODE, you should check if SAP really control the authorization on the tcode before using it

gabmarian
Active Contributor
0 Kudos

muralidhar2796

Could you share the code you tried and in what exit you were using it?

0 Kudos

This is the one..

0 Kudos

Muralidhar, I just copy pasted your code and it works fine for me..

gabmarian
Active Contributor
0 Kudos

muralidhar2796

Do you call it from a user exit of VA03? So it does open the new external session but it goes back to the session manager in the original session?

0 Kudos

I called it from the menu bar with an extra option placed in Help menu using menu painter..

Sandra_Rossi
Active Contributor

You just need CALL TRANSACTION 'XXXX' (almost all the FMs you mention simply do that) to call another transaction as a new "internal session" over the internal session of VA03, but in the same "external" session. But if the called transaction does something like LEAVE TO TRANSACTION or SUBMIT without AND RETURN, that will reset all existing internal sessions in the current external session (and will "kill VA03").

The solution is to start the transaction in a new external session by using aRFC as explained by Gábor Márián.

DoanManhQuynh
Active Contributor
0 Kudos

if you create a dynpro screen, over there you call needed transaction code. and from VA03 you call your custom screen as pop-up for example, i think you will have what you want...