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

call function for creating xml

Former Member
0 Likes
581

Hi,

is there a function which I can use to create a XML from an internal table where I furthermore can use nodes and so on?

I knwo the transformation but I only want to know if there is a function which exist?

4 REPLIES 4
Read only

Former Member
0 Likes
551

did someone has an idea?

Read only

Former Member
0 Likes
551

Depends on what you really want to do. Try, e.g, SAP_CONVERT_TO_XML_FORMAT

Shahram

Read only

0 Likes
551

I use for testing the function :

CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'

EXPORTING

i_field_seperator = l_fieldseperator

i_xml_doc_name = l_docname

IMPORTING

pe_bin_filesize = l_filesize

TABLES

i_tab_sap_data = t_itab

CHANGING

i_tab_converted_data = t_convtab

EXCEPTIONS

conversion_failed = 1

OTHERS = 2.

which creates my XML, but when I donwload the file with

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

bin_filesize = l_filesize

filename = lf_docname

filetype = 'BIN'

TABLES

data_tab = t_convtab

EXCEPTIONS

file_open_error = 1

file_write_error = 2

invalid_filesize = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_filetransfer = 8

customer_error = 9

OTHERS = 10.

I furthermore have data with length and so on for the fields.

And the other question is where do I have to set which field is in which node in the xml?

Read only

Former Member
0 Likes
551

not actual