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 an external application by pushing a button

Former Member
0 Likes
499

Hello,

I have added a button inside the transaction MM02/MM03.

This Button is as extention for my needs.

But, what I can't do, if when I push the button it should start whether a transaction that call an external program or call directly an external program.

(Button was created by the screen painter)

I used a module inside the PAI,

this module is like this.

MODULE appexternal INPUT.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'mybutton'.

CALL TRANSACTION 'ZEXTERNAL'.

ENDCASE.

ENDMODULE.

The problem, if I click on that button it don't call the transaction but rather show me a screen,

which is to save the data.

My needs, I want to call the external program without leaving the screen of MM02.

And so the external application is showen and I can return working on my material.

Later the materialnumber should be sended the the external application to show it there.

Thanks for respond.

Regards,

Kais

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
439

I'm thinking that you want to start a new task when calling the transaction.

You can use this function to do so.

AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'MYBUTTON'.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
  STARTING NEW TASK 'newtask'
  exporting
    tcode                         = 'ZEXTERNAL'
*   SKIP_SCREEN                   = ' '
*   MODE_VAL                      = 'A'
*   UPDATE_VAL                    = 'A'
* IMPORTING
*   SUBRC                         =
* TABLES
*   USING_TAB                     =
*   SPAGPA_TAB                    =
*   MESS_TAB                      =
 EXCEPTIONS
   call_transaction_denied       = 1
   tcode_invalid                 = 2
   OTHERS                        = 3.

ENDCASE.

ENDMODULE.

Regards,

Rich Heilman

I'm thinking that you want to start a new task when calling the transaction.

You can use this function to do so.

AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'MYBUTTON'.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
  STARTING NEW TASK 'newtask'
  exporting
    tcode                         = 'ZEXTERNAL'
*   SKIP_SCREEN                   = ' '
*   MODE_VAL                      = 'A'
*   UPDATE_VAL                    = 'A'
* IMPORTING
*   SUBRC                         =
* TABLES
*   USING_TAB                     =
*   SPAGPA_TAB                    =
*   MESS_TAB                      =
 EXCEPTIONS
   call_transaction_denied       = 1
   tcode_invalid                 = 2
   OTHERS                        = 3.

ENDCASE.

ENDMODULE.

Regards,

Rich Heilman

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
440

I'm thinking that you want to start a new task when calling the transaction.

You can use this function to do so.

AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'MYBUTTON'.

CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
  STARTING NEW TASK 'newtask'
  exporting
    tcode                         = 'ZEXTERNAL'
*   SKIP_SCREEN                   = ' '
*   MODE_VAL                      = 'A'
*   UPDATE_VAL                    = 'A'
* IMPORTING
*   SUBRC                         =
* TABLES
*   USING_TAB                     =
*   SPAGPA_TAB                    =
*   MESS_TAB                      =
 EXCEPTIONS
   call_transaction_denied       = 1
   tcode_invalid                 = 2
   OTHERS                        = 3.

ENDCASE.

ENDMODULE.

Regards,

Rich Heilman