Skip to Content
0
Aug 29, 2007 at 04:47 AM

reg uploading the data from flat file

14 Views

Hi friends, this is very urgent, plz help.

when i am uploading flat file from presentation server to internal table its going to dump. the code i have written is below.

PARAMETERS p_file TYPE ibipparms-path LOWER CASE MODIF ID 001.

AT SELECTION-SCREEN ON VALUE-REQUEST for p_file.

PERFORM pre_help USING p_file .

PERFORM UPLOAD_INPUT_FILE.

FORM pre_help USING us_file TYPE ibipparms-path.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = sy-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = us_file.

ENDFORM. " pre_help

FORM UPLOAD_INPUT_FILE.

IF P_PRESER EQ C_X.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = P_FILE

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = C_X

IMPORTING

FILELENGTH = W_FILELENGTH

TABLES

DATA_TAB = I_ztppt01

EXCEPTIONS

FILE_OPEN_ERROR = C_EXCEPTION_01

FILE_READ_ERROR = C_EXCEPTION_02

NO_BATCH = C_EXCEPTION_03

GUI_REFUSE_FILETRANSFER = C_EXCEPTION_04

INVALID_TYPE = C_EXCEPTION_05

NO_AUTHORITY = C_EXCEPTION_06

UNKNOWN_ERROR = C_EXCEPTION_07

BAD_DATA_FORMAT = C_EXCEPTION_08

HEADER_NOT_ALLOWED = C_EXCEPTION_09

SEPARATOR_NOT_ALLOWED = C_EXCEPTION_10

HEADER_TOO_LONG = C_EXCEPTION_11

UNKNOWN_DP_ERROR = C_EXCEPTION_12

ACCESS_DENIED = C_EXCEPTION_13

DP_OUT_OF_MEMORY = C_EXCEPTION_14

DISK_FULL = C_EXCEPTION_15

DP_TIMEOUT = C_EXCEPTION_16

OTHERS = C_EXCEPTION_17.

IF SY-SUBRC NE 0.

MESSAGE I999 WITH 'Error uploading file :'(013) P_FILE.

endif.