在新窗口调用Tcode[ABAP4_CALL_TRANSACTION]

STARTING NEW TASK 方式调用函数ABAP4_CALL_TRANSACTION,会打开一个新的窗口(session)运行tcode。

2017-02-28_18-00-48

函数ABAP4_CALL_TRANSACTION本质上是封装了CALL TRANSACTION

2017-02-28_18-04-12

代码:

REPORT ztest_open_tcode.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
  STARTING NEW TASK 'NEW_SESSION'
  EXPORTING
    tcode                   = 'SE38'
*   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.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

 

posted @ 2019-08-30 16:33  真的是很难  阅读(917)  评论(0编辑  收藏  举报