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

XML File

Former Member
0 Likes
626

Hi,

Need to find out some stuff. I want to import some data using an XML file. I have written a FM to read the file from Windows. The question is, can I use FM 'KD_GET_FILENAME_ON_F4' to get the file name from UNIX? And do I need to write a another routine to read file cause I read that I need to use OPEN DataSet and READ DataSet to read and dump the contents into a internal table for UNIX? Thanks.

Regards,

Conrad

1 ACCEPTED SOLUTION
5 REPLIES 5
Read only

Former Member
0 Likes
581

Hi Conrad,

I'm trying to read/write xml files using ABAP Objects .I did followed the documentation on using various objects to do this.But still having problems.can you pl send a piece of ABAP code that reads or writes xml file.

Thanks in advance.

Bharath.

Read only

0 Likes
581

You can import the file directly and read the XML file using the following codes. Hope this helps.

DATA: xmlfile TYPE REF TO cl_xml_document_base.

DATA: retcode LIKE sy-subrc.

DATA: filename TYPE localfile.

*Import an XML file and return the Code.

retcode = xmlfile->import_from_file( filename ).

Read only

0 Likes
581

Thanks for your response,as i'm trying to write/ build a xml file/dom from internal tables and write in in file system ,i thought of using iXML library given by SAP.

Is that possible to create dom,build XML file and render it to file system using class cl_xml_document_base.Is there any other related class to this to create a complete XML application

Thanks,

Bharath.

Read only

0 Likes
581

Yes it is. Read the description of each method in the cl_xml_document_base class. It will give u a clue on what each method does.