cancel
Showing results for 
Search instead for 
Did you mean: 

Content Modifier XPATH IDOC

David_Oexner
Participant
0 Kudos

Dear All,

We have a IDoc XML being received through IDoc adapter and I tried to read the value of MESTYP using ContentModifier but the value is always coming as empty. I tried both header and property section like

MESTYP - //EDI_DC40/MESTYP (XPATH)

Any idea?

IDoc XML:

<FLOC01 xmlns="urn:sap-com:document:sap:idoc:soap:messages">
  <IDOC BEGIN="1">
    <EDI_DC40 SEGMENT="1">
      <TABNAM>EDI_DC40</TABNAM>
      <MANDT>XXX</MANDT>
      <DOCNUM>0000000000001278</DOCNUM>
      <DOCREL>XXX</DOCREL>
      <STATUS>XX</STATUS>
      <DIRECT>X</DIRECT>
      <OUTMOD>X</OUTMOD>
      <IDOCTYP>FLOCXX</IDOCTYP>
      <MESTYP>FLOCX</MESTYP>
      <STDMES>/EVISX</STDMES>
      <SNDPOR>SAPXXXX</SNDPOR>
      <SNDPRT>XX</SNDPRT>
      <SNDPRN>XXXXXXXXX</SNDPRN>
      <RCVPOR>XXXX_XXX</RCVPOR>
      <RCVPRT>XX</RCVPRT>
      <RCVPRN>XXXXXXXXX</RCVPRN>
      <CREDAT>YYYYMMDD</CREDAT>
      <CRETIM>HHMMSS</CRETIM>
      <ARCKEY>urn:sap.com:msgid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</ARCKEY>
      <SERIAL>YYYYMMDDHHMMSS</SERIAL>
    </EDI_DC40>
    <FLOC_HDR SEGMENT="1">
      <ACTION>X</ACTION>
      <TPLNR>XXXXXXXXXXXXXXXXXXXX</TPLNR>
      <STRNO>XX.XX.XXXX.XXXX.XX-XXX-XXX</STRNO>
      <TPLMA>XXXXXXXXXXXXXXXXXXXX</TPLMA>
      <TPLMA_L>XX.XX.XXXX.XXXX</TPLMA_L>
      <PLTXT>ITEM DESCRIPTION</PLTXT>
      <EQART>XX-XXXX</EQART>
      <BUKRS>XXXX</BUKRS>
      <IWERK>XXXX</IWERK>
      <SWERK>XXXX</SWERK>
      <EQFNR>XX-XXX-XXX</EQFNR>
      <KOSTL>XXXXXXXXXX</KOSTL>
      <STORT>XX-XXX</STORT>
    </FLOC_HDR>
  </IDOC>
</FLOC01>

 

View Entire Topic
tonynp
Explorer
0 Kudos

Hi ,

It is due to because of the namespace  of this filed

use below xslt mapping code before the reading MESTYP filed in the content modifier. 

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="comment() | text() | processing-instruction()">
<xsl:copy/>
</xsl:template>
</xsl:stylesheet>

David_Oexner
Participant
0 Kudos
Thank you. It fixed the issue.