‎2006 Aug 14 10:50 AM
Hi.
I have a program that reads and xml file. It uses cl_xml_document->import_from_file to read the file from a given path. This works fine, but my problem is that I need to run the program as a batch jobb and the import_from_file method uses gui_upload which can not be run as a batch (no_batch).
I need to find another way to read the file. Can anyone please help me?
/jon
‎2006 Aug 14 10:59 AM
I heard that it should be posible to use GUI_UPLOAD in background mode also. anyone who knows more about that?
‎2006 Aug 14 11:06 AM
‎2006 Aug 14 11:02 AM
Hi jon,
1. we have to use
OPEN DATASET, READ DATASET, CLOSE DATASET
2. concept / commands
3. for reading file from application server.
regards,
amit m.
‎2006 Aug 14 12:56 PM
ok, but if I have to use the open/read/close dataset solution I also have to rewrite my code to find det data in the xml-nodes.
The way I do it now is as follows:
----
CREATE XML DOCUMENT
----
create object lo_xml.
GET XML FROM FILE
call method lo_xml->import_from_file
exporting
filename = p_outfil
receiving
retcode = lv_retcode.
GET ROOT OF XML DOCUMENT --> ORDERS
w_root1 = lo_xml->get_first_node( ).
w_node_name = lo_xml->get_node_name( node = w_root1 ).
w_root2 = lo_xml->find_node( name = 'orders'
root = w_root1 ).
w_node_name = lo_xml->get_node_name( node = w_root2 ).
NAVIGATE DOWN TO DESIRED NODE AND LOOP AT THESE
w_index1 = 1.
clear w_continue1.
while w_continue1 = ''.
clear w_node_level_1.
w_node_level_1 = lo_xml->get_node_child( node = w_root2
index = w_index1 ).
***************
Any tips on how this can be done with the open dataset solution?
/jon