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

Dump while coverting XML UTF32 to SAP

toshitjawale
Explorer
0 Likes
1,628

Hi Experts,

I am facing a problem while converting the UTF32 file in sap.

I have developed a program to create the Purchase order with the data coming from XML file,For testing Purpose I have generated the testing XML file from system and while using the system generated XML file my program works fine.

But when the XML coming from user it is showing the Dump

"Matching error when executing a Simple Transformation." screen shot attached.Though the structure of both the files are same (1.System generated 2.User file).

Please suggest your solution.

Thanks in Advance.

Hi Experts,

I am facing a problem while converting the UTF32 file in sap.

I have developed a program to create the Purchase order with the data coming from XML file,For testing Purpose I have generated the testing XML file from system and while using the system generated XML file my program works fine.

But when the XML coming from user it is showing the Dump

"Matching error when executing a Simple Transformation." screen shot attached.Though the structure of both the files are same (1.System generated 2.User file).

Please suggest your solution.

Thanks in Advance.

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,509

First of all, catch the exception, see the detailed message provided in the exception object, then revert back if you don't find the solution. You should also attach the XML file here, how could we analyze otherwise?

Read only

toshitjawale
Explorer
0 Likes
1,509

Hi,

Files : indentcreate-1.txtcfaindentgenerated.txt

open these file by changing the extensions as XML.

IndentCreate.xml works fine but the other one is not working

and we are not able to find the difference between those.

please let me know if any info needed

Read only

0 Likes
1,509

Thanks.

Yes, please, provide what I requested : the detailed message from the exception object CX_ST_MATCH_ELEMENT (use TRY CATCH). Display it using debug if you don't know how to get the text.

By the way, your file is UTF-16 (little endian by the way, with a leading BOM), not UTF-32 ! Anyway, I don't see the reason why it fails with CX_ST_MATCH_ELEMENT. I see that your dates DD/MM/YYYY do not conform classic XML date format (YYYY-MM-DD), so maybe SAP just don't convert them and it attempts copying them including the slashes and there's a data loss exception (but it should be CX_ST_CONVERSION_DATA_LOSS (unless you set the ignore loss option), not CX_ST_MATCH_ELEMENT)

I just saw this SAP note: 1450949 - Simple Transformation exception CX_ST_MATCH_ELEMENT, and you should check whether there are other notes.


Read only

Former Member
0 Likes
1,509

hi,

in case you do not find a solution with the simple tranformation, you may convert your input xml stream to an iXML document and convert it using FM SDIXML_DOM_TO_DATA. This one is able to handle deep structures and table types.

You first need the gr_document (ref to IF_IXML_DOCUMENT), look at google for a how-to.

gs_xml_data is the complete (SAP DDIC) data structure, but I prefer to use string data type during this step to handle number conversion issues.

DATA:  lr_xmldocelem  TYPE REF TO if_ixml_element,
       ls_ctl       TYPE dcxmldescl.

  ls_ctl-warn_treat = 'E'.
  ls_ctl-err_treat = space.

  lr_xmldocelem = gr_document->get_root_element( ).

* parse provided XML document into our structure
* structure used should contain only Strings, mapping happens later!
  CALL FUNCTION 'SDIXML_DOM_TO_DATA'
    EXPORTING
      data_as_dom    = lr_xmldocelem
      control        = ls_ctl-dcxmldescl
    IMPORTING
      dataobject     = gs_xml_data
*       Problems       =
    EXCEPTIONS
      illegal_object = 1
      OTHERS         = 2.
* .....