Run Host Command from ABAP code.
REPORT hostcommand.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN PUSHBUTTON /10(10) bt_calc USER-COMMAND calc.
SELECTION-SCREEN PUSHBUTTON /10(10) bt_word USER-COMMAND word.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
MOVE 'Calculator' TO bt_calc.
MOVE 'MS Word' TO bt_word.
START-OF-SELECTION.
END-OF-SELECTION.
AT SELECTION-SCREEN.
CASE sy-ucomm.
" Calculator
WHEN 'CALC'.
CALL FUNCTION 'GUI_RUN'
EXPORTING
command = 'CALC.EXE'.
" MS Word
WHEN 'WORD'.
CALL FUNCTION 'GUI_RUN'
EXPORTING
command = 'winword.EXE'.
ENDCASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |