2021 Aug 25 5:17 PM
Hi experts. I am newbie using Abap. I want to convert data from internal table to XML format using structure, but I am facing this issue and I dont know to solve this:
Simple Transformation:
I am using functions to do the process..
I have moved the data from internal tables to the structure what I declared in the Export Tab of the function,
and I am trying to pass the same structure to the simple transformation. (this structure has already all moved data)
DATA : xml_result TYPE xstring.
CALL TRANSFORMATION ZPRUEBA2
SOURCE root = cartaporte
RESULT XML xml_result .
2021 Aug 25 6:47 PM
Your unique root is named 'cartaporte' (<tt:root name='cartaporte') so you should indicate its name in CALL TRANSFORMATION:
CALL TRANSFORMATION ZPRUEBA2
SOURCE cartaporte = cartaporte
RESULT XML xml_result .
Based on your transformation, it requires that the variable 'cartaporte' (right-hand side) is a structure of type ZCPXML_CARTAPORTE.
2021 Aug 25 5:54 PM
What is the ABAP code and the types of variables you pass to the root? (structure/internal table)
(no need to post a screenshot; paste the code and format it by pressing the button CODE)
Thank you.
2021 Aug 25 6:47 PM
Your unique root is named 'cartaporte' (<tt:root name='cartaporte') so you should indicate its name in CALL TRANSFORMATION:
CALL TRANSFORMATION ZPRUEBA2
SOURCE cartaporte = cartaporte
RESULT XML xml_result .
Based on your transformation, it requires that the variable 'cartaporte' (right-hand side) is a structure of type ZCPXML_CARTAPORTE.
2021 Aug 25 7:38 PM
Thank yo so much. It works. I corrected the name 'root' to 'cartaporte' and now its working.:))