‎2009 Nov 20 1:41 PM
Hi
i search a class with the method, that can upload a xml file. Everybody know?
Regards abap
‎2009 Nov 20 2:00 PM
‎2009 Nov 20 2:00 PM
‎2009 Nov 20 2:09 PM
‎2009 Nov 20 2:11 PM
Did you search? XML has nothing to do with it - you'll probably get a thousand hits for file uploads. Now, if you want to transform the XML once you've uploaded it, that's another story. What do you want to do?
‎2009 Nov 20 2:13 PM
yes i forgot the search function now i programing a xml file upload
report z_local.
data lr_cl_xml_doc type ref to cl_xml_document.
data lf_sysubrc type sysubrc.
data lr_if_ixml_node type ref to if_ixml_node.
parameters pm_fil type localfile obligatory.
at selection-screen on value-request for pm_fil.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
importing
file_name = pm_fil.
start-of-selection.
create object lr_cl_xml_doc.
call method lr_cl_xml_doc->import_from_file
exporting
filename = pm_fil
receiving
retcode = lf_sysubrc.
check lf_sysubrc = 0.
call method lr_cl_xml_doc->get_first_node
receiving
node = lr_if_ixml_node.
lr_if_ixml_node = lr_cl_xml_doc->m_document.
‎2009 Nov 23 9:02 AM
now i have more question to xml
i had programing this and it's work
create object lr_cl_xml_doc.
call method lr_cl_xml_doc->import_from_file
exporting
filename = pm_fil
receiving
retcode = lf_sysubrc.
check lf_sysubrc = 0.
call method lr_cl_xml_doc->find_node
exporting
name = 'printObjects'
receiving
node = lr_if_ixml_node.
the xml structur looks like this but is not all date value from xml.
<PLU>
<longName></longName>
<popUp></popUp>
<pluParams>
<packageLength>25</packageLength>
<clockCycle mode = "On">
<packageLength>22</packageLength>
<stopOnError>No</stopOnError>
</clockCycle>
<date>
<created> 10.06.05</created>
<lastModified> 08.07.05</lastModified>
</date>
<runTime>
<timeElapsed>1399</timeElapsed>
<timerRunning>91</timerRunning>
<timeToStop>120</timeToStop>
<numOfPackages>517</numOfPackages>
</runTime>
<user name = "Administrator"/>
<loadCellSettings name = "STANDARD"/>
<refreshDesktop>Yes</refreshDesktop>
<labelMonitoring>3</labelMonitoring>
</pluParams>
<printObjects>
<printObject ID = "1" type = "numberField">
<source>event</source>
<type>net</type>
<factor>1.00000</factor>
<format>0,001</format>
<generalParams>
<xPos>235</xPos>
<yPos>500</yPos>
<font name = "MTBDLFRO" size = "10" region = "W-EUROPE"/>
<align>left</align>
<rotation>0</rotation>
<parentID>-2</parentID>
<externPO load = "No" name = "" pluGroup = ""/>
</generalParams>
</printObject>
<printObject ID = "2" type = "unitChar">
<type>weight</type>
<countryCode>CH</countryCode>
<generalParams>
<xPos>96</xPos>
<yPos>-1</yPos>
<font name = "ARIAL" size = "10" region = "W-EUROPE"/>
<align>left</align>
<rotation>0</rotation>
<parentID>1</parentID>
<externPO load = "No" name = "" pluGroup = ""/>
</generalParams>
</printObject>
the reference lr_cl_xml_doc is now reference of the node <printObjects>. In next step, i want find or search with a method by id continue node. How i do that?
i find a method in interface if_ixml_node but it won't to be work.
call method lr_if_ixml_node->find_from_gid
exporting
gid = 1
receiving
rval = lr_if_ixml_node_id.
Regards abap_begin
‎2009 Nov 23 10:35 AM