2015 Feb 16 8:39 AM
Hi Gurus,
I am converting a tabletype into xml simple structure and i am following this tutorial Generate Simple Transformation for XML in ABAP - Part II | © Passionate about SAP - A Blog.
I followed the tutorial and it works fine but I want that the field name of the data elements must be used as element name generated in xml and not the field name defined in the structure of the tabletype,
I have uploaded an image for clearification.
*** GENERATED CURRENTLY
<TABLETYPE_RBKP>
<tt:loop ref=".TABLETYPE_RBKP">
<ZARCH_RBKP>
<BELNR tt:value-ref="BELNR"/>
***** THE WAY I WANT IT TO BE GENERATED
<TABLETYPE_RBKP>
<tt:loop ref=".TABLETYPE_RBKP">
<ZARCH_RBKP>
<Doc.No. tt:value-ref="Doc.No."/>
any kind of help or suggestion is appericiated.
Thanks
Message was edited by: Thea Hillenbrand Hi, I deselected the category ABAP Trials and Developer Editions. This category should be used in the context of ABAP systems in the Cloud Appliance Library. Kind regards Thea
You can change each element text manually after you generate Simple Transformation.
It can be done in both graphical or source code view of XSLT_TOOL.
In graphical view - doubleclick element in Simple Transformation (right side) and edit element text in edit field in upper right part of window.
In source code view - change this text from:
<BELNR tt:value-ref="BELNR"/>
to:
<Your_element_text tt:value-ref="BELNR"/>
But check XML Elements - naming rules and practices. Because <Doc.No.> is not good XML element name, and it cannot contain space (SAP data element short text can).
2015 Feb 16 9:27 AM
You can change each element text manually after you generate Simple Transformation.
It can be done in both graphical or source code view of XSLT_TOOL.
In graphical view - doubleclick element in Simple Transformation (right side) and edit element text in edit field in upper right part of window.
In source code view - change this text from:
<BELNR tt:value-ref="BELNR"/>
to:
<Your_element_text tt:value-ref="BELNR"/>
But check XML Elements - naming rules and practices. Because <Doc.No.> is not good XML element name, and it cannot contain space (SAP data element short text can).
2015 Feb 16 9:40 AM
thanks for reply,
In your case i have to change every element manually.
Is there a possibiliy to do this automatically. for example using a program which changes it automatically.
The problem is: i am working with big data, and changing things manually is not a real solution.
Thanks in advance
2015 Feb 16 11:46 AM
I do not think there is any standard solution to do it automatically. Because:
- SAP short texts of elements can result in wrong XML element name
- some short texts can be empty
Maybe you can create program to generate Simple Transformation source code (as text). To copy&paste it to XSLT_TOOL after. But still it will need manual changes...
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |