SAP Function Modules

MDG_IMPORT_SINGLE_FILE SAP Function module - Upload single file







MDG_IMPORT_SINGLE_FILE 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 MDG_IMPORT_SINGLE_FILE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: MDG_DATA_LOAD_PARALLEL
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM MDG_IMPORT_SINGLE_FILE - MDG IMPORT SINGLE FILE





CALL FUNCTION 'MDG_IMPORT_SINGLE_FILE' "Upload single file
  EXPORTING
    iv_mdt =                    " string
    iv_namespace =              " string
    iv_file_content =           " xstring
*   iv_converter_type =         " mdg_fileconverter_typ  File Converter Type
    it_user_setting =           " mdg_user_proxy_setting_t  User proxy settings for file upload
    iv_dest_file_name =         " file_table-filename  Table for Converting Internal File Names into External Names
    iv_src_file_name =          " file_table-filename  Table for Converting Internal File Names into External Names
    iv_run_number =             " mdg_run_number  Data Load Run Number
    iv_file_number =            " num8          Eight-digit numeric value
*   iv_oitc_code =              " mdg_ids_type_code_bs  Object Identifier Type
*   iv_log_extr_num =           " balnrext      Application Log: External ID
*   iv_src_folder =             " mdg_dataload_filepath  Data load file path
  IMPORTING
    ev_src_file_name =          " file_table-filename  File name
    ev_dest_file_name =         " file_table-filename  File name
* CHANGING
*   ct_return =                 " bapirettab    Table with BAPI Return Information
    .  "  MDG_IMPORT_SINGLE_FILE

ABAP code example for Function Module MDG_IMPORT_SINGLE_FILE





The ABAP code below is a full code listing to execute function module MDG_IMPORT_SINGLE_FILE 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).

DATA:
ld_ev_src_file_name  TYPE FILE_TABLE-FILENAME ,
ld_ev_dest_file_name  TYPE FILE_TABLE-FILENAME .

DATA(ld_ct_return) = 'Check type of data required'.
DATA(ld_iv_mdt) = 'Check type of data required'.
DATA(ld_iv_namespace) = 'Check type of data required'.
DATA(ld_iv_file_content) = 'Check type of data required'.
DATA(ld_iv_converter_type) = 'Check type of data required'.
DATA(ld_it_user_setting) = 'Check type of data required'.

DATA(ld_iv_dest_file_name) = some text here

DATA(ld_iv_src_file_name) = some text here
DATA(ld_iv_run_number) = 'Check type of data required'.
DATA(ld_iv_file_number) = 'Check type of data required'.
DATA(ld_iv_oitc_code) = 'Check type of data required'.
DATA(ld_iv_log_extr_num) = 'Check type of data required'.
DATA(ld_iv_src_folder) = 'Check type of data required'. . CALL FUNCTION 'MDG_IMPORT_SINGLE_FILE' EXPORTING iv_mdt = ld_iv_mdt iv_namespace = ld_iv_namespace iv_file_content = ld_iv_file_content * iv_converter_type = ld_iv_converter_type it_user_setting = ld_it_user_setting iv_dest_file_name = ld_iv_dest_file_name iv_src_file_name = ld_iv_src_file_name iv_run_number = ld_iv_run_number iv_file_number = ld_iv_file_number * iv_oitc_code = ld_iv_oitc_code * iv_log_extr_num = ld_iv_log_extr_num * iv_src_folder = ld_iv_src_folder IMPORTING ev_src_file_name = ld_ev_src_file_name ev_dest_file_name = ld_ev_dest_file_name * CHANGING * ct_return = ld_ct_return . " MDG_IMPORT_SINGLE_FILE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

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_ct_return  TYPE BAPIRETTAB ,
ld_ev_src_file_name  TYPE FILE_TABLE-FILENAME ,
ld_iv_mdt  TYPE STRING ,
ld_ev_dest_file_name  TYPE FILE_TABLE-FILENAME ,
ld_iv_namespace  TYPE STRING ,
ld_iv_file_content  TYPE XSTRING ,
ld_iv_converter_type  TYPE MDG_FILECONVERTER_TYP ,
ld_it_user_setting  TYPE MDG_USER_PROXY_SETTING_T ,
ld_iv_dest_file_name  TYPE FILE_TABLE-FILENAME ,
ld_iv_src_file_name  TYPE FILE_TABLE-FILENAME ,
ld_iv_run_number  TYPE MDG_RUN_NUMBER ,
ld_iv_file_number  TYPE NUM8 ,
ld_iv_oitc_code  TYPE MDG_IDS_TYPE_CODE_BS ,
ld_iv_log_extr_num  TYPE BALNREXT ,
ld_iv_src_folder  TYPE MDG_DATALOAD_FILEPATH .

ld_ct_return = 'Check type of data required'.
ld_iv_mdt = 'Check type of data required'.
ld_iv_namespace = 'Check type of data required'.
ld_iv_file_content = 'Check type of data required'.
ld_iv_converter_type = 'Check type of data required'.
ld_it_user_setting = 'Check type of data required'.

ld_iv_dest_file_name = some text here

ld_iv_src_file_name = some text here
ld_iv_run_number = 'Check type of data required'.
ld_iv_file_number = 'Check type of data required'.
ld_iv_oitc_code = 'Check type of data required'.
ld_iv_log_extr_num = 'Check type of data required'.
ld_iv_src_folder = 'Check type of data required'.

Contribute (Add Comments)

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 MDG_IMPORT_SINGLE_FILE or its description.