2019 Jan 14 3:46 PM
Hi Folks,
got a problem with an ABAP to XML simple transformation. It's similar to other questions that have been asked (and answered), but they haven't helped. This isn't a 'no data' issue, it's a 'some missing lines issue'.
I'm serializing an ABAP deep structure that contains both nested structures and tables (invoice header and items). The structures work, but the tables don't; however, the table tags aren't empty - they just have a single item record instead of multiple items. So it looks as though the transformation is treating the nested table as a nested structure.
(Explanation: I have defined types as follows: data elements are ZDE_, structures are ZSTY_, and table types are ZTTY_. Sorry about the long field/tag names. NB The transformation was generated from the ABAP structure, and the tag names exactly match the field names in the structure) .
In the XSLT_TOOL transaction, the critical part of the ABAP structure looks like this:

This shows a structure type (DatiBeniServizi) which contains a table type (DettaglioLinee). The graphic representation of the same section looks like this:

I have debugged the code, and when the main structure is being passed to the transformation, the DettaglioLinee table definitely contains 4 entries. The resulting XML output only shows the first entry.
For the same section of data, this is the actual transformation code:

Each reference (in green) is the name of the ABAP table, structure or field.
Everything works (no errors or exceptions), except that only one entry from the DettaglioLinee table appears.
I really don't want to have to rewrite this as a manual field by field output - there are a heck of a lot of them. Besides, the transformation should work.
If anyone has any ideas, I'd be most grateful.
Thanks,
John
Hi Folks,
got a problem with an ABAP to XML simple transformation. It's similar to other questions that have been asked (and answered), but they haven't helped. This isn't a 'no data' issue, it's a 'some missing lines issue'.
I'm serializing an ABAP deep structure that contains both nested structures and tables (invoice header and items). The structures work, but the tables don't; however, the table tags aren't empty - they just have a single item record instead of multiple items. So it looks as though the transformation is treating the nested table as a nested structure.
(Explanation: I have defined types as follows: data elements are ZDE_, structures are ZSTY_, and table types are ZTTY_. Sorry about the long field/tag names. NB The transformation was generated from the ABAP structure, and the tag names exactly match the field names in the structure) .
In the XSLT_TOOL transaction, the critical part of the ABAP structure looks like this:

This shows a structure type (DatiBeniServizi) which contains a table type (DettaglioLinee). The graphic representation of the same section looks like this:

I have debugged the code, and when the main structure is being passed to the transformation, the DettaglioLinee table definitely contains 4 entries. The resulting XML output only shows the first entry.
For the same section of data, this is the actual transformation code:

Each reference (in green) is the name of the ABAP table, structure or field.
Everything works (no errors or exceptions), except that only one entry from the DettaglioLinee table appears.
I really don't want to have to rewrite this as a manual field by field output - there are a heck of a lot of them. Besides, the transformation should work.
If anyone has any ideas, I'd be most grateful.
Thanks,
John
2019 Jan 14 4:31 PM
Not an answer - just a muse.....
What you're seeing seems to imply that the tables have header lines and that possibly only the header line of the table is being processed.
Can you supply the definition of one of your table types ?
Are you perhaps calling a function or a procedure that casts a table into a table with header ???
Rich
2019 Jan 14 4:48 PM
Inside <tt:loop> you must always have exactly one "superior" element (any name is valid). This is not the case in your Simple transformation.
For instance, you should have something like that :
<tt:loop ...>
<superior>
<NumeroLinea.../>
<TipoCessionePrestazione.../>
...
</superior>
</tt:loop>
2019 Jan 14 5:10 PM
Maybe, in your case, the element <DettaglioLinee> is the superior element and must be moved inside the <tt:loop> block.
2019 Jan 15 11:25 AM
Hi Folks,
re. question from Richard: the table types are defined in the Workbench, and the tables don't have headers; but it crossed my mind too.
Sandra: thank you for your answer. I tried swapping the <tt:loop> tags to enclose the table name (you were right, it is DettaglioLinee), and lo and behold, it works like a dream. Can't tell you how happy that makes me.
As I mentioned, the transformation was auto-generated from the ABAP structure, so I didn't decide on the logic of the layout - I just renamed the tags in XSLT_TOOL. I'm not sure if SAP regard that as a feature or a teensy weensy bug-ette.
Anyway, thanks again for providing a solution to a 'transformation Newbie'. You weren't to know but the Italian government were about to start levying fines on my company for late resubmission of the correct XML files - as of tomorrow morning. Now we'll get them sent off in time!
Best regards,
John
2024 Jul 13 1:25 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |