Application Development 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: 

Call Transformation-- Run Time Error --XML XSLT -- Simple Tranformation

Former Member
0 Kudos

I have a requiremnt where I have to upload XML into an internal table with field names...

I am using the Call Transformation statement for this.. I keep getting the same error when ever I run it..

Run Time Error---Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_ST_MATCH_ELEMENT', was not caught

and

therefore caused a runtime error.

The reason for the exception is:

XML matching error

Expected was element-start: "xyz" [ ] Read was invalid: " " [ ].

XML File

<?xml version="1.0" encoding="UTF-8" ?>

- <xyz>

<book>gvbhfghgfhf</book>

<author>Gambardella, Matthew</author>

<title>XML Developer's Guide</title>

<genre>Computer</genre>

</xyz>

SAP Simple Transformation source code from T.code XSLT_TOOL

<?sap.transform simple?>

<tt:transform template="temp1"

xmlns:tt="http://www.sap.com/transformation-templates" xmlns:def="http://www.sap.com/abapxml/types/defined">

<tt:root name="T_BOOK"/>

<tt:root name="T_AUTH"/>

<tt:root name="T_TIT"/>

<tt:root name="T_GEN"/>

<tt:template name="temp1">

<xyz>

<book>

<tt:value ref="T_BOOK"/>

</book>

<author>

<tt:value ref="T_AUTH"/>

</author>

<title>

<tt:value ref="T_TIT"/>

</title>

<genre>

<tt:value ref="T_GEN"/>

</genre>

</xyz>

</tt:template>

</tt:transform>

Can some one please help me with this...is it better done in XSLT or Simple tranformation what is the difference... I am stuck with thsi issue since many days .. can some one please help..

Edited by: sk123456 on Oct 18, 2009 12:30 PM

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

>

> <?xml version="1.0" encoding="UTF-8" ?>

> - <xyz>

> <book>gvbhfghgfhf</book>

>

Is the minus sign really in the XML ? if yes, that's the problem, remove it (it's invalid to have something at this place)

6 REPLIES 6

Sandra_Rossi
Active Contributor
0 Kudos

>

> <?xml version="1.0" encoding="UTF-8" ?>

> - <xyz>

> <book>gvbhfghgfhf</book>

>

Is the minus sign really in the XML ? if yes, that's the problem, remove it (it's invalid to have something at this place)

0 Kudos

Its not in the notepad file but when I open it in internet explorer etc it appears... But cant see the '-' in the internal table though.

I have also found one interesting this, when i pass the XML directly i.e hard code it there is no exception caused...

Edited by: sk123456 on Oct 19, 2009 9:05 AM

Edited by: sk123456 on Oct 19, 2009 9:07 AM

0 Kudos

I ve found the problem .. i was passing the whole internal table with header line of type string into the Call Transformation statement whereas i should be passing only the work area..

Thanks Sandra

0 Kudos

header lines are obsolete, don't use them, you'll avoid problems

0 Kudos

Thanks for the tip but SAP still has some F.Ms etc which need them .. So I guess I am just waiting for SAP to really do something about it

0 Kudos

I'd like to know at least one FM which really reads or returns the header line of a TABLES parameter. Note: FMs may change the header line of course but it is the same value as one row in the internal table body, we should use this last.

Okay, maybe there are a few ones, but it's very rare.

Internal tables without header line may be transmitted to TABLES parameters without any problem.