Read utf-8 xml file with abap



User Rating:  / 0
PoorBest 
Details

Read utf-8 xml file and store it in string variable :

View source
*--------------------------------------------------------------
* www.developerpages.gr
*
* Read UTF-8 xml file
*
*--------------------------------------------------------------
report zread_xml.
 
data XML_STRING type STRING.
DATA line TYPE string.
clear xml_string.
PARAMETERS xml_file(255).
 
OPEN DATASET xml_file IN TEXT MODE for input ENCODING UTF-8 .
if sy-subrc = 0.
  DO.
    READ DATASET xml_file INTO line.
    IF sy-subrc <> 0.
      EXIT.
    else.
      CONCATENATE xml_string line INTO xml_string.
    ENDIF.
  ENDDO.
  if not xml_string is initial.
    write :/ 'ready to parse xml...'.
  else.
    write :/ 'file is empty ! ', xml_file.
  endif.
else.
  WRITE :/ 'cannot open file ', xml_file.
endif.

click here  if you want to see how to Parse xml file with ABAP


You have no rights to post comments

   

Login  

   
   

     

© Developerpages