Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

upload Comma separated Text file.

Hi all ,

i would like to upload a comma seperated text file into an internal table using CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD but am not able to load correctly. Please let me know any aditional parameters should be pass to this FM.

data **********

060000012,1001,01052005,2.5,C123,0198345678912

08000001,1001,01052005,5.0,C123,016545678912

08000001,1002,02052005,2.5,C234,012345678912

*********

types : Begin of ty_itab,

pernr(10),

ABS_ATT_TYPE(4),

REC_CCTR(10),

work_order(12),

date(8),

hours(8).

types: end of ty_itab.

data : itab type standard table of ty_itab with header line .

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

EXPORTING

FILENAME = 'C:\LOAD.TXT'

FILETYPE = 'ASC'

  • HAS_FIELD_SEPARATOR = 'X'

  • HEADER_LENGTH = 0

  • DAT_MODE = SPACE

  • CODEPAGE = SPACE

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • READ_BY_LINE = 'X'

  • IMPORTING

  • FILELENGTH =

  • HEADER =

CHANGING

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

NOT_SUPPORTED_BY_GUI = 17

ERROR_NO_GUI = 18

others = 19

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thx

Palani

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question