Hello everyone,
I have a problem with the import of a xml file and I hope that you can help me.
My program has two options to import the xml file. The first option is via the prasentation server and works absolutely fine.
But when I want to read the file from the file server I always get an error.
For using a file from the prasentation server I use the standard "gui_upload" method. To read the file from the file server I use open, read and close dataset.
Open dataset works fine, but during the read dataset it will crash with the return code 4. The crash is at sy-tabix 180, so the the problem is not starting with the first line. Unfortunately the raw xml file can not be analyzed because all the content is in one line. But there can`t be an error in the file itself, because the other method works fine and the result ist correct.
Do you have any hints why there can be an error?
I already tried to change the input mode in the open dataset statement but with no other result.
Thanks in advance!
My code:
OPEN DATASET g_filename FOR INPUT IN BINARY MODE.
IF sy-subrc <> 0.
MESSAGE text-009 TYPE 'E' DISPLAY LIKE 'I'.
ENDIF.
DO.
READ DATASET g_filename INTO l_xml_line.
IF sy-subrc EQ 0.
APPEND l_xml_line TO l_xml_table.
ELSE.
MESSAGE 'Error while reading the file'(017) TYPE 'E' DISPLAY LIKE 'I'.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET g_filename. IF sy-subrc <> 0. MESSAGE 'Error while closing the file'(018) TYPE 'E' DISPLAY LIKE 'I'. ENDIF.
Kind regards
Kai Schluesener