XML - ABAP conversion, empty tag

Hi.
Im sending data from a DB to a proxy using XI.
But when I get an empty response from the DB, wich gives me an empty XML tag the proxy shows me an error:
-PARSE_APPLICATION_DATA Error during XML => ABAP conversion (Response  Message; error ID: CX_ST_MATCH_ELEMENT;
-Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT;
-System expected the end of the element 'STMT_DC_response'          
This is the message that originates the fail:
<ns0:MT_xxx_response xmlns:ns0="urn:s-com:xi:SD">
<STMT_response>
  <row>
   <c11>P</c11>
   <c12>55062330</c12>
   <c13>1</c13>
  </row>
</STMT_response>
<STMT_DC_response />
</ns0:MT_xxx_response>
In case that the tag is filled runs ok
<ns0:MT_xxx_response xmlns:ns0="urn:s.com:xi:SD">
  <STMT_response>
   <row>
    <c11>P</c11>
    <c12>55062330</c12>
    <c13>1</c13>
   </row>
  </STMT_response>
  <STMT_DC_response>
   <row>
    <c21>P</c21>
    <c22>55062330</c22>
    <c23 />
  </row>
  </STMT_DC_response>
</ns0:MT_xxx_response>
The definition for the data is:
STMT_DC_response        0..1
  row                               0..n
    tipo                             0..1
Thanks for the help you can give me about my problem with empty tags.

thanks for your help!
yes, The definition for the data is:
STMT_DC_response    0..1
to be sure I disabled that node, so I wont get it from the DB, and It was ok
this is ok:
<ns0:MT_xxx_response xmlns:ns0="urn:s-com:xi:SD">
<STMT_response>
<row>
<c11>P</c11>
<c12>55062330</c12>
<c13>1</c13>
</row>
</STMT_response>
</ns0:MT_xxx_response>
but this is not
<ns0:MT_xxx_response xmlns:ns0="urn:s-com:xi:SD">
<STMT_response>
<row>
<c11>P</c11>
<c12>55062330</c12>
<c13>1</c13>
</row>
</STMT_response>
<STMT_DC_response />
</ns0:MT_xxx_response>

Similar Messages

  • Error during XML = ABAP conversion, empty tag

    Hi.
    Im sending data from a Data Base to a proxy using BI.
    But when I get an empty response from the data base wich gives me an empty XML tag the proxy shows me an error:
    -PARSE_APPLICATION_DATA Error during XML => ABAP conversion (Response  Message; error ID: CX_ST_MATCH_ELEMENT;
    -Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT;
    -System expected the end of the element 'STMT_DC_response'          
    This is the message that originates the fail:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns0:MT_PRV23_BS_desg_response xmlns:ns0="urn:tompla-com:xi:ventas_SD">
    <STMT_response>
      <row>
       <TIPO>P</TIPO>
       <NUM_OT>55062330</NUM_OT>
       <NUM_DESGLOSE>1</NUM_DESG>
       <CANT_DESG>1724000</CANT_DESG>
      </row>
    </STMT_response>
    <STMT_DC_response />
    </ns0:MT_PRV23_BD_desg_response>
    In case that the tag is filled runs ok
    <?xml version="1.0" encoding="utf-8" ?>
    <ns0:MT_PRV23_BD_desg_response xmlns:ns0="urn:tompla-com:xi:ventas_SD">
      <STMT_response>
       <row>
        <TIPO>P</TIPO>
        <NUM_OT>55062330</NUMERO_OT>
        <NUM_DESG>1</NUM_DESG>
        <CANT_DESG>1724000</CANT_DESG>
       </row>
      </STMT_response>
      <STMT_DC_response>
       <row>
        <TIPO>P</TIPO>
        <NUMERO_OT>55062330</NUMERO_OT>
        <NUMERO_DESGLOSE />
        <COD_CAR_ADICIONA>8</COD_CAR_ADICIONA>
        <PORC_CAR_ADICION>1</PORC_CAR_ADICION>
      </row>
      </STMT_DC_response>
    </ns0:MT_PRV23_BD_desg_response>
    The definition for the data is:
    STMT_DC_response        0..1
      row                               0..n
        tipo                             0..1
    Thanks for the help you can give me about my problem with empty tags.

    I moved this question to other forum
      Expert Forums  » SAP NetWeaver  » Exchange Infrastructure 

  • PARSE_APPLICATION_DATA Error during XML = ABAP conversion: Response Message; CX_ST_DESERIALIZATION_ERROR in /1SAI/SAS0446CC11CC6EC1AD4789 Line 24 An error occurred when deserializing in the simple transformation program /1SAI/SAS0446CC11CC6EC1AD4789

    Hi Experts ,
    i have a scenario proxy to soap  where i am getting error while getting the response .
    we are sending the request successfully and getting response .some times we are getting in proxy level error below
    PARSE_APPLICATION_DATA Error during XML => ABAP conversion: Response Message; CX_ST_DESERIALIZATION_ERROR in /1SAI/SAS0446CC11CC6EC1AD4789 Line 24 An error occurred when deserializing in the simple transformation program /1SAI/SAS0446CC11CC6EC1AD4789 (Cha
    Please help us to fix this bug in proxy response.
    Regards
    Ravi

    Hello Ravinder,
    Can you please post the complete stack trace, it seems to be some fields are getting truncated i,e data sent from the program to the proxy object might be violating some length restrictions.
    Please check your message interface field lengths and what is being passed to the proxy.
    Regards,
    Ravi.

  • Error during XML = ABAP conversion

    Hi
      We have a synchronous call from a SRM application through a proxy framework to a vendor http server through XI. The response from the vendor's http server is returned through a custom structure -and is returned through XI back to the calling SRM application.
    After receiving the response, the calling SRM application checks for a particular field value of the custom return structure for a error code and sends out an email - accordingly.
    Now, the response message comes back from the vendor's server - but the lines of code beyond the synchronous call in the SRM calling application does not get executed ( mail generation part ) I get the following error on the SRM front end - <b>Error in Exchange Infrastructure: Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT; (/1SAI/TXS00000000000000000001 XML Bytepos.: 39 XML Path: Error Text: System e</b>
    Now, this error when occured in our dev environment, I set the extended xml attribute property to 'X' for the synchronous payload in calling SRM application code. The problem is, this error is occuring now in our QA environment inspite of this property being set.
    Any ideas/suggestions as to why this message occurs in a standard proxy framework setup ?

    Hi,
       Please check this link <a href="http://help.sap.com/saphelp_nw04/helpdata/en/0c/402040abf2c442e10000000a1550b0/content.htm"></a>
    This talks about having the first element of the xml fragment as X0.
    Hope this helps.
    Regards,
    Smitha.

  • XML = ABAP conversion error (CX_ST_GROUP_MISSING_CASE)

    Hi ,
    we are using wsdl connection
    We are not able to display data in SAP
    its showing error :
    Error during <b>XML => ABAP conversion</b> (Response Message; error ID: CX_ST_GROUP_MISSING_CASE; (/1SAI/TXS00000000000000000010 XML Bytepos.: 205 XML Path: root(1)ns0:requestEventResponse(1) Error Text: Element 'TESTRESPONSE' missing))

    Are you by any chance using a message interface with multiple namespaces as source for your ABAP proxy? I am currently facing the very same problem and my best guess so far is that the ABAP proxy cannot handle multiple namespaces in one message.
    Did you get open a ticket on SapOSS? Any hints are very welcome!
    Stefan

  • Is there a way to modify the style sheet so that it transforms an XML document with empty tags as tag / ?

    I have extracted some code from codeproject to
    reindent an XML document. Does anyone know how I can modify the stylesheet to make it so that the transform of an XML file will result in empty tags showing up as <tag /> instead of <tag></tag>?
    // http://www.codeproject.com/Articles/43309/How-to-create-a-simple-XML-file-using-MSXML-in-C
    MSXML2::IXMLDOMDocumentPtr FormatDOMDocument(MSXML2::IXMLDOMDocumentPtr pDoc)
    LPCSTR const static szStyleSheet =
    R"!(<?xml version="1.0" encoding="utf-8"?>)!"
    R"!(<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">)!"
    R"!( <xsl:output method="xml" indent="yes"/>)!"
    R"!( <xsl:template match="@* | node()">)!"
    R"!( <xsl:copy>)!"
    R"!( <xsl:apply-templates select="@* | node()"/>)!"
    R"!( </xsl:copy>)!"
    R"!( </xsl:template>)!"
    R"!(</xsl:stylesheet>)!";
    MSXML2::IXMLDOMDocumentPtr pXmlStyleSheet;
    pXmlStyleSheet.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    pXmlStyleSheet->loadXML(szStyleSheet);
    MSXML2::IXMLDOMDocumentPtr pXmlFormattedDoc;
    pXmlFormattedDoc.CreateInstance(__uuidof(MSXML2::DOMDocument60));
    CComPtr<IDispatch> pDispatch;
    HRESULT hr = pXmlFormattedDoc->QueryInterface(IID_IDispatch, (void**)&pDispatch);
    if (SUCCEEDED(hr))
    _variant_t vtOutObject;
    vtOutObject.vt = VT_DISPATCH;
    vtOutObject.pdispVal = pDispatch;
    vtOutObject.pdispVal->AddRef();
    hr = pDoc->transformNodeToObject(pXmlStyleSheet, vtOutObject);
    //By default it is writing the encoding = UTF-16. Let us change the encoding to UTF-8
    // <?xml version="1.0" encoding="UTF-8"?>
    MSXML2::IXMLDOMNodePtr pXMLFirstChild = pXmlFormattedDoc->GetfirstChild();
    // A map of the a attributes (vesrsion, encoding) values (1.0, UTF-8) pair
    MSXML2::IXMLDOMNamedNodeMapPtr pXMLAttributeMap = pXMLFirstChild->Getattributes();
    MSXML2::IXMLDOMNodePtr pXMLEncodNode = pXMLAttributeMap->getNamedItem(_T("encoding"));
    pXMLEncodNode->PutnodeValue(_T("UTF-8")); //encoding = UTF-8
    return pXmlFormattedDoc;
    Or, if there is some other method for reindenting a MSXML2::IXMLDOMDocumentPtr object where I can specify how I want empty tags to be stored, that would be great too.  However, I don't want it to lose its status of an MSXML2::IXMLDOMDocumentPtr object.
     I.e. I would like to still perform operations on the result as if it was still an MSXML2::IXMLDOMDocumentPtr object.
    Thanks,
    A
    Adrian

    If anyone is interested, I got an answer on StackOverflow
    here.
    Adrian

  • Not getting empty tags in XML output

    Hello,
    I am using DBMS_XMLQuery.getXML function and cusor function in my select statement to generate XML documents. If the column value is null, the XML document is not generating a empty tag. How do I generate empty tags?
    My query is :-
    SELECT
    MSG_NAME ,MSG_DATE, BATCH_ID,
    cursor (SELECT ACTION_CODE,PART_NUMBER,
    ITEM_DESCRIPTION,ITEM_STATUS
    UOM,CONVERSIONS,INSPECTION_FLG
    FROM ITEM_OUT ITEM
    WHERE ITEM.BATCH_ID= ECF.MSG_BATCH_ID
    ) as item_header
    FROM FILE_CONTROL ECF
    null

    You need to set the option to use a null indicator. By default, null values omit their elements. With the null indicator, they are included as empty elements with a NULL="Y" attribute flag.

  • How to remove empty tags from XML

    Hello,
    I have a XML file which contains some empty tags and some values with "?". I need to remove all empty tags and tags which have a value "?".
    Sample Data:
    <a>
    <b></b>
    <c> Hello </c>
    <d>world ?</d>
    <e>oracle</e>
    </a>
    Expected result:
    <a>
    <c> Hello </c>
    <e>oracle</e>
    </a>
    Thank you for your time.
    Thanks,
    Edited by: 850749 on Apr 7, 2011 6:25 PM

    Dear Odie,
    May I make your example a bit more complicated by adding an additional complexType, please:
    ---Original ----
    <DEPT>
    <EMPID>1</EMPID>
    <EMPNAME>Martin Chadderton</EMPNAME>
    <SALARY>??</SALARY>
    <SALARYq></SALARYq>
    </DEPT>
    ----- New ----
    <DEPT>
    <EMPID>1</EMPID>
    <EMPNAME>Martin Chadderton</EMPNAME>
    <SALARY>??</SALARY>
    <SALARYq></SALARYq>
    <EMPLMNT_HISTORY>
    <DEVISION>1</DEVISION>
    <FROM_DATE>2011-01-01 </FROM_DATE>
    <TO_DATE></TO_DATE>
    </EMPLMNT_HISTORY>
    </DEPT>
    Your solution works perfectly for <SALARY>, but how would you suggest also to deal with <TO_DATE> ?
    Massive thanks for your help!
    N.B. Just to emphasise, in my case I have 3 levels (complexType > complexType > complexType) and many elements and I would like to know if there is any generic option to say
    to remove all the empty elements from the result, as it causes to the SSJ (Systinet) Webservice to crash.

  • XML: empty tag issue

    I use Transformer class to convert xml Document into string representation:
    StringWriter sw = new StringWriter();     
    TransformerFactory transFactory = TransformerFactory.newInstance();
    Transformer transformer = transFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");
    transformer.setParameter(OutputKeys.ENCODING, "UTF-8");
    transformer.transform(new DOMSource(doc), new StreamResult(sw));
    but if the content of the tag is empty, the output is in this format: <tag />. Can someone know how to get the following format instead: <tag></tag>?
    Thanks,

    I suggest that you write a specific function to translate the string with auto-close tags to empty tags instead. It is not very difficult to do and you can look at [http://sourceforge.net/projects/light-html2xml|http://sourceforge.net/projects/light-html2xml] where you will find a similar java function to convert HTML to well-formed XML.

  • How to delete empty tags after xml-import

    Hello collegues,
    I'm totally new in this forum so excuse me if I make a mistake, but I've a little question.
    I've imported text and images with a xml-import but sometimes empty tags (the colored invisible blocks) are in my text, with the result that I can't Find/Change on double-returns.
    Does anybody know an awnser to this matter? I would love to write an apple-script that will find/change this so i don't have to look after all my pages.
    Thank you very much in advance.

    ThePictureCreator wrote:
    ...I can't Find/Change on double-returns.
    What's your search query? I think you should be able to, with either a grep find of "\r+" or a normal text find of "^p^p". InDesign pretends like the tag-holding characters aren't there for the purpose of search. But you will lose the empty elements along with the extra returns. Maybe that is the problem?
    Jeff

  • How to generate empty tag using XMLForest

    Hi,
    I am creating an XML document using XMLAgg, XMLForest and XMlElement functions.
    At some point I have an XMLForest embedded in the other XMLForest
    XMLForest( e.indicator as "col1",
               e.participant_id as "col2",
      XMLForest( tableAlias.col11 as "address1",
                 tableAlias.col12 as "address2",            
               ) as "items",
    )           and within the last one I have some expressions which are empty, so the XML tags are not generated, however I have to have an empty tags:
    <address2></address2>I tried to replace an expression using "NVL" or "DECODE", but the results were the same.
    I also tried to replace an embedded XMLForest with an XMLElement :
    XMLForest( e.indicator as "col1",
               e.participant_id as "col2",
      *XMLElement("items"*
                 *XMLElement("address1"),*
                 *XMLElement("address2")*
               *) as "items",*)           however it created 2 <items> tags :
        <items>
             <items>
                <address1>value</address1>
                <address2></address2>
             </items>
         </items> I am working with Oracle 11.2.0 db.
    Is there any way to generate an empty tag when using XMLForest function?
    thank you in advance.
    Edited by: user624274 on Apr 3, 2013 8:52 AM
    Edited by: user624274 on Apr 3, 2013 8:53 AM

    Hello Odie_63.
    Your argument is valid, but it does not mean the solution I provided is bad.
    If you are concerned about the size of the result, it is simple, you can use like:
    REPLACE(XMLForest( NVL(e.indicator, '#NULLValue#') as "col1",  NVL(e.participant_id, '#NULLValue#') as "col2").getClobVal(), '#NULLValue#', '')
    According to Oracle documentation, REPLACE is smart and will return a CLOB (not a varchar2) because it changes the type of return according to the type of the first parameter. So you will not have issues with size.
    I believe the first question was related to use the final result to record to a table or send to another system (to use as integration). If it will be used just in a select field, it does not matter if it is not there or if it is there as NULL, the select of the field will always return ''.
    Other hint, I never use xmltype to store on database, because it is not compatible with other databases or integration tools. I use CLOB because it is the natural serialization of the object and I can convert and work with it inside and outside Oracle.
    But that is up to the architect and/or developer. If the system is running only on Oracle and there is no integration, maybe xmltype will save a lot of time in conversions.
    Regards.
    Rodolpho

  • Empty Collections and Empty Tags

    It seems that empty collections from a cast or cursor result in an empty tag. For example, the following sql:select work.work_id medlineid,
    cursor(
    select
    databankname,
    db.accessionnumberlist_ref.accessionnumberlist accessionnumberlist
    from table(dbl.databanks) db
    order by databankname) databanklist,
    cast( multiset (
    select chemical_t(
    wrkchm.cas_registry_number,
    wrkchm.term)
    from work_chemicals wrkchm
    where wrkchm.work_id=work.work_id
    order by wrkchm.term) as chemicals_t) chemicallist
    from
    works work,
    databanklist_t_v dbl
    where
    work.work_id = 96264942
    and work.work_id = dbl.work_id(+)results in the following XML:<medlinecitationset>
    <medlinecitation num="1">
    <medlineid>96264942</medlineid>
    <databanklist/>
    <chemicallist/>
    </medlinecitation>
    </medlinecitationset>Is there a way to not have these empty tags appear?
    Thanks! -- John.
    null

    David, this is about understanding the use of, and differencies between tags and collections. This is a bit hard for many new users.
    First of all searching for collections and tags can *not* be done simultaneously. You can either work with one collection only, or you can search for pictures with one or more tags.
    Next collections should be used as either temporary work sets or for special occasions like specific vacations, trips or birthdays, e.g. "Anna 5 years". You say you have a collection named "Churches". I think would have made a TAG called "Churches" instead, because a tag is for general searches that can be combined. On the other hand I might have made a collection called "Church visits July 2005" or "Summer vacation 2005" or the like.
    Another difference is that pictures in a collection can be sorted manually by drag & drop, while pictures found via tags always are shown in the order chosen in the Photo Browser Arrangement box shown bottom left in the Organizer.

  • How to deal with empty tags in a SAX Parser

    Hi,
    I hope someone can help me with the problem I am having!
    Basically, I have written an xml-editor application. When an XML file is selected, I parse the file with a SAX parser and save the start and end locations of all the tags and character data. This enables me to display the xml file with the tags all nicely formatted with pretty colours. Truly it is a Joy To Behold. However, I have a problem with tags in this form:
    <package name="boo"/>
    because the SAX parser treats them like this:
    <package name = boo>
    </package>
    for various complex reasons the latter is unaccetable so my question is: Is there some fiendishly clever method to detect tags of this type as they occur, so that I can treat them accordingly?
    Thanks,
    Chris

    I have spent some time on googling for code doing this, but found nothing better, than I had to write in by myself.
    So, it would be something like this. Enjoy :)
    package comd;
    import org.xml.sax.helpers.DefaultHandler;
    import org.xml.sax.SAXException;
    import org.xml.sax.Attributes;
    import java.util.Stack;
    import java.util.Enumeration;
    public class EmptyTagsHandler extends DefaultHandler {
         private StringBuilder xmlBuilder;
         private Stack<XmlElement> elementStack;
         private String processedXml;
         private class XmlElement{
              private String name;
              private boolean isEmpty = true;
              public XmlElement(String name) {
                   this.name = name;
              public void setNotEmpty(){
                   isEmpty = false;
         public EmptyTagsHandler(){
              xmlBuilder = new StringBuilder();
              elementStack = new Stack();
         private String getElementXPath(){
              StringBuilder builder = new StringBuilder();
              for (Enumeration en=elementStack.elements();en.hasMoreElements();){
                   builder.append(en.nextElement());
                   builder.append("/");
              return builder.toString();
         public String getXml(){
              return processedXml;
         public void startDocument() throws SAXException {
              xmlBuilder = new StringBuilder();
              elementStack.clear();
              processedXml = null;
         public void endDocument() throws SAXException {
              processedXml = xmlBuilder.toString();
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              if (!elementStack.empty()) {
                   XmlElement elem = elementStack.peek();
                   elem.setNotEmpty();
              xmlBuilder.append("<");
              xmlBuilder.append(qName);
              for (int i=0; i<attributes.getLength();i++){
                   xmlBuilder.append(" ");
                   xmlBuilder.append(attributes.getQName(i));
                   xmlBuilder.append("=");
                   xmlBuilder.append(attributes.getValue(i));
              xmlBuilder.append(">");
              elementStack.push(new XmlElement(qName));
         public void endElement(String uri, String localName, String qName) throws SAXException {
              XmlElement elem = elementStack.peek();
              if (elem.isEmpty) {
                   xmlBuilder.insert(xmlBuilder.length()-1, "/");
              } else {
                   xmlBuilder.append("</");
                   xmlBuilder.append(qName);
                   xmlBuilder.append(">");
              elementStack.pop();
         public void characters(char ch[], int start, int length) throws SAXException {
              if (!elementStack.empty()) {
                   XmlElement elem = elementStack.peek();
                   elem.setNotEmpty();
              String str = new String(ch, start, length);
              xmlBuilder.append(str);
         public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
              String str = new String(ch, start, length);
              xmlBuilder.append(str);
    }

  • Not inlcude empty tag while invoking service from ESB

    The ESB receives a request with input xml which contains some empty tag. while ESB invokes the actual services the empty tags should not be included. can any one help how to achieve this?

    define that tag as optional in schema and don't map that element. This should help you.
    -Ramana.

  • How to remove empty tags respecting the schema contraints?

    Hi,
    I'm generating an XML document with XSLT. This document have some empty tags. My question is about to remove all empty tags only if they are defined as optionnals in the schema.
    Is this possible with the DOM?
    Thanks in advance,
    Philippe

    With DOM3 validation api, elements/attributes may be checked if they may be removed.
    -Check if the element is empty; getFirstChild() method returns null.
    -Check if the element may be removed with DOM 3 Validation API.

Maybe you are looking for

  • Windows 8 Pro 64 Bit on HP TouchSmart IQ804

    I have a HP TouchSmart IQ804 desktop, which I had previously upgraded to Windows 7 64 bit with out any issues. The IQ804 uses the NVIDIA GeForce 9300M GS graphics card. Last night, I attempted to upgrade to Windows 8 Pro 64 bit.  I tried 4 times, all

  • Need help identifying ports needed to access a website.

    I am trying to access the following site: Interactive mapping | City of Lawrence, Kansas At the bottom of the page is a button that states "I agree with the above disclaimer". When I press that button, I am redirected to this site: http://ims03.ci.la

  • Java:57: cannot find symbol class _cls2

    Due to our loss of a software engineer who started this ongoing project many many moons ago I've come to compile it, but have the following error. I'm using netbeans 5.5 and JKD1.5 U12 I've fixed all of the errors apart from this one:- table = new _c

  • SRM PCard functionality in ECC MM

    Hi Friends, The standard PCard functionality is available in SRM. We are not going for SRM at the moment, but would like to incorporate the PCard functionality in the ECC environment. Is it possible to have PCard functionality in ECC? Where the state

  • How field VBRP-WAVWR is updated?

    Hello experts, What logic SAP uses to update the field VBRP-WAVWR? Is it copied from VPRS condition type? What if there are more than one Cost condition (category 'G') on a Pricing procedure? Thanks for your time.