用STARTING NEW TASK 方式调用函数ABAP4_CALL_TRANSACTION,会打开一个新的窗口(session)运行tcode。
函数ABAP4_CALL_TRANSACTION本质上是封装了CALL TRANSACTION
代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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. |
以上。
发表评论