‎2007 Jun 11 9:05 AM
Hi Gurus,
1. In the code, CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD has been used
to uplaod the excel sheet data.
2. After upload,its been tried to convert the uploaded data to XML by following
code.
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
iStream = streamFactory->CREATE_ISTREAM_STRING( xmlString ).
iXMLParser = iXML->create_parser( stream_factory = streamFactory
istream = iStream
document = xmlDoc ).
iXMLParser->parse( ).
ixmlDocument = xmlDoc.
3. After creation of xmlDoc its trying to get root element from xml doc by
rootnode = if_ixml_document~get_root_element.
its not returning the root element reference to rootnode.
4. In method cl_ixml_document->if_ixml_document~get_root_element, its calling
below statement
system-call ixml
did 954859521
parameters
cl_ixml=>the_iXML
me
name
rval.
and rval has became null reference.
Could anyone help me to resolve this problem.
Thanks & Regards,
Bhuvana.
‎2007 Jun 11 9:13 AM
‎2007 Jun 11 10:19 AM
Hi Vasanth,
I tried the function module and its dumping in the line inside the FM (line no 53)
l_oref_descr_source ?=
cl_abap_typedescr=>describe_by_data( <fs_temp_data> ).
I couldn't proceed. Can u suggest me ?
Thanks.
‎2007 Jun 11 10:05 AM
do you want to convert the excel file to xml file or read the data in excel and convert that to xml.
if you want to convert excel file to xml (excel xml) the best option is to open the file in excel and saveas xml (excel xml) file.
if you want to just convert the data to xml.
gui_upload to upload excel file and read the data in to itab.
and then
use
call transformation key word to convert itab to xml
‎2007 Jun 11 10:27 AM
I have uploaded my excel file to SAP and converted into xml by the following way.
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
iStream = streamFactory->CREATE_ISTREAM_STRING( xmlString ).
iXMLParser = iXML->create_parser( stream_factory = streamFactory
istream = iStream
document = xmlDoc ).
iXMLParser->parse( ).
ixmlDocument = xmlDoc.
when I retrive the root node from ixmldocument its not returning the value in root node. (if_ixml_document~get_root_element. )
I tried call transformation as well. That statement also leeds to dump.
I tried the standard demo program (BCALV_TEST_FULLSCREEN) which is using call transformation. That is also dumping.
Could you please suggest me ?
Thanks
‎2007 Jun 11 10:31 AM
can you post your call transformation code.
(with relevent data declarations)
i dont see call transformation being used in BCALV_TEST_FULLSCREEN
whats the dump message
‎2007 Jun 14 3:24 PM
Hi,
Now I could able to execute the same program. But I couldn't get and node data from the imported file.
1. In the code, CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD has been used
to uplaod the excel sheet data.
2. After upload,its been tried to convert the uploaded data to XML by following
code.
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
iStream = streamFactory->CREATE_ISTREAM_STRING( xmlString ).
iXMLParser = iXML->create_parser( stream_factory = streamFactory
istream = iStream
document = xmlDoc ).
iXMLParser->parse( ).
ixmlDocument = xmlDoc.
3. After creation of xmlDoc its trying to get root element from xml doc by
<b>rootnode = if_ixml_document~get_root_element.
name = rootnode->get_attribute( 'name' ).</b>
I am not getting other node data also ?
I couldn't find where I am doing the mistake.
Can any one help me ?