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

Simple Transformation Exception

Former Member
0 Likes
2,100

Hello,

I am tying to map XML to ABAP(deserialize) but receive a CX_ST_MATCH_ELEMENT Exception.

Below is my Simple Transformation, the calling method, and the XML snippet I am tying to deserialize.

-


<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">

<tt:root name="ROOT"/>

<tt:template>

<SndgInst>

<tt:value ref="ROOT"/>

</SndgInst>

</tt:template>

</tt:transform>

-


method PARSE_XML.

DATA:

sndginst(10) type c value ' ',

l_exception_error TYPE REF TO cx_st_error.

  • parse the xml content

TRY.

CLEAR: l_exception_error.

CALL TRANSFORMATION (i_st_name)

SOURCE XML i_xml_string

RESULT root = sndginst.

  • catch exception

CATCH: cx_st_error INTO l_exception_error.

ENDTRY.

endmethod.

-


<S2SCTScf:SndgInst ymlns:S2SCTScf="urn:S2SCTScf:xsd:$SCTScfBlkCredTrf">ZYDOFRP0</S2SCTScf:SndgInst>

-


I have tried adding a reference for the namespace 'S2SCTScf' but receive the same exception.

I think it must have something to do with the namespace prefix and I have tried several different versions of the Simple transformation, such as <S2SCTSCF:SndgInst> as my tag reference, to no avail.

The exception class does not provide a lot of useful information and since you cannot debug a Simple Transformation it is a guessing game.

Thanks in advance for your help.

Best Regards,

Mark Lengel

Edited by: Mark Lengel on Mar 31, 2009 11:32 AM

4 REPLIES 4
Read only

0 Likes
1,166

I've exactly the same problem.

My XML Input Stream contains Namespaces in the root element for e.g.

<Measurement xmlns="es.xxx.com" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns3="http://www.w3.org/1998/Math/MathML">

The Simple Transformation always raise an CX_ST_MATCH_ELEMENT Exception.

If i delete the xmlns declarations, the Element will be found and everything is o.k.

I've also tried to avoid this by adding the tt:extensible="deep-dynamic" attribute but it doesn't matter.

<tt:template>

<Measurement tt:extensible="deep-dynamic">

I use WebAS 6.40, ERP 2004.

I hope the Community could help us. Maybe it's bug in the XML Libraries.. etc..

Kind Regards

Chris

Read only

former_member156446
Active Contributor
0 Likes
1,166

similar issues:

Read only

0 Likes
1,166

Unfortunately the threads above didn't contain any solution - has nobody found this problem? If you got an external xml file , you always have namespace declarations in the root tag.

any other ideas?

Read only

Former Member
0 Likes
1,166

I am facing similar issue. Do you have any solution to avoid exception?

Regards

Sandeep K