Skip to Content
0
Former Member
Jan 02, 2006 at 12:56 AM

I'd like to divide line by line when insert file to internal table

29 Views

I'd like to insert file to internal table.

when i add the file to itab i've got a problem.

I couldn't divide line by line.

this is my source. please help me!!

-


DATA: fileUpload TYPE REF TO CL_HTMLB_FILEUPLOAD.

DATA: file_content type xstring.

DATA: content type string.

DATA: tf type string.

DATA: CONV TYPE REF TO CL_ABAP_CONV_IN_CE.

DATA: LEN TYPE I.

fileUpload ?= CL_HTMLB_MANAGER=>GET_DATA(

request = request

id = 'myUpload'

name = 'fileUpload' ).

file_name = fileUpload->file_name.

file_mime_type = fileUpload->file_content_type.

file_length = fileUpload->file_length.

file_content = fileUpload->file_content.

conv = CL_ABAP_CONV_IN_CE=>CREATE( input = file_content ).

conv->READ( importing data = content len = len ).

open dataset content in text mode for input encoding default.

transfer content to tf.

append tf to itab.

close dataset content.

-