2018 Mar 26 3:46 PM
Hello expoerts
I have e problem with the deserialization of a xml file.
during the call transformation, the error in the title occurs when it is readeing a attribute.
the xml file looks like this:

The simple transformation that i have created look like this:

I didnt found a solution to read the attribute "storno" which is written in the tag absence which is a internal table.
The generated structure of the internal table type is following:

Where i do the mistake? I dont see it.
Many thanks for helping!
Best regards
Marco
2018 Mar 27 8:40 AM
Why are you looping inside "absence"? There should be no loop, as its inner elements (one attribute, 4 elements) occur once only. You seem to have added the <loop> below the multi-occurrence element, instead of before (is <absenceData> really a multi-occurrence element?). Note that for <personAbsence> you correctly added the <loop> above it.
PS: for all transformation questions, don't forget to provide these 3 parts: XML, the transformation, AND the **structure of the ABAP data** (and those based on a DDIC type, you may provide a screen shot of the "Hierarchy", there's a dedicated button in SE11).
2018 Mar 26 8:12 PM
I found the error. The error occurs because I wrote storno in lowercase. I changed it now to
<tt:attribute name="STORNO" value-ref="STORNO"/>
But now I get the error
Expected was attribute: "STORNO" [ ] Element start: "absence" was read
Does have anybody a solution?
2018 Mar 27 8:40 AM
Why are you looping inside "absence"? There should be no loop, as its inner elements (one attribute, 4 elements) occur once only. You seem to have added the <loop> below the multi-occurrence element, instead of before (is <absenceData> really a multi-occurrence element?). Note that for <personAbsence> you correctly added the <loop> above it.
PS: for all transformation questions, don't forget to provide these 3 parts: XML, the transformation, AND the **structure of the ABAP data** (and those based on a DDIC type, you may provide a screen shot of the "Hierarchy", there's a dedicated button in SE11).
2018 Mar 27 10:50 AM
Hi Sandra
Thank you for your suggestions. The Problem is that "absence" is declared as table type in DDIC:

So I have to loop over it. Or is there a mistake in this structure? Do I have to declare it as "line"?
The serealization of the data with this strukture is working and give the xml like shown in the first post, because a personnell number can have more than one absence.
Thanky you!
2018 Mar 27 1:51 PM
I changed now the "absence" from internal table to a structure. But I am getting the same dump with error
Expected was attribute: "STORNO" [ ] Element start: "absence" was read
The structure looks now like this:

I commented out the loop in the transformation:

2018 Mar 27 3:12 PM
You still don't understand what I said : put the <loop> at the right place.
<tt:loop ref="PERSON_ABSENCE.ABSENCE_DATA">
<uka:absenceData>
<uka:absence>
<tt:attribute name="STORNO"...
PS 1: please paste the code and format it with the button "CODE", people will be able to correct your code easily instead of copying it manually!
PS 2: use the button "Comment on this answer" to reply to someone. The button "Submit your answer" is reserved to people who give a solution to the original question.
2018 Mar 29 7:58 AM
Hi Sandra
Thank you for your comment. I will place the Code with the button "CODE" in further posts.
I found the solution. I wrote "STORNO" in upper casese. When I write it in lower case everything works correctly. So the loop is at the right place I think.
Thank you!
2021 Dec 08 10:38 AM
I also faced the same issue and changed it to lower case and it worked.Thanks.