在需要把一个系统的程序打包下载时,我们可能会考虑使用SAPLINK等工具,但在使用中会发现这些工具总会有一些限制不能完全的打包我们开发的内容,比如SAPLINK不能下载DMEE,接口, STRANS等一些内容 ,经测试,使用请求号打包打包下载,才是最完美的解决办法,
在使用时,先找到要下载内容的请求号,或者自己重新打包一个请求号来包含所有需要打包下载的内容,并释放。然后再运行程序下载,之后使用程序上载。
打包生成请求号可以查询这里。
此程序原理为,在请求号释放后,会把请求号的内容放在SAP的文件目录,以便用于传输时使用,这就是我们要的文件了。
1.手动下载方法
一、AL11找释放的请求号所在的路径及文件名
二、CG3Y将请求号文件导到本地
2.程序下载、上载
1、请求号内容下载
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
*&********************************************************************* *& PROGRAM NAME : YRS_DOWNLOAD_TRANSPORT_REQUEST *& Module Name : *& Apply Author : *& Author : *& Started on : 2020-07-01 *& Transaction : YRS_DOWNLOAD_TRANSPORT_REQUEST *& Program type : Report *& Program ID : YRS_DOWNLOAD_TRANSPORT_REQUEST *& Program Description : 功能描述。。。。。。 *&*&******************************************************************* *& REVISION LOG * *& * *& LOG# DATE AUTHOR DESCRIPTION * *& ---- ---- ------ ----------- * *& 0001 2020-07-01 XXX Initial Creation *&********************************************************************* REPORT YRS_DOWNLOAD_TRANSPORT_REQUEST PARAMETERS: P_REQEST TYPE TRKORR OBLIGATORY, P_FOLDER(255) TYPE C LOWER CASE, P_SEPR OBLIGATORY. DATA: FOLDER TYPE STRING, RETVAL LIKE TABLE OF DDSHRETVAL WITH HEADER LINE, FLDVALUE LIKE HELP_INFO-FLDVALUE, TRANSDIR TYPE TEXT255, FILENAME(255), TRFILE(20) TYPE C, * datatab TYPE TABLE OF text8192 WITH HEADER LINE, BEGIN OF DATATAB OCCURS 0, TEXT(8192) TYPE X, END OF DATATAB, LEN TYPE I, FLEN TYPE I. TYPE-POOLS: SABC, STMS, TRWBO. INITIALIZATION. CONCATENATE SY-SYSID 'K*' INTO P_REQEST. IF SY-OPSYS = 'Windows NT'. P_SEPR = '\'. ELSE. P_SEPR = '/'. ENDIF. * CALL FUNCTION 'WSAF_BUILD_SEPARATOR' * IMPORTING * separator = p_sepr * EXCEPTIONS * separator_not_maintained = 1 * wrong_call = 2 * wsaf_config_not_maintained = 3 * OTHERS = 4. * * IF sy-subrc NE 0. * MESSAGE s001(00) * WITH * 'Unable to find out the separator symbol for the system.'(011). * ENDIF. AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_REQEST. DATA: TT_SYSTEM TYPE TABLE OF TMSCSYS WITH HEADER LINE, ES_SELECTED_REQUEST TYPE TRWBO_REQUEST_HEADER, ES_SELECTED_TASK TYPE TRWBO_REQUEST_HEADER, IV_ORGANIZER_TYPE TYPE TRWBO_CALLING_ORGANIZER, IS_SELECTION TYPE TRWBO_SELECTION. IV_ORGANIZER_TYPE = 'W'. IS_SELECTION-REQSTATUS = 'R'. CALL FUNCTION 'TR_PRESENT_REQUESTS_SEL_POPUP' EXPORTING IV_ORGANIZER_TYPE = IV_ORGANIZER_TYPE IS_SELECTION = IS_SELECTION IMPORTING ES_SELECTED_REQUEST = ES_SELECTED_REQUEST ES_SELECTED_TASK = ES_SELECTED_TASK. P_REQEST = ES_SELECTED_REQUEST-TRKORR. AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FOLDER. DATA: TITLE TYPE STRING. TITLE = 'Select target folder'(005). CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE EXPORTING WINDOW_TITLE = TITLE CHANGING SELECTED_FOLDER = FOLDER EXCEPTIONS CNTL_ERROR = 1 ERROR_NO_GUI = 2 OTHERS = 3. CALL FUNCTION 'CONTROL_FLUSH' EXCEPTIONS CNTL_SYSTEM_ERROR = 1 CNTL_ERROR = 2 OTHERS = 3. P_FOLDER = FOLDER. AT SELECTION-SCREEN ON P_REQEST. DATA: REQUEST_INFO TYPE STMS_WBO_REQUEST, REQUEST_INFOS TYPE STMS_WBO_REQUESTS. REFRESH REQUEST_INFOS. CALL FUNCTION 'TMS_MGR_READ_TRANSPORT_REQUEST' EXPORTING IV_REQUEST = P_REQEST IV_HEADER_ONLY = 'X' IMPORTING ET_REQUEST_INFOS = REQUEST_INFOS EXCEPTIONS READ_CONFIG_FAILED = 1 TABLE_OF_REQUESTS_IS_EMPTY = 2 SYSTEM_NOT_AVAILABLE = 3 OTHERS = 4. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. CLEAR REQUEST_INFO. READ TABLE REQUEST_INFOS INTO REQUEST_INFO INDEX 1. IF SY-SUBRC NE 0 OR REQUEST_INFO-E070-TRKORR IS INITIAL. MESSAGE E398(00) WITH 'Request'(006) P_REQEST 'not found'(007). ELSEIF REQUEST_INFO-E070-TRSTATUS NE 'R'. MESSAGE E398(00) WITH 'You must release request'(008) REQUEST_INFO-E070-TRKORR 'before downloading'(009). ENDIF. START-OF-SELECTION. FOLDER = P_FOLDER. CONCATENATE P_REQEST+3(7) '.' P_REQEST(3) INTO TRFILE. CALL FUNCTION 'RSPO_R_SAPGPARAM' EXPORTING NAME = 'DIR_TRANS' IMPORTING VALUE = TRANSDIR EXCEPTIONS ERROR = 0 THERS = 0. PERFORM COPY_FILE USING 'cofiles' TRFILE. TRFILE(1) = 'R'. PERFORM COPY_FILE USING 'data' TRFILE. TRFILE(1) = 'D'. PERFORM COPY_FILE USING 'data' TRFILE. *---------------------------------------------------------------------* * FORM copy_file * *---------------------------------------------------------------------* * --> SUBDIR * * --> FNAME * *---------------------------------------------------------------------* FORM COPY_FILE USING SUBDIR FNAME. DATA: AUTH_FILENAME TYPE AUTHB-FILENAME, GUI_FILENAME TYPE STRING. CONCATENATE TRANSDIR SUBDIR FNAME INTO FILENAME SEPARATED BY P_SEPR. REFRESH DATATAB. CLEAR FLEN. AUTH_FILENAME = FILENAME. CALL FUNCTION 'AUTHORITY_CHECK_DATASET' EXPORTING ACTIVITY = SABC_ACT_READ FILENAME = AUTH_FILENAME EXCEPTIONS NO_AUTHORITY = 1 ACTIVITY_UNKNOWN = 2 OTHERS = 3. IF SY-SUBRC <> 0. FORMAT COLOR COL_NEGATIVE. WRITE: / 'Read access denied. File'(001), FILENAME. FORMAT COLOR OFF. EXIT. ENDIF. OPEN DATASET FILENAME FOR INPUT IN BINARY MODE. IF SY-SUBRC NE 0. FORMAT COLOR COL_TOTAL. WRITE: / 'File open error'(010), FILENAME. FORMAT COLOR OFF. EXIT. ENDIF. CLEAR FLEN. DATA: MLEN TYPE I. MLEN = 8192. DO. CLEAR LEN. READ DATASET FILENAME INTO DATATAB MAXIMUM LENGTH MLEN LENGTH LEN. FLEN = FLEN + LEN. IF LEN > 0. APPEND DATATAB. ENDIF. IF SY-SUBRC NE 0. EXIT. ENDIF. ENDDO. CLOSE DATASET FILENAME. CONCATENATE P_FOLDER '\' FNAME INTO GUI_FILENAME. CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD EXPORTING BIN_FILESIZE = FLEN FILENAME = GUI_FILENAME FILETYPE = 'BIN' CHANGING DATA_TAB = DATATAB[] EXCEPTIONS FILE_WRITE_ERROR = 1 NO_BATCH = 2 GUI_REFUSE_FILETRANSFER = 3 INVALID_TYPE = 4 NO_AUTHORITY = 5 UNKNOWN_ERROR = 6 HEADER_NOT_ALLOWED = 7 SEPARATOR_NOT_ALLOWED = 8 FILESIZE_NOT_ALLOWED = 9 HEADER_TOO_LONG = 10 DP_ERROR_CREATE = 11 DP_ERROR_SEND = 12 DP_ERROR_WRITE = 13 UNKNOWN_DP_ERROR = 14 ACCESS_DENIED = 15 DP_OUT_OF_MEMORY = 16 DISK_FULL = 17 DP_TIMEOUT = 18 FILE_NOT_FOUND = 19 DATAPROVIDER_EXCEPTION = 20 CONTROL_FLUSH_ERROR = 21 OTHERS = 24. IF SY-SUBRC = 0. WRITE: / 'File'(002), FILENAME, 'downloaded. Length'(003), FLEN. ELSE. FORMAT COLOR COL_NEGATIVE. WRITE: / 'File download error. Filename:'(004), FILENAME. FORMAT COLOR OFF. ENDIF. ENDFORM . "copy_file |
2.请求号内容上载
隐藏内容需要支付:¥5
任何问题请联系yan252@163.com
任何问题请联系yan252@163.com