on 02-18-2008 11:20 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.