Creating XML file with UTF-8 format

Hi,
I have written the below code to download an XML file. but ia m able to in UTF-16 format.how do i download in UTF-8 format.
can somebody send i sample code for UTF-8 format.
types: begin of x_mara,
       matnr type matnr,
       mtart type mtart,
       end of x_mara.
TYPES: BEGIN OF ttab,
       record(50000) TYPE c,
       END OF ttab.
data: t_mara type standard table of x_mara.
DATA: xml_out TYPE string,
      xml_table type table of ttab.
select matnr
       mtart
       from mara up to 10 rows
       into table t_mara.
CALL TRANSFORMATION id
SOURCE output = t_mara
RESULT XML xml_out.
append xml_out to xml_table.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
  BIN_FILESIZE                    =
    FILENAME                        = 'C:\Users\sirishac\Desktop\Siri.xml'
   FILETYPE                         = 'BIN'
  APPEND                          = ' '
  WRITE_FIELD_SEPARATOR           = ' '
  HEADER                          = 'BCWEB'
  TRUNC_TRAILING_BLANKS           = ' '
  WRITE_LF                        = 'X'
  COL_SELECT                      = ' '
  COL_SELECT_MASK                 = ' '
  DAT_MODE                        = ' '
  CONFIRM_OVERWRITE               = ' '
  NO_AUTH_CHECK                   = ' '
  CODEPAGE                        = ' '
  IGNORE_CERR                     = ABAP_TRUE
  REPLACEMENT                     = '#'
  WRITE_BOM                       = ' '
  TRUNC_TRAILING_BLANKS_EOL       = 'X'
  WK1_N_FORMAT                    = ' '
  WK1_N_SIZE                      = ' '
  WK1_T_FORMAT                    = ' '
  WK1_T_SIZE                      = ' '
  WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
IMPORTING
  FILELENGTH                      =
  TABLES
    DATA_TAB                        = xml_table
  FIELDNAMES                      =
EXCEPTIONS
   FILE_WRITE_ERROR                = 1
   NO_BATCH                        = 2
   GUI_REFUSE_FILETRANSFER         = 3
   INVALID_TYPE                    = 4
   NO_AUTHORITY                    = 5
   UNKNOWN_ERROR                   = 6
   HEADER_NOT_ALLOWED              = 7
   SEPARATOR_NOT_ALLOWED           = 8
   FILESIZE_NOT_ALLOWED            = 9
   HEADER_TOO_LONG                 = 10
   DP_ERROR_CREATE                 = 11
   DP_ERROR_SEND                   = 12
   DP_ERROR_WRITE                  = 13
   UNKNOWN_DP_ERROR                = 14
   ACCESS_DENIED                   = 15
   DP_OUT_OF_MEMORY                = 16
   DISK_FULL                       = 17
   DP_TIMEOUT                      = 18
   FILE_NOT_FOUND                  = 19
   DATAPROVIDER_EXCEPTION          = 20
   CONTROL_FLUSH_ERROR             = 21
   OTHERS                          = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks in Advance,
Neha

hi
good
go through this link
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
thanks
mrutyun^

Similar Messages

  • Create xml file with values from context

    Hi experts!
    I am trying to implement a WD application that will have some input fields, the value of those input fields will be used to create an xml file with a certain format and then sent to a certain application.
    Apart from this i want to read an xml file back from the application and then fill some other context nodes with values from the xml file.
    Is there any standard used code to do this??
    If not how can i do this???
    Thanx in advance!!!
    P.S. Points will be rewarded to all usefull answers.
    Edited by: Armin Reichert on Jun 30, 2008 6:12 PM
    Please stop this P.S. nonsense!

    Hi,
    you need to create three util class for that:-
    XMLHandler
    XMLParser
    XMLBuilder
    for example in my XML two tag item will be there e.g. Title and Organizer,and from ur WebDynpro view you need to pass value for the XML tag.
    And u need to call buildXML()function of builder class to generate XML, in that i have passed bean object to get the values of tags. you need to set the value in bean from the view ui context.
    Code for XMLBuilder:-
    Created on Apr 4, 2006
    Author-Anish
    This class is to created for having function for to build XML
    and to get EncodedXML
      and to get formated date
    package com.idb.events.util;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import com.idb.events.Event;
    public class XMLBuilder {
    This attribute represents the XML version
         private static final double VERSION_NUMBER = 1.0;
    This attribute represents the encoding
         private static final String ENCODING_TYPE = "UTF-16";
         /*Begin of Function to buildXML
    return: String
    input: Event
         public String buildXML(Event event) {
              StringBuffer xmlBuilder = new StringBuffer("<?xml version=\"");
              xmlBuilder.append(VERSION_NUMBER);
              xmlBuilder.append("\" encoding=\"");
              xmlBuilder.append(ENCODING_TYPE);
              xmlBuilder.append("\" ?>");
              xmlBuilder.append("<event>");
              xmlBuilder.append(getEncodedXML(event.getTitle(), "title"));
              xmlBuilder.append(getEncodedXML(event.getOrganizer(), "organizer"));
              xmlBuilder.append("</event>");
              return xmlBuilder.toString();
         /End of Function to buildXML/
         /*Begin of Function to get EncodedXML
    return: String
    input: String,String
         public String getEncodedXML(String xmlString, String tag) {
              StringBuffer begin = new StringBuffer("");
              if ((tag != null) || (!tag.equalsIgnoreCase("null"))) {
                   begin.append("<").append(tag).append(">");
                   begin.append("<![CDATA[");
                   begin.append(xmlString).append("]]>").append("</").append(
                        tag).append(
                        ">");
              return begin.toString();
         /End of Function to get EncodedXML/
         /*Begin of Function to get formated date
    return: String
    input: Date
         private final String formatDate(Date inputDateStr) {
              String date;
              try {
                   SimpleDateFormat simpleDateFormat =
                        new SimpleDateFormat("yyyy-MM-dd");
                   date = simpleDateFormat.format(inputDateStr);
              } catch (Exception e) {
                   return "";
              return date;
         /End of Function to get formated date/
    Code for XMLParser:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLParser {
    Enables namespace functionality in parser
         private final boolean isNameSpaceAware = true;
    Enables validation in parser
         private final boolean isValidating = true;
    The SAX parser used to parse the xml
         private SAXParser parser;
    The XML reader used by the SAX parser
         private XMLReader reader;
    This method creates the parser to parse the user details xml.
         private void createParser()
              throws SAXException, ParserConfigurationException {
              // Create a JAXP SAXParserFactory and configure it
              SAXParserFactory saxFactory = SAXParserFactory.newInstance();
              saxFactory.setNamespaceAware(isNameSpaceAware);
              saxFactory.setValidating(isValidating);
              // Create a JAXP SAXParser
              parser = saxFactory.newSAXParser();
              // Get the encapsulated SAX XMLReader
              reader = parser.getXMLReader();
              // Set the ErrorHandler
    This method is used to collect the user details.
         public Event getEvent(
              String newsXML,
              XMLHandler xmlHandler,
              IWDMessageManager mgr)
              throws SAXException, ParserConfigurationException, IOException {
              //create the parser, if not already done
              if (parser == null) {
                   this.createParser();
              //set the parser handler to extract the
              reader.setErrorHandler(xmlHandler);
              reader.setContentHandler(xmlHandler);
              InputSource source =
                   new InputSource(new ByteArrayInputStream(newsXML.getBytes()));
              reader.parse(source);
              //return the results of the parse           
              return xmlHandler.getEvent(mgr);
    Code for XMLHandler:-
    Created on Apr 12, 2006
    Author-Anish
    This is a parser class
    package com.idb.events.util;
    import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.InputSource;
    import org.xml.sax.SAXException;
    import org.xml.sax.XMLReader;
    import com.idb.events.Event;
    Created on Apr 12, 2006
    Author-Anish
    *This handler class is created to have constant value for variables and function for get events,
        character values for bean variable,
        parsing thr date ......etc
    package com.idb.events.util;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Locale;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.helpers.DefaultHandler;
    import java.util.*;
    import com.idb.events.Event;
    import com.sap.tc.webdynpro.progmodel.api.IWDMessageManager;
    public class XMLHandler extends DefaultHandler {
         private static final String TITLE = "title";
         private static final String ORGANIZER = "organizer";
         IWDMessageManager manager;
         private Event events;
         private String tagName;
         public void setManager(IWDMessageManager mgr) {
              manager = mgr;
    This function is created to get events
         public Event getEvent(IWDMessageManager mgr) {
              manager = mgr;
              return this.events;
    This function is created to get character for setting values through event's bean setter method
         public void characters(char[] charArray, int startVal, int length)
              throws SAXException {
              String tagValue = new String(charArray, startVal, length);
              if (TITLE.equals(this.tagName)) {
                   this.events.setTitle(tagValue);
              if (ORGANIZER.equals(this.tagName)) {
                   String orgName = tagValue;
                   try {
                        orgName = getOrgName(orgName);
                   } catch (Exception ex) {
                   this.events.setOrganizer(orgName);
    This function is created to parse boolean.
         private final boolean parseBoolean(String inputBooleanStr) {
              boolean b;
              if (inputBooleanStr.equals("true")) {
                   b = true;
              } else {
                   b = false;
              return b;
    This function is used to call the super constructor.
         public void endElement(String uri, String localName, String qName)
              throws SAXException {
              super.endElement(uri, localName, qName);
         /* (non-Javadoc)
    @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
    This function is used to call the super constructor.
         public void fatalError(SAXParseException e) throws SAXException {
              super.fatalError(e);
    This function is created to set the elements base on the tag name.
         public void startElement(
              String uri,
              String localName,
              String qName,
              Attributes attributes)
              throws SAXException {
              this.tagName = localName;
              if (ROOT.equals(tagName)) {
                   this.events = new Event();
         public static void main(String a[]) {
              String cntry = "Nigeria";
              XMLHandler xml = new XMLHandler();
              ArrayList engList = new ArrayList();
              engList = xml.getCountries();
              ArrayList arList = xml.getArabicCountries();
              int engIndex = engList.indexOf(cntry);
              System.out.println("engIndex  :: " + engIndex);
              String arCntryName = (String) arList.get(engIndex);
              System.out.println(
                   ">>>>>>>>>>>>>>>>>>>>" + xml.getArabicCountryName(cntry));
    Hope that may help you.
    If need any help , you are most welcome.
    Regards,
    Deepak

  • Creating XML files with the DME

    Hi All,
    I'm working on an integration project between my company and HSBC, they are requesting that we supply our AP payment files for foreign currency in XML format.
    I have some limited experience with the DME and know it can create XML files, however, the elements available for XML files are different to standard flat files. Also it doesnt seem like I can create files with multiple levels? e.g.
    <InitgPty>
    ......... <Id>
    ............... <OrgId>
    ...................... <BkPtyId>ABC00103003</BkPtyId>
    .............. </OrgId>
    ........ </Id>
    </InitgPty>
    Does anyone have any documentation or experience with creating XML files with DME?
    thanks
    Phil.

    Hi,
    Please ask any Implementation team in ABAB or Report painter team with your friends,
    Thanks and REgards
    N.Soma Sundaram

  • Create xml file with nested internla table or with header & item tables

    Hi I have a requirement like, I need to create an xml file for header and item details. For 1 header there may be multiple line items.
    I did search in forums some where I came to know that we can use XSL:IF to achieve this. but I could not able to do this.
    I tried with using nested internal tables also but now luck.
    can anybody please suggest how can we create xml for header and item detials.
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
      xmlns:asx="http://www.sap.com/abapxml"
      exclude-result-prefixes="asx"
    >
    <xsl:template match="/">
      <OrbisomRequest>
        <xsl:attribute name="Version">
          <xsl:value-of select="11.1"/>
        </xsl:attribute>
        <xsl:attribute name="IssuerID">
          <xsl:value-of select="1"/>
        </xsl:attribute>
        <xsl:for-each select="asx:abap[1]/asx:values[1]/T_FINAL[1]/*">
    <CreateApprovedPurchaseRequest
           RerquestID="{VBLNR}"
           CommonName="User1"
           Amount="{WRBTR}"
           Comment="TestComment"
           CurrencyCode="978"
           PurchaseType="All"
           SupplierName="All"
           VCardAlias="PurchaseCard"
           ValidFrom="1M"
           CurrencyType="B">
                    <CDFs>
                      <Invoice> <xsl:value-of select="BELNR"/> </Invoice>
                      <Amount> <xsl:value-of select="WRBTR"/> </Amount>
                    </CDFs>
          </CreateApprovedPurchaseRequest>
        </xsl:for-each>
      </OrbisomRequest>
    </xsl:template>
    </xsl:transform>
    here belnr and wrbtr will be my item details. for each payment document I can have multiple invoices. in CDF I need to display the invoices for that particular payment document.
    what conditions can I put there before CDFs to make the item internal table to loop based on header internal table.
    Regards,
    Ranganadh.

    Looks like you have already created the transformation "Z_ID"
    Take a look at the following thread, it answers many of the questions you have asked:
    [ABAP data to XML conv with UTF-8 encoding and custom namespace|Re: ABAP data to XML conv with UTF-8 encoding and custom namespace;
    Che

  • Create XML file with worksheet's dynamically assigned through XSLT

    Hi all
    I have a requirement to create a xml file with worksheets dynamically created based on a field value in the internal table .
    I have all my values in internal table,  and am calling the transformation from bsp application.
    Say the internal table has field dataxyz, for every change in value in this field dataxyz  i need to create separate worksheet and populate that sheet with some corresponding values .
    please guide me how to create worksheet dynamically.
    thanks in advance.
    Bharathy
    Edited by: elam.bharathy on May 16, 2011 6:51 AM

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

  • SQL Error : missing expression - Creating XML file with ODI

    Hi,
    I saw threads about errors like this and read that maybe it can come from how I chose the staging area. I still can't see where the problem is. I'm trying to create an xml file from data stored in a Oracle database. The interface which execution fails select data from tables and create a tag in the XML file. Here are information about it :
    The staging area is diferent from the target and is an oracle database schema. (I guess it creates temporary tables in that schema ?)
    In the flow tab, the LKM is LKM SQL to SQL, the option delete temporary objects is set to yes.
    The IKM choice for the target is IKM SQL Control Append and options are as following :
    - insert : yes
    - commit : yes
    - flow contreol : no
    - recycle errors : no
    - static control : no
    - truncate : no
    - delete all : no
    - create target table : yes
    - delete temporary objects : yes
    Columns mapping in the target are the following :
    WKID        >     THEADER.WKID
    EXTID        >     THEADER.EXTID
    ORDER     >     THEADER.ORDER
    INSTFK     >     THEADER.INSTFK
    For every column in the target :
    - Run on source
    - Updating : insert, update and ud4 are checked
    no update key is defined
    In the operator, the step failing when running the interface is the loading data in the work table.
    If you need the SQL request in the execution plan, or anything else, please tell me.
    Thank you in advance for any help on this.
    Marie

    It would help if you provide error message and its stack trace.
    Please also look at the documentation (If not already done so) for creating xml file XML Files - 11g Release 1 (11.1.1)

  • Create XML File with codepage (not UNICODE)

    Hi all ,
    I'm using the SDIXML_DATA_TO_DOM function module to create a xml format from an internal table, finally I write the internal table in xml format to file in the application server.
    Finally I get a file in XML format in UTF-8 (UNICODE), but I have to convert the UTF-8 into other codepage because the file is send to other system which not familiar with the UNICODE.
    Does anyone knows how to convert the codepage for the xml internal table ?
    Thanks,
    Yaki

    Another option rather than converting it after the fact is to have it create the XML file in the encoding that you want to begin with.  It looks like this function module you mention will either accept a pointer to a XML document object or create one for you.  I would suggest that you go ahead and create a document yourself and pass it to the function module.
      ixml = cl_ixml=>create( ).
      document = ixml->create_document( ).
    You can then call the method SET_ENCODING of the class IF_IXML_DOCUMENT.  The encoding itself is another class of type IF_IXML_ENCODING.  You can set the character set in this object using method SET_CHARACTER_SET.

  • What's the best way to create XML file with a schema from a database table?

    Hi,
    I want to create an XML file from a database table (which has over 600 columns) using XML schema (.xsd file). I want to know the best way to do this.
    The output XML file is NOT a direct data dump from the DB table, there�re some logic around it, such as the XML file has some hierarchy with repeating tags.
    I have done this using JAXB by creating Java classes form XML schema, but I don�t want to map 600 DB columns to these Java classes manually, and loop through the record set to create repeating tags.
    I know there are few tools around now like MapForce (Altova), how do people do these now?
    Thanks,
    Chandi

    Can you use a schema when we compose XML doc from Database tables?
    Actually, I'm using SQL Server (sorry, wrong forum). But, I thought a Java tool would have a solution for me.

  • Create XML file with oracle DDL information

    Hi,
    I am working on a architecture where I was asked to see find the solution for the following issue:
    we are building a ODS which gets a feed from an ORACLE source. But ODS will not have any access to that table and the data will be pushed by source system. The requirement is whenever the source system change the table structure (add a column,drop a column, change data type) that should be reflected in ODS stage table by droping and recreating a table with the structure that comes everyday from the source. My question is without getting the DDL file from the source, can we get the structure in XML file along with data? so that I can use the XML file to create the stage table everyday in ODS. I dont' want to use xmltype or clob/varchar2. The oracle table should be rows and column.
    I know XML SQL will be able to insert the xml to oracle table and oracle table can be extracted to XML type.
    Thanks,
    Partha.

    Hi,
    If you need to create a new command, you can use SAP Developer Studio. After deploy you will see it in
    System administration->system configuration->cm->user interface->Commands.
    There are examples about how to create commands.
    You need to create your own layout set. This one use a resource renderer, here you must setup the commands group that you created.
    After that, you create a navigation iview and layout set field you setup your layout set.
    Patricio.

  • How to Create XML file with SAX parser instead of DOM parser

    HI ALL,
    I am in need of creating an XML file by SAX parser ONLY. As far as my knowledge goes, we can use DOM for such purpose(by using createElement, creatAttribute ...). Can anyone tell me, is there any way to create an XML file using SAX Parser only. I mean, I just want to know whether SAX provides any sort of api for Creatign an element, attribute etc. I know that SAX is for event based parsing. But my requirement is to create an XML file from using only SAX parser.
    Any help would be appreciated
    Thanx in advance
    Kaushik

    Hi,
    You must write a XMLWriter class yourself, and that Class extends DefaultHandle ....., the overwrite the startElement(url, localName, qName, attributeList), startDocument(), endElement().....and so on.
    in startElement write your own logic about how to create a new element and how to create a Attribute list
    in startDocument write your own logic about how to build a document and encodeType, dtd....
    By using:
    XMLWriter out = new XMLWriter()
    out.startDocument();
    Attribute attr1 = new Atribute();
    attr1.add("name", "value");
    out.startElement("","","Element1", attr1);
    Attribute attr2 = new Atribute();
    attr2.add("name", "value");
    out.startElement("","","Element2", attr2);
    out.endElement("","","Element2");
    out.endElement("","","Element1");
    out.endDocument();

  • Convert a UTF-16 format  file to UTF-8 format

    Hi all
          I have a xml file in UTF-16 format I have to convert it into UTF-8 format so that
    it can be opened with Internet Explorer.now when i am opening the file its showing error"<b>Whitespace is not allowed at this location. Error processing resource 'file</b>"
                    the file content is given below
                 < ? x m l   v e r s i o n = " 1 . 0 "   e n c o d i n g = "
    u t f - 8 " ? >
    < _ G L B - R G T X _ O R D E R S C P G >
         < I D O C   B E G I N = " 1 " >
             < E D I _ D C
    4 0   S E G M E N T = " 1 " >
                 < T A B N A M > E
    D I _ D C 4 0 < / T A B N A M >
                 < M A N D T > 1
    5 2 < / M A N D T >
                 < D O C N U M > 0 0 0 0 0 0
    0 0 0 2 7 5 9 7 2 2 < / D O C N U M >
                 < D O C R
    E L > 6 2 0 < / D O C R E L >
                 < S T A T U S > 3
    0 < / S T A T U S >
                 < D I R E C T > 1 < / D I R
    E C T >
                 < O U T M O D > 2 < / O U T M O D >
             < E X P R S S / >
                 < T E S T / >
          < I D O C T Y P > O R D E R S 0 5 < / I D O C T Y P >
                 < C I M T Y P > / G L B / R G T X _ O R D E R S
    C P G < / C I M T Y P >
                 < M E S T Y P > O R D C
    H G < / M E S T Y P >
                 < M E S C O D / >
         < M E S F C T / >
                 < S T D / >
    < S T D V R S / >
                 < S T D M E S > O R D C H G <
    / S T D M E S >
                 < S N D P O R > S A P G E 7 < /
    S N D P O R >
                 < S N D P R T > L S < / S N D P R
    T >
                 < S N D P F C / >
                 < S N D P R
    N > G E 7 Q A R 3 1 5 2 < / S N D P R N >
                 < S N
    D S A D / >
                 < S N D L A D / >
                 < R
    C V P O R > A 0 0 0 0 0 0 0 4 0 < / R C V P O R >
      < R C V P R T > L S < / R C V P R T >
                 < R C V
    P F C > L S < / R C V P F C >
                 < R C V P R N > R
    L E C P G W D I 1 < / R C V P R N >
                 < R C V S A
    D / >
                 < R C V L A D / >
                 < C R E D
    A T > 2 0 0 7 0 6 0 5 < / C R E D A T >
                 < C R E
    T I M > 1 5 4 1 5 3 < / C R E T I M >
                 < R E F I
    N T / >
                 < R E F G R P / >
                 < R E F
    M E S / >
                 < A R C K E Y / >
                 < S E
    R I A L > B U S 2 0 1 2       1 1 0 0 0 0 0 3 0 1 < / S E R
    I A L >
             < / E D I _ D C 4 0 >
             < E 1 E D K
    0 1   S E G M E N T = " 1 " >
                 < C U R C Y > E U
    R < / C U R C Y >
                 < W K U R S > 1 . 0 0 0 0 0 <
    / W K U R S >
                 < Z T E R M > Z 0 0 1 < / Z T E R
    M >
                 < B S A R T > N B < / B S A R T >
       < B E L N R > 4 5 2 0 0 2 2 0 7 2 1 1 0 0 0 0 0 3 0 0 < /
    B E L N R >
                 < R E C I P N T _ N O > 0 1 0 0 0 0
    0 0 0 5 < / R E C I P N T _ N O >
                 < A B R V W _
    B E Z > B U S 2 0 1 2       1 1 0 0 0 0 0 3 0 0 < / A B R V
    W _ B E Z >
                 < _ G L B - R G T _ C H A N G E F L
    A G   S E G M E N T = " 1 " >
                     < Q U A L F >
    0 0 2 < / Q U A L F >
                     < F L A G > X < / F L
    A G >
                 < / _ G L B - R G T _ C H A N G E F L A G
    >
                 < _ G L B - R G T _ C P G D A T A   S E G M E
    N T = " 1 " >
                     < L A N G U > e n < / L A N G
    U >
                     < C O N S I G N _ F L A G > S < / C O N
    S I G N _ F L A G >
                     < I N D I C A T > S < /
    I N D I C A T >
                 < / _ G L B - R G T _ C P G D A
    T A >
             < / E 1 E D K 0 1 >
             < E 1 E D K 1 4 
    S E G M E N T = " 1 " >
                 < Q U A L F > 0 1 4 <
    / Q U A L F >
                 < O R G I D > Z 2 0 0 < / O R G I
    D >
             < / E 1 E D K 1 4 >
             < E 1 E D K 1 4  
    S E G M E N T = " 1 " >
                 < Q U A L F > 0 0 9 < /
    Q U A L F >
                 < O R G I D > 0 0 3 < / O R G I D >
             < / E 1 E D K 1 4 >
             < E 1 E D K 1 4   S E
    G M E N T = " 1 " >
                 < Q U A L F > 0 1 3 < / Q U
    A L F >
                 < O R G I D > N B < / O R G I D >
       < / E 1 E D K 1 4 >
             < E 1 E D K 1 4   S E G M E
    N T = " 1 " >
                 < Q U A L F > 0 1 1 < / Q U A L F
    >
                 < O R G I D > Z 2 0 1 < / O R G I D >
    < / E 1 E D K 1 4 >
             < E 1 E D K 0 3   S E G M E N
    T = " 1 " >
                 < I D D A T > 0 1 2 < / I D D A T >
                 < D A T U M > 2 0 0 7 0 5 1 8 < / D A T U M >
           < / E 1 E D K 0 3 >
             < E 1 E D K 0 3   S E G
    M E N T = " 1 " >
                 < I D D A T > 0 1 1 < / I D D
    A T >
                 < D A T U M > 2 0 0 7 0 5 1 8 < / D A T U
    M >
             < / E 1 E D K 0 3 >
             < E 1 E D K A 1  
    S E G M E N T = " 1 " >
                 < P A R V W > A G < / P
    A R V W >
                 < P A R T N > 2 0 0 0 0 1 2 < / P A R
    T N >
                 < T E L F 1 > + 4 1 2 1 9 2 4 1 8 6 8 < /
    T E L F 1 >
                 < T E L F X > + 4 1 2 1 9 2 4 1 8 6
    7 < / T E L F X >
                 < B N A M E > P l a n t   O p
    e r .   B u y e r < / B N A M E >
                 < P A O R G >
    Z 2 0 0 < / P A O R G >
                 < O R G T X > E u r o p
    e < / O R G T X >
                 < P A G R U > 0 0 3 < / P A G
    R U >
             < / E 1 E D K A 1 >
             < E 1 E D K A 1 
    S E G M E N T = " 1 " >
                 < P A R V W > L F < /
    P A R V W >
                 < P A R T N > 0 1 0 0 0 0 0 0 0 5 <
    / P A R T N >
                 < N A M E 1 > I n t e r n a t i o
    n a l   A g r o . < / N A M E 1 >
                 < S T R A S >
    1 4   R u e   d e   S a h o n e < / S T R A S >
    < S T R S 2 > C h r i s t < / S T R S 2 >
                 < P F
    A C H > 1 5 5 < / P F A C H >
                 < O R T 0 1 > L y
    o n < / O R T 0 1 >
                 < P S T L Z > 1 0 2 0 4 < /
    P S T L Z >
                 < L A N D 1 > F R < / L A N D 1 >
               < T E L F 1 > 0 8 1 < / T E L F 1 >
    < S P R A S > E < / S P R A S >
                 < B N A M E > A
    l f r e d o < / B N A M E >
                 < I L N N R > 7 6 5
    4 3 2 1 5 4 3 2 1 5 < / I L N N R >
                 < S P R A S
    _ I S O > E N < / S P R A S _ I S O >
                 < _ G L B
    - R G T _ T A X C O D E S   S E G M E N T = " 1 " >
            < S P T N U M > 3 4 5 < / S P T N U M >
        < C Y T A X N U M > 4 5 6 < / C Y T A X N U M >
            < O T R I N F O > F R 9 8 7 1 2 5 6 4 4 4 2 < / O T
    R I N F O >
                 < / _ G L B - R G T _ T A X C O D E
    S >
             < / E 1 E D K A 1 >
             < E 1 E D K A 1  
    S E G M E N T = " 1 " >
                 < P A R V W > E K < / P
    A R V W >
                 < N A M E 1 > F R   P L   N e u t r a
    l i a < / N A M E 1 >
                 < N A M E 2 > G T   C o p
    y   R e f e r e n c e   F a c t o r y < / N A M E 2 >
          < S T R A S > G l o b e   S t r e e t   Z 2 0 3 < / S
    T R A S >
                 < O R T 0 1 > N e u t r a l i a < / O
    R T 0 1 >
                 < P S T L Z > 9 9 9 9 9 < / P S T L Z
    >
                 < L A N D 1 > F R < / L A N D 1 >
    < B N A M E > A l e s s a n d r o   V e r r e s c h i < / B
    N A M E >
                 < I L N N R > 5 0 0 0 2 4 3 0 0 0 4 9
    7 < / I L N N R >
                 < _ G L B - R G T _ T A X C O
    D E S   S E G M E N T = " 1 " >
                     < C R N U M
    > 2 9 8 < / C R N U M >
                     < S P T N U M > 3 9
    8 < / S P T N U M >
                     < C Y T A X N U M > 4 9
    8 < / C Y T A X N U M >
                 < / _ G L B - R G T _ T
    A X C O D E S >
                 < _ G L B - R G T _ C P G M I D
      S E G M E N T = " 1 " >
                     < S M T P _ A D D
    R > a l e s s a n d r o . v e r r e s c h i @ n e s t l e .
    c o m < / S M T P _ A D D R >
                 < / _ G L B - R G
    T _ C P G M I D >
             < / E 1 E D K A 1 >
             < E
    1 E D K A 1   S E G M E N T = " 1 " >
                 < P A R V
    W > L S < / P A R V W >
                 < P A R T N > 0 1 0 0 0
    0 0 0 0 5 < / P A R T N >
                 < I L N N R > 7 6 5 4
    3 2 1 5 4 3 2 1 5 < / I L N N R >
             < / E 1 E D K A 1
    >
             < E 1 E D K A 1   S E G M E N T = " 1 " >
         < P A R V W > W E < / P A R V W >
                 < N A M
    E 1 > F R   P L   N e u t r a l i a < / N A M E 1 >
        < N A M E 2 > G T   C o p y   R e f e r e n c e   F a c
    t o r y < / N A M E 2 >
                 < S T R A S > G l o b e
      S t r e e t   Z 2 0 3 < / S T R A S >
                 < O R T
    0 1 > N e u t r a l i a < / O R T 0 1 >
                 < P S T
    L Z > 9 9 9 9 9 < / P S T L Z >
                 < L A N D 1 > F
    R < / L A N D 1 >
                 < _ G L B - R G T _ E 1 E D K
    A 1   S E G M E N T = " 1 " / >
             < / E 1 E D K A 1 >
             < E 1 E D K A 1   S E G M E N T = " 1 " >
       < P A R V W > R G < / P A R V W >
                 < N A M E
    1 > G L O B E   R e f e r e n c e   F r a n c e < / N A M E
    1 >
                 < S T R A S > S t r e e t   1 < / S T R A S
    >
                 < O R T 0 1 > C i t y < / O R T 0 1 >
         < P S T L Z > 1 2 3 4 5 < / P S T L Z >
                 <
    L A N D 1 > F R < / L A N D 1 >
                 < I L N N R > 5
    0 0 0 2 4 3 0 0 0 7 0 1 < / I L N N R >
                 < _ G L
    B - R G T _ T A X C O D E S   S E G M E N T = " 1 " >
              < C O T A X N U M > 1 2 3 4 < / C O T A X N U M >
                     < C R N U M > 1 2 3 4 5 6 7 8 < / C R N U M
    >
                     < S P T N U M > 1 0 0 5 1 9 6 2 < / S P T
    N U M >
                     < C Y T A X N U M > 1 0 0 5 1 9 6 2
    < / C Y T A X N U M >
                     < O T R I N F O > 0 0
    0 0 0 0 0 5 6 7 8 9 < / O T R I N F O >
                     < J
    U R C O D E > 1 0 0 5 1 9 6 2 < / J U R C O D E >
      < / _ G L B - R G T _ T A X C O D E S >
             < / E 1 E
    D K A 1 >
             < E 1 E D K 0 2   S E G M E N T = " 1 " >
                 < Q U A L F > 0 0 1 < / Q U A L F >
    < B E L N R > 4 5 2 0 0 2 2 0 7 2 < / B E L N R >
       < D A T U M > 2 0 0 7 0 5 1 8 < / D A T U M >
    < U Z E I T > 1 4 0 4 4 0 < / U Z E I T >
             < / E 1
    E D K 0 2 >
             < E 1 E D K 1 8   S E G M E N T = " 1 "
    >
                 < Q U A L F > 0 0 1 < / Q U A L F >
       < T A G E > 3 0 < / T A G E >
                 < P R Z N T >
    2 . 0 0 0 < / P R Z N T >
             < / E 1 E D K 1 8 >
       < E 1 E D P 0 1   S E G M E N T = " 1 " >
                 <
    P O S E X > 0 0 0 1 0 < / P O S E X >
                 < A C T I
    O N > 0 0 2 < / A C T I O N >
                 < P S T Y P > 0 <
    / P S T Y P >
                 < M E N G E > 1 0 0 . 0 0 0 < / M
    E N G E >
                 < M E N E E > E A < / M E N E E >
             < B M N G 2 > 1 0 0 . 0 0 0 < / B M N G 2 >
         < P M E N E > E A < / P M E N E >
                 < V P R
    E I > 1 0 < / V P R E I >
                 < P E I N H > 1 < / P
    E I N H >
                 < N E T W R > 1 0 0 0 < / N E T W R >
                 < N T G E W > 8 0 0 < / N T G E W >
    < G E W E I > K G M < / G E W E I >
                 < M A T K
    L > P 2 0 < / M A T K L >
                 < B P U M N > 1 < / B
    P U M N >
                 < B P U M Z > 1 < / B P U M Z >
           < B R G E W > 1 0 0 0 < / B R G E W >
                 <
    W E R K S > Z 2 0 3 < / W E R K S >
                 < E 1 E D P
    0 4   S E G M E N T = " 1 " >
                     < M W S B T >
    0 . 0 0 < / M W S B T >
                 < / E 1 E D P 0 4 >
             < E 1 E D P 2 0   S E G M E N T = " 1 " >
           < W M E N G > 1 0 0 . 0 0 0 < / W M E N G >
           < A M E N G > 0 . 0 0 0 < / A M E N G >
       < E D A T U > 2 0 0 7 0 5 1 8 < / E D A T U >
         < E Z E I T > 1 4 5 0 0 0 < / E Z E I T >
       < _ G L B - R G T _ S L I D 0 1   S E G M E N T = " 1 " >
                         < E T E N R > 0 0 0 1 < / E T E N R >
                   < / _ G L B - R G T _ S L I D 0 1 >
       < / E 1 E D P 2 0 >
                 < E 1 E D P 1 9   S E G
    M E N T = " 1 " >
                     < Q U A L F > 0 0 1 < / Q
    U A L F >
                     < I D T N R > 0 0 0 0 0 0 0 0 0 0
    4 3 0 0 0 0 9 8 < / I D T N R >
                     < K T E X T
    > C a r t o n s   -   C e r e a l s   M i l k   2 4 x 4 5 0 
    g < / K T E X T >
                 < / E 1 E D P 1 9 >
        < E 1 E D P 1 9   S E G M E N T = " 1 " >
      < Q U A L F > 0 0 3 < / Q U A L F >
                     < I D
    T N R > 0 7 6 1 2 2 9 7 0 1 6 1 1 9 < / I D T N R >
        < / E 1 E D P 1 9 >
             < / E 1 E D P 0 1 >
    < E 1 E D S 0 1   S E G M E N T = " 1 " >
                 < S
    U M I D > 0 0 2 < / S U M I D >
                 < S U M M E > 1
    0 0 0 < / S U M M E >
                 < S U N I T > E U R < / S
    U N I T >
             < / E 1 E D S 0 1 >
             < E 1 E D S
    0 1   S E G M E N T = " 1 " >
                 < S U M I D > 0 0
    5 < / S U M I D >
                 < S U M M E > 0 < / S U M M E
    >
             < / E 1 E D S 0 1 >
         < / I D O C >
    < / _ G L
    B - R G T X _ O R D E R S C P G >

    Hi Saurabh,
    your xml is not wellformed coz there are spaces in the prolog between the first character '<' and the '?'. Coz of any reason there are spaces between all characters, that is making your document not readable for parsers including IE. For your task to convert to UTF-8 you can use a XSLT mapping with element "output" and attribut "encoding"
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:output encoding="UTF-8"/>
         <xsl:template match="/">
    Regards,
    Udo

  • Problems with reading XML files with ISO-8859-1 encoding

    Hi!
    I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
    Here's the code:
    import java.io.File;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import java.net.*;
    * @author gustav
    public class RSSDocument {
        /** Creates a new instance of RSSDocument */
        public RSSDocument(String inurl) {
            String url = new String(inurl);
            try{
                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                Document doc = builder.parse(url);
                NodeList nodes = doc.getElementsByTagName("item");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Element element = (Element) nodes.item(i);
                    NodeList title = element.getElementsByTagName("title");
                    Element line = (Element) title.item(0);
                    System.out.println("Title: " + getCharacterDataFromElement(line));
                    NodeList des = element.getElementsByTagName("description");
                    line = (Element) des.item(0);
                    System.out.println("Des: " + getCharacterDataFromElement(line));
            } catch (Exception e) {
                e.printStackTrace();
        public String getCharacterDataFromElement(Element e) {
            Node child = e.getFirstChild();
            if (child instanceof CharacterData) {
                CharacterData cd = (CharacterData) child;
                return cd.getData();
            return "?";
    }And here's the error message:
    org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
        at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
        at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
        at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
        at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at getrss.RSSDocument.<init>(RSSDocument.java:25)
        at getrss.Main.main(Main.java:25)

    I read files from the web, but there is a XML tag
    with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
    Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
    In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s).

  • How can I save a XML file with JAXP1.1?

    Dear All.
    I write a program to create XML file with DOM model, but I can't know how to save it? My environment is JAXP1.1 and JDK1.3.1,I has been required not use other XML parser toolkits,only JAXP1.1.
    How can I do? thank you.
    Many person give me a idea the com.sun.xml.tree.XmlDocument, but I can't find the class in API document or JAXP1.1's packages. why?
    what is it? How can i use it?
    thank you very much.

    The way to save an XML Document is using a Transformer.
    To have access to a transformer use the packages :
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    Then for saving your Document Object (named dXml) get a Transformer Object with the TransformerFactory Object :
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    Now you have got your Transformer Object, to save your Document Object use the method :
    Document dXml = getMyDocument(); // this is your Document Object.
    OutputStream osSave = getMySaveStream(); // this the OutputStream you need to save your Document.
    try
    t.transform(new DomSource(dXml), new StreamResult(new OutputStreamWriter(osSave)));
    finally
    osSave.close();
    And your Document was now saved.

  • Creating XML-files in ABAP with format ISO-8859-1 after the use of unicode

    Hello,
    We have a problem with XML-files created in z_abap-programma.
    Before the use of unicode the XML-file was of the format: ISO-8859-1.
    After the introducting of unicode the format is UTF-16.
    In the abap-program we are using:
            CALL TRANSFORMATION xls-program
             SOURCE t_vbak = it_vbak
             RESULT XML xmlstring.
            CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
              EXPORTING
                text     = xmlstring
              IMPORTING
                buffer   = lx_xml_as_string.
            CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
              EXPORTING
                buffer        = lx_xml_as_string
              IMPORTING
                output_length = li_xml_size
              TABLES
                binary_tab    = ltb_xml_table.
            CALL METHOD cl_gui_frontend_services=>gui_download
              EXPORTING
                bin_filesize = li_xml_size
                filename     = lc_filename
                filetype     = 'BIN'
              CHANGING
                data_tab     = ltb_xml_table
              EXCEPTIONS
                OTHERS       = 24.
    Is it prossible to create the XML-file with the format ISO-8859-1 after the unicode, please can you explane how to solve this problem.
    Regards,
    Theo Pijlman

    hi theo,
    did you read my thread i wrote some days before ? have a look in my sample coding find   " if_ixml_encoding ..... " there you can set the encoding of character .
    greetz
    tony
    thread:
    Re: abap to xml
    SAP Explanation for Interface if_ixml_encoding :
    http://help.sap.com/saphelp_nw04/helpdata/de/bb/5766a6dca511d4990b00508b6b8b11/content.htm

  • Create XML file from ABAP with SOAP Details

    Hi,
    I am new to XML and I am not familiar with JAVA or Web Service. I have searched in SDN and googled for a sample program for creating XML document from ABAP with SOAP details. Unfortunately I couldn't find anything.
    I have a requirement for creating an XML file from ABAP with SOAP details. I have the data in the internal table. There is a Schema which the client provided and the file generated from SAP should be validating against that Schema. Schema contains SOAP details like Envelope, Header & Body.
    My question is can I generate the XML file using CALL TRANSFORMATION in SAP with the SOAP details?
    I have tried to create Transformation (Transaction XSLT_TOOL) in SAP with below code. Also in CALL transformation I am not able to change the encoding to UTF-8. It's always show UTF-16.
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:template match="/">
        <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
          <SOAP:Header>
            <CUNS:HeaderInfo>
              <CUNS:InterfaceTypeId>10006</InterfaceTypeId>
              <CUNS:BusinessPartnerID>11223344</BusinessPartnerID>
              <CUNS:SchemaVersion>1.0</SchemaVersion>
              <CUNS:DateTime>sy-datum</DateTime>
            </CUNS:HeaderInfo>
          </SOAP:Header>
          <SOAP:Body>
            <xsl:copy-of select="*"/>
          </SOAP:Body>
        </SOAP:Envelope>
      </xsl:template>
    </xsl:transform>
    In ABAP program, I have written below code for calling above Transformation.
      call transformation ('Z_ID')
           source tab = im_t_output[]
           result xml xml_out.
      call function 'SCMS_STRING_TO_FTEXT'
        exporting
          text      = xml_out
        tables
          ftext_tab = ex_t_xml_data.
    Please help me how to generate XML file with SOAP details from ABAP. If anybody have a sample program, please share with me.
    Is there any easy way to create the XML file in CALL Transformation. Please help.
    Thanks

    Try ABAP forum, as it seems not to be PI related.

Maybe you are looking for

  • How to execute one sap gui script in different SAP system component versions.

    Hi Experts, I am having a task to write a script which can be executed in different SAP systems , explained as below. I have created a script to do password reset for mass users in one system (TC6) & it's working fine. But when i load same script in

  • Filenames and the £ character

    hello, is the £ symbol supported in filenames on the command line? if not, how are files with £ characters in the name dealt with, or by what name are they given? i have a zip file containing a file whose file name contains a £ character, and i am un

  • SD billing output

    Hi, I try to print a billing document, with VF03 but the system gives me a message Output could not be issued than if I go to output message thereis an error: "Include text ZWITS_INVOICE_TEXTVAT_INS1 does not exist (object TEXT, ID ST)" How can I do

  • Are there changes that need to be done to the template?

    I am working on a Supplier Workplace application and attempting to print a delivery. A pdf file is generated in the same browser window. When I try pressing the back button in the browser, the system dumps with the message "An error message had been

  • Need Help for MERGE statement

    I have a MERGE statement, I am executing it from shell script, I want to print that how many rows has been updated and Inserted. Can any one give me some idea. Thanks in Advance