SAP DX_FILE_COPY Function Module for









DX_FILE_COPY is a standard dx file copy SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for dx file copy FM, simply by entering the name DX_FILE_COPY into the relevant SAP transaction such as SE37 or SE38.

Function Group: DX_FILE
Program Name: SAPLDX_FILE
Main Program: SAPLDX_FILE
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function DX_FILE_COPY pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'DX_FILE_COPY'"
EXPORTING
OBJECTTYPE = "Object Type
* N_DS_TYPE = 'P' "
* N_DATA_APP = 'X' "
* N_DATA_FRN = ' ' "
* N_SERVER = "
* V_PC_FILE = "
* N_PC_FILE = "
* FIX2FIX = 'X' "
* FIX2DELI = ' ' "
* DELI2FIX = ' ' "
PROGTYPE = "Program Type
PROGNAME = "Data transfer program/method
V_DS_NAME = "
* V_DS_TYPE = 'P' "
* V_DATA_APP = 'X' "
* V_SERVER = "
* V_DATA_FRN = ' ' "
N_DS_NAME = "

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
.



IMPORTING Parameters details for DX_FILE_COPY

OBJECTTYPE - Object Type

Data type: TDXLOADP-OBJECTTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

N_DS_TYPE -

Data type: DXFILE-FILETYPE
Default: 'P'
Optional: Yes
Call by Reference: No ( called with pass by value option)

N_DATA_APP -

Data type: XFLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

N_DATA_FRN -

Data type: XFLAG
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

N_SERVER -

Data type: MSXXLIST-NAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

V_PC_FILE -

Data type: RLGRAP-FILENAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

N_PC_FILE -

Data type: RLGRAP-FILENAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIX2FIX -

Data type: DXCOPYNC
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

FIX2DELI -

Data type: DXCOPYFD
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

DELI2FIX -

Data type: DXCOPYDF
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

PROGTYPE - Program Type

Data type: TDXLOADP-PROGTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

PROGNAME - Data transfer program/method

Data type: TDXLOADP-PROGNAME
Optional: No
Call by Reference: No ( called with pass by value option)

V_DS_NAME -

Data type: DXFILE-FILENAME
Optional: No
Call by Reference: No ( called with pass by value option)

V_DS_TYPE -

Data type: DXFILE-FILETYPE
Default: 'P'
Optional: Yes
Call by Reference: No ( called with pass by value option)

V_DATA_APP -

Data type: XFLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

V_SERVER -

Data type: MSXXLIST-NAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

V_DATA_FRN -

Data type: XFLAG
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

N_DS_NAME -

Data type: DXFILE-FILENAME
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CANCELED_BY_USER -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PROBLEMS_WITH_LOGICAL_FILENAME -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

FILE_IS_USED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

UNKNOWN_OBJECT_LOADPRG -

Data type:
Optional: No
Call by Reference: Yes

ERROR_WITH_COPY -

Data type:
Optional: No
Call by Reference: Yes

DB_ERROR -

Data type:
Optional: No
Call by Reference: Yes

NO_AUTHORITY_TO_READ_FILE -

Data type:
Optional: No
Call by Reference: Yes

NO_AUTHORITY_TO_WRITE_FILE -

Data type:
Optional: No
Call by Reference: Yes

NO_AUTHORITY -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for DX_FILE_COPY Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_objecttype  TYPE TDXLOADP-OBJECTTYPE, "   
lv_canceled_by_user  TYPE TDXLOADP, "   
lv_n_ds_type  TYPE DXFILE-FILETYPE, "   'P'
lv_n_data_app  TYPE XFLAG, "   'X'
lv_n_data_frn  TYPE XFLAG, "   ' '
lv_n_server  TYPE MSXXLIST-NAME, "   
lv_v_pc_file  TYPE RLGRAP-FILENAME, "   
lv_n_pc_file  TYPE RLGRAP-FILENAME, "   
lv_fix2fix  TYPE DXCOPYNC, "   'X'
lv_fix2deli  TYPE DXCOPYFD, "   ' '
lv_deli2fix  TYPE DXCOPYDF, "   ' '
lv_progtype  TYPE TDXLOADP-PROGTYPE, "   
lv_problems_with_logical_filename  TYPE TDXLOADP, "   
lv_progname  TYPE TDXLOADP-PROGNAME, "   
lv_file_is_used  TYPE TDXLOADP, "   
lv_v_ds_name  TYPE DXFILE-FILENAME, "   
lv_unknown_object_loadprg  TYPE DXFILE, "   
lv_v_ds_type  TYPE DXFILE-FILETYPE, "   'P'
lv_error_with_copy  TYPE DXFILE, "   
lv_db_error  TYPE DXFILE, "   
lv_v_data_app  TYPE XFLAG, "   'X'
lv_v_server  TYPE MSXXLIST-NAME, "   
lv_no_authority_to_read_file  TYPE MSXXLIST, "   
lv_v_data_frn  TYPE XFLAG, "   ' '
lv_no_authority_to_write_file  TYPE XFLAG, "   
lv_n_ds_name  TYPE DXFILE-FILENAME, "   
lv_no_authority  TYPE DXFILE. "   

  CALL FUNCTION 'DX_FILE_COPY'  "
    EXPORTING
         OBJECTTYPE = lv_objecttype
         N_DS_TYPE = lv_n_ds_type
         N_DATA_APP = lv_n_data_app
         N_DATA_FRN = lv_n_data_frn
         N_SERVER = lv_n_server
         V_PC_FILE = lv_v_pc_file
         N_PC_FILE = lv_n_pc_file
         FIX2FIX = lv_fix2fix
         FIX2DELI = lv_fix2deli
         DELI2FIX = lv_deli2fix
         PROGTYPE = lv_progtype
         PROGNAME = lv_progname
         V_DS_NAME = lv_v_ds_name
         V_DS_TYPE = lv_v_ds_type
         V_DATA_APP = lv_v_data_app
         V_SERVER = lv_v_server
         V_DATA_FRN = lv_v_data_frn
         N_DS_NAME = lv_n_ds_name
    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




ABAP code using 7.40 inline data declarations to call FM DX_FILE_COPY

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single OBJECTTYPE FROM TDXLOADP INTO @DATA(ld_objecttype).
 
 
"SELECT single FILETYPE FROM DXFILE INTO @DATA(ld_n_ds_type).
DATA(ld_n_ds_type) = 'P'.
 
DATA(ld_n_data_app) = 'X'.
 
DATA(ld_n_data_frn) = ' '.
 
"SELECT single NAME FROM MSXXLIST INTO @DATA(ld_n_server).
 
"SELECT single FILENAME FROM RLGRAP INTO @DATA(ld_v_pc_file).
 
"SELECT single FILENAME FROM RLGRAP INTO @DATA(ld_n_pc_file).
 
DATA(ld_fix2fix) = 'X'.
 
DATA(ld_fix2deli) = ' '.
 
DATA(ld_deli2fix) = ' '.
 
"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_ds_type) = 'P'.
 
 
 
DATA(ld_v_data_app) = 'X'.
 
"SELECT single NAME FROM MSXXLIST INTO @DATA(ld_v_server).
 
 
DATA(ld_v_data_frn) = ' '.
 
 
"SELECT single FILENAME FROM DXFILE INTO @DATA(ld_n_ds_name).
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!