on 2024 Aug 07 10:55 AM
Let's start with the question: Is it possible to have dynamic attribute names with simple transformations?
And for a bit of context: From our S/4HANA Public Cloud Edition we need to export data in XML format. The easiest way to convert an internal table to XML is by using a simple transformation. To keep this as flexible as possible, I have added property attributes as a name/value table.
ARTICLE-VALUE = 'BL22070'
ARTICLE-PROPERTIES = ( ( name = 'group' value = 'BK' )
( name = 'chgdate' value = '20240807' ) ).
In the simple transformation, this is processed in a loop:
<tt:loop ref = "article.properties">
<tt:attribute name="$ref.name" value-ref="$ref.value"/>
</tt:loop>
Everything else (of course there is more data) works as expected, the XML looks great... except for the attribute name here. The "$ref.name" is copied literally.
<article $ref.name="BK" $ref.name="20240807">
Fair enough, the documentation of the tt:attribute tag does not mention any dynamic way of defining the name... as I found out after this did not work.
Is there a different method to get this to work? Should I start over and switch to XSLT? Or just accept that I will have to define all attribute names statically in the simple transformation and check whether to include them based on the corresponding ref-value?
Thanks in advance for your help and insights!
User | Count |
---|---|
67 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.