Application Development and Automation 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: 
Read only

Calling two transaction in one Zprogram

Former Member
0 Likes
640

How to call two transaction (MIGO and MIRO)with each transaction should display two different window simultaneously from one Zprogram..

Pls let me know ...

How to call two transaction (MIGO and MIRO)with each transaction should display two different window simultaneously from one Zprogram..

Pls let me know ...

4 REPLIES 4
Read only

Former Member
0 Likes
569

Hi arun,

1. Simple

2. this will open SE11, and SE37

(in TWO new windows, simultaneously)

(we can use any tcode)

3. Just copy paste

report abc.

CALL FUNCTION 'HLP_MODE_CREATE'

EXPORTING

TCODE = 'SE11'

USE_BATCH_INPUT = 'X'

.

CALL FUNCTION 'HLP_MODE_CREATE'

EXPORTING

TCODE = 'SE37'

USE_BATCH_INPUT = ''

.

regards,

amit m.

Read only

Former Member
0 Likes
569

You can even use as below for opening two session simultaneously.

CALL FUNCTION 'COPF_CALL_TRANSACTION'
  EXPORTING
    TCODE             = 'MIGO'
   NEW_SESSION       = 'X'          .

CALL FUNCTION 'COPF_CALL_TRANSACTION'
  EXPORTING
    TCODE             = 'MIRO'
   NEW_SESSION       = 'X'.

Kind Regards

Eswar

Read only

0 Likes
569

Here is another way.....



report zrich_0001.

call function 'ABAP4_CALL_TRANSACTION'
 starting new task 'TASK_MIGO'
  exporting
    tcode                         = 'MIGO'.



call function 'ABAP4_CALL_TRANSACTION'
 starting new task 'TASK_MIRO'
  exporting
    tcode                         = 'MIRO'.

Regards,

Rich Heilman

Read only

uwe_schieferstein
Active Contributor
0 Likes
569

Hello Arun

If you like to use an ABAP-OO version here is my approach:

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_CALL_TRANSACTION
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_call_transaction.


TYPE-POOLS: abap.


PARAMETERS:
  p_tcode      TYPE tcode.


START-OF-SELECTION.

  CALL FUNCTION 'AUTH_CHECK_TCODE'
    EXPORTING
      tcode                          = p_tcode
    EXCEPTIONS
      parameter_error                = 1
      transaction_not_found          = 2
      transaction_locked             = 3
      transaction_is_menu            = 4
      menu_via_parameter_transaction = 5
      not_authorized                 = 6
      OTHERS                         = 7.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL METHOD cl_reca_gui_services=>call_transaction
    EXPORTING
      id_tcode             = p_tcode
*      IF_LEAVE_CURRENT     = ABAP_FALSE
*      IF_SKIP_FIRST_SCREEN = ABAP_FALSE
       if_new_external_mode = abap_true  " new mode
    EXCEPTIONS
      error                = 1
      OTHERS               = 2.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

END-OF-SELECTION.

Regards

Uwe