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

cl_xml_document

Former Member
0 Likes
1,471

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

4 REPLIES 4
Read only

Former Member
0 Likes
1,034

I heard that it should be posible to use GUI_UPLOAD in background mode also. anyone who knows more about that?

Read only

0 Likes
1,034

refer thses links:

Regards,

ravi

Read only

Former Member
0 Likes
1,034

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.

Read only

0 Likes
1,034

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