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

SAP to cXML

Former Member
0 Likes
919

Hi,

Could someone tell me how to convert data from SAP to cXml please?

Nalina

4 REPLIES 4
Read only

Former Member
0 Likes
762

Hi use this :


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

Or 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 If Found Helpful.

Read only

0 Likes
762

Hi Rock,

Could you send me the same kinda code to convert it into cXML?

I am bit confused where its displayin in XML or cXML?

please please please

Read only

Former Member
0 Likes
762

Hi Friend,

Try with function module SAP_CONVERT_TO_XML_FORMAT..

it is a good function module...

Else try with class CL_IXML

Regards

Krishnendu

Read only

Former Member
0 Likes
762

.