2008 May 30 6:23 AM
Hi,
Could someone tell me how to convert data from SAP to cXml please?
Nalina
2008 May 30 6:38 AM
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.
2008 Jun 03 7:31 AM
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
2008 May 30 7:30 AM
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
2011 Jan 05 7:28 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |