cancel
Showing results for 
Search instead for 
Did you mean: 

Import XML file into ABAP WD

Former Member
0 Kudos

Hi,

Is there any way to upload an XML file into ABAP WD?

I just saw a blog for Java WD.

<a href="/people/johann.marty/blog/2006/10/03/create-a-web-dynpro-tree-from-an-xml-file:///people/johann.marty/blog/2006/10/03/create-a-web-dynpro-tree-from-an-xml-file

Is there a similar facility in ABAP WD?

Regards,

Haresh.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Haresh,

The ui element FileUpload exists in WDA as well. You still need to implement the xml->tree structure conversion though. For parsing an xml file in ABAP you can use sXML, iXML or XSLT.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

Thanks for your reply. Could you please elaborate on the solution.

Regards,

Haresh.

thomas_szcs
Active Contributor
0 Kudos

Hi Haresh,

Well, you could iterate through the DOM tree of the XML using sXML or iXML and created corresponding context nodes. With XSLT you could transform the XML file into one or more internal tables and then create the context nodes out of it. There is extensive documentation available regarding XML processing in ABAP. Specific questions should be posted to the ABAP forum as the true experts in this area have their home there.

Best regards,

Thomas

Murali_Shanmu
Active Contributor
0 Kudos

There is a command in ABAP to extract data from XML files. CALL TRANSFORMATION....

Check out Transaction code SSTDEMO2.

Regards,

Murali.

Former Member
0 Kudos

hey u can do this by using CALL Transformation id.. command..

here is the example code where i wrote this to convert it DATA to XML format...it may help u..

DATA : BEGIN OF l_xml_tab OCCURS 0,

a(100) TYPE c,

END OF l_xml_tab.

DATA : xml_out TYPE string .

DATA : lw_xml_tab LIKE LINE OF l_xml_tab.

*----


XML

CALL TRANSFORMATION id "('ID')

SOURCE tab = gt_outtab[]

RESULT XML xml_out.

*----


Convert to TABLE

CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'

EXPORTING

i_string = xml_out

i_tabline_length = 100

TABLES

et_table = l_xml_tab.

OPEN DATASET p_lgfil1 FOR OUTPUT IN BINARY MODE.

LOOP AT l_xml_tab INTO lw_xml_tab.

TRANSFER lw_xml_tab TO p_lgfil1.

ENDLOOP.

CLOSE DATASET p_lgfil1.

Former Member
0 Kudos

Hi Haresh ,

Please reward points if it helps you..

rgds

Kali

Answers (0)