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

Convert SAP to XML

Former Member
0 Likes
986

Hi All,

How to convert SAP to XML output ?

Thanks,

HP

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
930

Hi,

Tryb this function module

SAP_CONVERT_TO_XML_FORMAT

Regards,

V.Balaji

Hi All,

How to convert SAP to XML output ?

Thanks,

HP

5 REPLIES 5
Read only

Former Member
0 Likes
930

hi,

CALL TRANSFORMATION id

SOURCE my_data = ls_xml_struct

RESULT XML lt_my_xml_tab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\rre.XML'

FILETYPE = 'ASC'

tables

data_tab = lt_my_xml_tab

.

Reward if helpful.

Regards.

Praveen.

Read only

Former Member
0 Likes
931

Hi,

Tryb this function module

SAP_CONVERT_TO_XML_FORMAT

Regards,

V.Balaji

Read only

Former Member
0 Likes
930

Hi,

Use the following code,

tables : mara.

select-options : s_matnr for mara-matnr.

parameters : p_file1 type rlgrap-filename.

data : begin of itab occurs 0,

matnr LIKE mara-matnr,

maktx LIKE makt-maktx,

end of itab, xml_out type string,xmltab type swbhtmltable.

select * from makt into corresponding fields of table itab where matnr in s_matnr

and spras = 'EN'.

call transformation ('ID')

source tab = itab[]

result xml xml_out.

call function 'SWA_STRING_TO_TABLE'

exporting

character_string = xml_out

importing

character_table = xmltab.

if sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

call function 'GUI_DOWNLOAD'

exporting

filetype = 'BIN'

filename = 'D:\xx.xml'

tables

data_tab = xmltab.

REWARD POINTS IF HELPFUL,

VODKA

Read only

Former Member
0 Likes
930

Hi,

Use this code.

call transformation ('ID') source tab = itab1[] result xml xml_out.

filename = 'D:\FILENAME1.XML'.

call function 'SWA_STRING_TO_TABLE'

exporting

character_string = xml_out

importing

character_table = xmltab.

*----


Download

call function 'GUI_DOWNLOAD'

exporting

filetype = 'BIN'

filename = filename

tables

data_tab = xmltab[].

Regards,

Sankar.

Read only

Former Member
0 Likes
930

Thanks