Created
July 12, 2019 12:26
-
-
Save captainabap/ce7700df0d14bb7ef6d296ad6fdb3014 to your computer and use it in GitHub Desktop.
Upload the transport files to the corresponding folders on the server. First select the K-File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"---------------------------------------------------------------------* | |
" Report Z_UPLOAD_TRANSPORT | |
"---------------------------------------------------------------------* | |
" select the K-File (e.g. K900028.A4H) in the file selection dialog. | |
"---------------------------------------------------------------------* | |
REPORT z_upload_transport. | |
DATA lt_filetable TYPE filetable. | |
DATA lv_rc TYPE i. | |
data lv_source_path type SAPB-SAPPFAD. | |
data lv_target_path type SAPB-SAPPFAD. | |
CALL METHOD cl_gui_frontend_services=>file_open_dialog | |
EXPORTING | |
window_title = 'Upload transport file' | |
file_filter = 'K*' | |
CHANGING | |
file_table = lt_filetable | |
rc = lv_rc | |
EXCEPTIONS | |
OTHERS = 5. | |
IF sy-subrc <> 0. | |
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno | |
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. | |
ENDIF. | |
read table lt_filetable into data(ls_file) index 1. | |
data(lv_path_length) = strlen( ls_file-filename ) - 11 . | |
lv_source_path = ls_file-filename. | |
data(lv_filename) = lv_source_path+lv_path_length(11). | |
lv_target_path = |/usr/sap/trans/cofiles/{ lv_filename }|. | |
CALL FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER' | |
EXPORTING | |
path = lv_source_path | |
TARGETPATH = lv_target_path | |
EXCEPTIONS | |
OTHERS = 3 . | |
IF sy-subrc <> 0. | |
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno | |
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. | |
ENDIF. | |
LV_SOURce_path+lv_path_length(1) = 'R'. | |
lv_filename(1) = 'R'. | |
lv_target_path = |/usr/sap/trans/data/{ lv_filename }|. | |
CALL FUNCTION 'ARCHIVFILE_CLIENT_TO_SERVER' | |
EXPORTING | |
path = lv_source_path | |
TARGETPATH = lv_target_path | |
EXCEPTIONS | |
OTHERS = 3 . | |
IF sy-subrc <> 0. | |
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno | |
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. | |
ENDIF. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment