cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC to Mail scenario with XSLT mapping

Former Member
0 Kudos

Hi all,

I am working on JDBC to Mail scenario. We have to pick the data from Oracle system and mail has to be sent with an attached Excel file.

I am doing this scenario by using of following blog.

I am getting the output as an attachment but iam not getting the data.

the same xslt coding iam using which has given in blog.

any idea........

Thanks,

Sreedhar Goud.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI

Are you able to see data from the Audit log in RWB or SXMB_MONI inbound message.

Check this if this is the case then XSLT code is having issue else it can be because of sender JDBC not picking up data

Thanks

Gaurav

Former Member
0 Kudos

Hi Gaurav,

JDBC is picking the data.In SXMB_MONI outbound payload iam able to see the data but in inbound payload there is no data.i think the problem is in XSLT code only.

My source structure:

<?xml version="1.0" encoding="utf-8" ?>

<ns:MT_ORMS_Errors xmlns:ns="http://mg.adityabirla.com/mg/orms/mail">

<row>

<INTERFACE_NAME>MG_SAP_RMS_ITEM_PKG</INTERFACE_NAME>

<RECORD_DETAIL>Item</RECORD_DETAIL>

<ERROR>item</ERROR>

<CREATE_DATE>2008-11-03 00:00:00.0</CREATE_DATE>

<MAIL_SENT>N</MAIL_SENT>

</row>

</ns:MT_ORMS_Errors>

XSLT code:

<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:variable name="break">&lt;br&gt;</xsl:variable>

<xsl:variable name="tableB">&lt;table&gt;</xsl:variable>

<xsl:variable name="tableE">&lt;/table&gt;</xsl:variable>

<xsl:variable name="trB">&lt;tr&gt;</xsl:variable>

<xsl:variable name="trE">&lt;/tr&gt;</xsl:variable>

<xsl:variable name="tdB">&lt;td&gt;</xsl:variable>

<xsl:variable name="tdE">&lt;/td&gt;</xsl:variable>

<xsl:variable name="nbsp">&amp;nbsp;</xsl:variable>

<xsl:variable name="thB">&lt;tr BGCOLOR="#CCCC99"&gt;</xsl:variable>

<xsl:template match="/">

<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<Subject>Deliveries from XI</Subject>

<From></From>

<To></To>

<Content_Type>application/vnd.ms-excel</Content_Type>

<Content>

<xsl:text xsl:space="preserve">These deliveries has been completed:</xsl:text>

<xsl:value-of select="$break"/>

<xsl:value-of select="$break"/>

<xsl:value-of select="$tableB"/>

<xsl:value-of select="$thB"/>

<xsl:value-of select="$tdB"/>

<xsl:text xsl:space="preserve">INTERFACE_NAME</xsl:text>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$tdB"/>

<xsl:text xsl:space="preserve">RECORD_DETAIL</xsl:text>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$tdB"/>

<xsl:text xsl:space="preserve">ERROR</xsl:text>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$tdB"/>

<xsl:text xsl:space="preserve">CREATE_DATE</xsl:text>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$trE"/>

<xsl:for-each select="MT_ORMS_Errors/row">

<xsl:value-of select="$trB"/>

<xsl:value-of select="$tdB"/>

<xsl:value-of select="INTERFACE_NAME"/>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$tdB"/>

<xsl:value-of select="RECORD_DETAIL"/>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$tdB"/>

<xsl:value-of select="ERROR"/>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$tdB"/>

<xsl:value-of select="CREATE_DATE"/>

<xsl:value-of select="$nbsp"/>

<xsl:value-of select="$tdE"/>

<xsl:value-of select="$trE"/>

</xsl:for-each>

<xsl:value-of select="$tableE"/>

</Content>

</ns1:Mail>

</xsl:template>

</xsl:stylesheet>

Thanks,

Sreedhar Goud.

Former Member
0 Kudos

HI

XSL will not work for these tags

<xsl:variable name="tableB"><table></xsl:variable>

<xsl:variable name="tableE"></table></xsl:variable>

<xsl:variable name="trB"><tr></xsl:variable>

<xsl:variable name="trE"></tr></xsl:variable>

<xsl:variable name="tdB"><td></xsl:variable>

<xsl:variable name="tdE"></td></xsl:variable>

change <table> as &lt;table&gt; and so on in your XSL code

Thanks

Gaurav

Former Member
0 Kudos

Hi Gaurav,

in output iam able to see headings that means up to for each statement its working fine.

if i test the same in interfacemapping output is coming as

These deliveries has been completed:<br><br><table><tr BGCOLOR="#CCCC99"><td>INTERFACE_NAME&nbsp;</td><td>RECORD_DETAIL&nbsp;</td><td>ERROR&nbsp;</td><td>CREATE_DATE&nbsp;</td></tr></table>

Sreedhar Goud.

Former Member
0 Kudos

Any ideas.......