on 01-21-2008 10:01 AM
Hello guys
I'va an XML with this structure
<ECR>
<change_no>00BAPIECR014</change_no>
<status>01</status>
<valid_from>09012008</valid_from>
<descript>Descripcion</descript>
<reason_chg>Razon Cambio</reason_chg>
<rank>00</rank>
<release_key>00</release_key>
<header_status_list>
<status>
<stat>I0001</stat>
<inact></inact>
</status>
<status>
<stat>I0001</stat>
<inact>X</inact>
</status>
<status>
<stat>I0251</stat>
<inact>X</inact>
</status>
<status>
<stat>I0252</stat>
<inact></inact>
</status>
<status>
<stat>I0253</stat>
<inact></inact>
</status>
<status>
<stat>I0254</stat>
<inact></inact>
</status>
<status>
<stat>I0268</stat>
<inact></inact>
</status>
</header_status_list>
<WBS_BOM>
<material>PR-004</material>
<plant>0002</plant>
<psp_element>LV0081</psp_element>
<wbs_bom_status_list>
<status>
<stat>I0259</stat>
<inact>X</inact>
</status>
<status>
<stat>I0260</stat>
<inact></inact>
</status>
<status>
<stat>I0263</stat>
<inact></inact>
</status>
</wbs_bom_status_list>
</WBS_BOM>
<DIR>
<doc_type>ZEP</doc_type>
<doc_number>TEST_PROT_001</doc_number>
<doc_vers>00</doc_vers>
<doc_part>000</doc_part>
<dir_status_list>
<status>
<stat>I0259</stat>
<inact>X</inact>
</status>
<status>
<stat>I0260</stat>
<inact></inact>
</status>
<status>
<stat>I0263</stat>
<inact></inact>
</status>
</dir_status_list>
</DIR>
</ECR>
and i want to pass it to an internal table i tried to use SDIXML_XML_TO_DOM y SDIXML_DOM_TO_DATA but i don't know how to transform the document that returns SDIXML_XML_TO_DOM into a document that can be passed to SDIXML_DOM_TO_DATA
I've seen the instruction CALL TRANSFORMATION but i can't use it successfull and the only way that remains to me is to use TEXT_CONVERT_XML_TO_SAP but i,ve heard abaout it returns a spool order, can i convert this spool to an internal table?
Hope somebody bring some ligth to me
thanks
I meet the same issue and find it can be sovled by such ways:
--> im_xml_xstring type xstring.
data: lo_element type ref to if_ixml_element,
lo_document type ref to if_ixml_document,
l_problems type dcxmlprbl.
field-symbols: <tab> type standard table.
call function 'SDIXML_XML_TO_DOM'
exporting
xml = im_xml_xstring
is_normalizing = 'X'
importing
document = lo_document
exceptions
invalid_input = 1
others = 2.
check sy-subrc = 0.
lo_element ?= lo_document->get_first_child( ). ---> this is the point
check lo_element is not initial.
call function 'SDIXML_DOM_TO_DATA'
exporting
data_as_dom = lo_element
CONTROL = CONTROL
importing
dataobject = <tab>
problems = l_problems
exceptions
illegal_object = 1
others = 2
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alberto,
please refer to this blog. and its successor blogs.
/people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
Ranjeet Singh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the CALL TRANSFORMATION trans.
is the most used method to convert XML to internal tables and vice versa.
Why can you use the same. You can also write your own XSL transform if you have format convserion issues in ABAP-XSL
Regards
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.