DX_FILE_COPY is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name DX_FILE_COPY into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
DX_FILE
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'DX_FILE_COPY' "
EXPORTING
objecttype = " tdxloadp-objecttype Object Type
progtype = " tdxloadp-progtype Program Type
progname = " tdxloadp-progname Data transfer program/method
v_ds_name = " dxfile-filename
* v_ds_type = 'P' " dxfile-filetype
* v_data_app = 'X' " xflag
* v_server = " msxxlist-name
* v_data_frn = ' ' " xflag
n_ds_name = " dxfile-filename
* n_ds_type = 'P' " dxfile-filetype
* n_data_app = 'X' " xflag
* n_data_frn = ' ' " xflag
* n_server = " msxxlist-name
* v_pc_file = " rlgrap-filename
* n_pc_file = " rlgrap-filename
* fix2fix = 'X' " dxcopync
* fix2deli = ' ' " dxcopyfd
* deli2fix = ' ' " dxcopydf
EXCEPTIONS
CANCELED_BY_USER = 1 "
PROBLEMS_WITH_LOGICAL_FILENAME = 2 "
FILE_IS_USED = 3 "
UNKNOWN_OBJECT_LOADPRG = 4 "
ERROR_WITH_COPY = 5 "
DB_ERROR = 6 "
NO_AUTHORITY_TO_READ_FILE = 7 "
NO_AUTHORITY_TO_WRITE_FILE = 8 "
NO_AUTHORITY = 9 "
. " DX_FILE_COPY
The ABAP code below is a full code listing to execute function module DX_FILE_COPY including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).
SELECT single OBJECTTYPE
FROM TDXLOADP
INTO @DATA(ld_objecttype).
SELECT single PROGTYPE
FROM TDXLOADP
INTO @DATA(ld_progtype).
SELECT single PROGNAME
FROM TDXLOADP
INTO @DATA(ld_progname).
SELECT single FILENAME
FROM DXFILE
INTO @DATA(ld_v_ds_name).
SELECT single FILETYPE
FROM DXFILE
INTO @DATA(ld_v_ds_type).
DATA(ld_v_data_app) = 'Check type of data required'.
DATA(ld_v_server) = some text here
DATA(ld_v_data_frn) = 'Check type of data required'.
SELECT single FILENAME
FROM DXFILE
INTO @DATA(ld_n_ds_name).
SELECT single FILETYPE
FROM DXFILE
INTO @DATA(ld_n_ds_type).
DATA(ld_n_data_app) = 'Check type of data required'.
DATA(ld_n_data_frn) = 'Check type of data required'.
DATA(ld_n_server) = some text here
DATA(ld_v_pc_file) = some text here
DATA(ld_n_pc_file) = some text here
DATA(ld_fix2fix) = 'Check type of data required'.
DATA(ld_fix2deli) = 'Check type of data required'.
DATA(ld_deli2fix) = 'Check type of data required'. . CALL FUNCTION 'DX_FILE_COPY' EXPORTING objecttype = ld_objecttype progtype = ld_progtype progname = ld_progname v_ds_name = ld_v_ds_name * v_ds_type = ld_v_ds_type * v_data_app = ld_v_data_app * v_server = ld_v_server * v_data_frn = ld_v_data_frn n_ds_name = ld_n_ds_name * n_ds_type = ld_n_ds_type * n_data_app = ld_n_data_app * n_data_frn = ld_n_data_frn * n_server = ld_n_server * v_pc_file = ld_v_pc_file * n_pc_file = ld_n_pc_file * fix2fix = ld_fix2fix * fix2deli = ld_fix2deli * deli2fix = ld_deli2fix EXCEPTIONS CANCELED_BY_USER = 1 PROBLEMS_WITH_LOGICAL_FILENAME = 2 FILE_IS_USED = 3 UNKNOWN_OBJECT_LOADPRG = 4 ERROR_WITH_COPY = 5 DB_ERROR = 6 NO_AUTHORITY_TO_READ_FILE = 7 NO_AUTHORITY_TO_WRITE_FILE = 8 NO_AUTHORITY = 9 . " DX_FILE_COPY
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ENDIF.
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_objecttype | TYPE TDXLOADP-OBJECTTYPE , |
| ld_progtype | TYPE TDXLOADP-PROGTYPE , |
| ld_progname | TYPE TDXLOADP-PROGNAME , |
| ld_v_ds_name | TYPE DXFILE-FILENAME , |
| ld_v_ds_type | TYPE DXFILE-FILETYPE , |
| ld_v_data_app | TYPE XFLAG , |
| ld_v_server | TYPE MSXXLIST-NAME , |
| ld_v_data_frn | TYPE XFLAG , |
| ld_n_ds_name | TYPE DXFILE-FILENAME , |
| ld_n_ds_type | TYPE DXFILE-FILETYPE , |
| ld_n_data_app | TYPE XFLAG , |
| ld_n_data_frn | TYPE XFLAG , |
| ld_n_server | TYPE MSXXLIST-NAME , |
| ld_v_pc_file | TYPE RLGRAP-FILENAME , |
| ld_n_pc_file | TYPE RLGRAP-FILENAME , |
| ld_fix2fix | TYPE DXCOPYNC , |
| ld_fix2deli | TYPE DXCOPYFD , |
| ld_deli2fix | TYPE DXCOPYDF . |
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name DX_FILE_COPY or its description.