0% found this document useful (0 votes)
31 views

BDC - Batch Data Communitcation

This document contains a report that uploads a file and loads its data into an internal table for output. It calls a function to select a file, uploads the file using another function, and then loops through the internal table to output the loaded data.

Uploaded by

chandru_abap
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

BDC - Batch Data Communitcation

This document contains a report that uploads a file and loads its data into an internal table for output. It calls a function to select a file, uploads the file using another function, and then loops through the internal table to output the loaded data.

Uploaded by

chandru_abap
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

*&---------------------------------------------------------------------* *& Report ZBDC_DEMO *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZBDC_DEMO.

parameters p_file type rlgrap-filename. data: begin of itab occurs 0, matnr(18), mbrsh(1), mtart(4), maktx(35), meins(3), end of itab. at selection-screen on value-request for p_file. CALL FUNCTION 'F4_FILENAME' EXPORTING PROGRAM_NAME = SYST-CPROG DYNPRO_NUMBER = SYST-DYNNR * FIELD_NAME = ' ' IMPORTING FILE_NAME = p_file . start-of-selection. data p_file1 type string. p_file1 = p_file.

CALL FUNCTION 'GUI_UPLOAD' EXPORTING FILENAME FILETYPE * HAS_FIELD_SEPARATOR * HEADER_LENGTH * READ_BY_LINE * DAT_MODE * CODEPAGE * IGNORE_CERR * REPLACEMENT * CHECK_BOM

= P_FILE1 = 'ASC' = ' ' = 0 = 'X' = ' ' = ' ' = ABAP_TRUE = '#' = ' '

* VIRUS_SCAN_PROFILE = * NO_AUTH_CHECK = ' ' * IMPORTING * FILELENGTH = * HEADER = TABLES DATA_TAB = ITAB * EXCEPTIONS * FILE_OPEN_ERROR = 1 * FILE_READ_ERROR = 2 * NO_BATCH = 3 * GUI_REFUSE_FILETRANSFER = 4 * INVALID_TYPE = 5 * NO_AUTHORITY = 6 * UNKNOWN_ERROR = 7 * BAD_DATA_FORMAT = 8 * HEADER_NOT_ALLOWED = 9 * SEPARATOR_NOT_ALLOWED = 10 * HEADER_TOO_LONG = 11 * UNKNOWN_DP_ERROR = 12 * ACCESS_DENIED = 13 * DP_OUT_OF_MEMORY = 14 * DISK_FULL = 15 * DP_TIMEOUT = 16 * OTHERS = 17 . IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.

LOOP AT ITAB. WRITE: / ITAB-matnr, ITAB-mbrsh, ITAB-mtart, ITAB-MAKTX, ITAB-meins. ENDLOOP.

You might also like