2026 Jun 01 2:38 PM
Hi Folks,
I'm working on a Simple Transformation in XSLT_TOOL to convert data from ABAP to XML. It works fine, but there is one improvement I need to make.
The data comes from an SD invoice, and each value element needs to be accompanied by a currency element. And the currency has to appear on the same line in the XML as the value.
So I need an XML output line that looks something like this:
<Amount currencyID="EUR">100.00</Amount>Thus far, the relevant line in my ST looks like this:
<Amount currencyID="EUR" tt:value-ref=".INVOICE.AMOUNT"/>Clearly, the currency here is a literal; but I need to insert it as a variable instead. It's in my ABAP structure as INVOICE.CURRENCY.
So how do I include the currency variable, without it appearing on a separate line?
Don't think I haven't searched for this; everything I've found so far either outputs 2 lines instead of 1, or doesn't compile (thank you AI). I'm sure the answer is trivial...
Thanks for reading,
John
2026 Jun 02 12:20 PM
In your question "currencyID" is named officially an "XML Attribute".
In Simple Transformation, use tt:attribute:
<Amount tt:value-ref=".INVOICE.AMOUNT">
<tt:attribute name="currencyID" value-ref=".INVOICE.CURRENCY"/>
</Amount>
Hi Folks,
I'm working on a Simple Transformation in XSLT_TOOL to convert data from ABAP to XML. It works fine, but there is one improvement I need to make.
The data comes from an SD invoice, and each value element needs to be accompanied by a currency element. And the currency has to appear on the same line in the XML as the value.
So I need an XML output line that looks something like this:
<Amount currencyID="EUR">100.00</Amount>Thus far, the relevant line in my ST looks like this:
<Amount currencyID="EUR" tt:value-ref=".INVOICE.AMOUNT"/>Clearly, the currency here is a literal; but I need to insert it as a variable instead. It's in my ABAP structure as INVOICE.CURRENCY.
So how do I include the currency variable, without it appearing on a separate line?
Don't think I haven't searched for this; everything I've found so far either outputs 2 lines instead of 1, or doesn't compile (thank you AI). I'm sure the answer is trivial...
Thanks for reading,
John
2026 Jun 02 12:20 PM
In your question "currencyID" is named officially an "XML Attribute".
In Simple Transformation, use tt:attribute:
<Amount tt:value-ref=".INVOICE.AMOUNT">
<tt:attribute name="currencyID" value-ref=".INVOICE.CURRENCY"/>
</Amount>
2026 Jun 02 12:51 PM
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |