Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error Call transformation The ref-node is not defined or does not have the required type

marcosch
Explorer
0 Likes
7,861

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

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
4,567

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).

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

7 REPLIES 7
Read only

marcosch
Explorer
0 Likes
4,567

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?

Read only

Sandra_Rossi
Active Contributor
4,568

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).

Read only

marcosch
Explorer
0 Likes
4,567

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!

Read only

marcosch
Explorer
0 Likes
4,567

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:

Read only

0 Likes
4,567

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.

Read only

0 Likes
4,567

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!

Read only

0 Likes
4,567

I also faced the same issue and changed it to lower case and it worked.Thanks.