05-02-2017 7:42 AM
hi,
i am using XSLT Transformation to convert XML data to ABAP internal table, but able to transform the XML attribute. Please some suggest what I need to change in my XSLT transformation and ABAP structure, bellow is my code:
XSLT:
........
<ORGNLTXREF>
<AMT>
<INSTDAMT>
<xsl:value-of select="TXINFANDSTS/ORGNLTXREF/AMT/INSTDAMT"/>
</INSTDAMT>
</AMT>
<REQDEXCTNDT>
<xsl:value-of select="TXINFANDSTS/ORGNLTXREF/REQDEXCTNDT"/>
</REQDEXCTNDT>
...........
XML:
.......
<OrgnlTxRef>
<Amt>
<InstdAmt Ccy="BGN">1.01</InstdAmt>
</Amt>
<ReqdExctnDt>2012-04-23</ReqdExctnDt>
............
I want to read attribute value Ccy in my internal table, please suggest it wil be helpful for me.
I also enclosing my ABAP and XML code for reference.
Thanks,
Atique.
05-02-2017 10:08 AM
Not really an SAP question, you could search answers in XSLT or XPATH forums. Answer is: <xsl:value-of select="@Ccy"/> (the exact XPATH value dépends on where your "current node" is, of course).
By the way, XSLT (also ST) is case sensitive (i.e. INSTDAMT is not InstdAmt), so you should adapt accordingly all your XPATH expressions to the exact XML element names.
05-02-2017 10:08 AM
Not really an SAP question, you could search answers in XSLT or XPATH forums. Answer is: <xsl:value-of select="@Ccy"/> (the exact XPATH value dépends on where your "current node" is, of course).
By the way, XSLT (also ST) is case sensitive (i.e. INSTDAMT is not InstdAmt), so you should adapt accordingly all your XPATH expressions to the exact XML element names.
05-03-2017 9:13 AM
hi,
My entire report is working fine and able to get all values in ABAP internal table from the XML file. But new requirement is to read the attribute value also in internal table that is currency value "Ccy" . I have tried with above as suggested but not able to get.
please suggest if I need to change in ABAP structure and Transformation code.
05-04-2017 11:25 AM
Thanks Rossi,
The issue is resolved.