cancel
Showing results for 
Search instead for 
Did you mean: 

Excel upload

Former Member
0 Kudos

Hi all,

i want to upload an excel file to an internal table.

I use the upload control from wda.

But if i look at the content of the excel file (itab rows) there is a description of the table and not the contents itself.

itab content:

MIME-Version: 1.0##X-Document-Type: Worksheet##Content-Type: multipart/related; boundary="--=_NextPart_01C5084F.FEF9A7A0"####----=_NextPart_01C5084F.FEF9A7A0##Content-Location: file:///C:/Mappe1.htm##Content-Transfer-Encoding: text/html##Content-Type:

My source code:

DATA XCONTENT TYPE XSTRING.

DATA: CONTENT TYPE STRING .

DATA: ROWS TYPE STANDARD TABLE OF STRING ,

WA_ROWS(300) TYPE C.

DATA: CONV TYPE REF TO CL_ABAP_CONV_IN_CE.

DATA: INPUT TYPE REF TO IF_WD_CONTEXT_NODE.

DATA: name type RLGRAP-FILENAME.

DATA: mime_1 type string.

INPUT = WD_CONTEXT->GET_CHILD_NODE( 'INPUT' ).

INPUT->GET_ATTRIBUTE( EXPORTING NAME = 'UPLOAD' IMPORTING VALUE = XCONTENT ).

INPUT->GET_ATTRIBUTE( EXPORTING NAME = 'FILENAME' IMPORTING VALUE = NAME ).

INPUT->GET_ATTRIBUTE( EXPORTING NAME = 'MIMETYPE' IMPORTING VALUE = MIME_1 ).

CONV = CL_ABAP_CONV_IN_CE=>CREATE( INPUT = XCONTENT ).

CONV->READ( IMPORTING DATA = CONTENT ).

SPLIT CONTENT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE ROWS .

LOOP AT ROWS INTO WA_ROWS .

ENDLOOP.

What's wrong and what should i use in MIME type? I used application/vnd.ms-excel

regards

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_szcs
Active Contributor
0 Kudos

Hello Wolfgang,

setting the mime type for a fileupload ui element is not necessary. The system sets it

depending on the type of a file as uploaded. It's strange that the content doesn't appear

in the context attribute. Are you sure that you have bound the right property of the ui

element to the xstring context attribute? If so, my suggestion is to open a support ticket

to SAP.

Best regards,

Thomas