2007 May 08 9:24 AM
Hallow I have a table itab with employee number name and more fields
And I wont to move this table to xml file how can I do that and how can I check that it happen?
If sap have function plz tell how to use it
regards
Hallow I have a table itab with employee number name and more fields
And I wont to move this table to xml file how can I do that and how can I check that it happen?
If sap have function plz tell how to use it
regards
2007 May 08 9:27 AM
Hi antonio rodrigo ,
<b>Please check this sample program.
1. ABAP Internal Table -
> XML
XML ---> ABAP Internal Table
2. This program will show both.
3. It will do this for
T001 table.
4. Just copy paste in new program.
REPORT abc.
*----
DATA
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.
DATA: xml_out TYPE string .
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
DATA: xmlupl TYPE string .
FIRST PHASE
FIRST PHASE
FIRST PHASE
*----
Fetch Data
SELECT * FROM t001 INTO TABLE t001.
*----
XML
CALL TRANSFORMATION ('ID')
SOURCE tab = t001[]
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 = itab.
*----
Download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filetype = 'BIN'
filename = 'd:\xx.xml'
TABLES
data_tab = itab.
SECOND PHASE
SECOND PHASE
SECOND PHASE
BREAK-POINT.
REFRESH t001.
CLEAR t001.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'D:\XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
LOOP AT upl.
CONCATENATE xmlupl upl-f INTO xmlupl.
ENDLOOP.
*----
XML
CALL TRANSFORMATION ('ID')
SOURCE XML xmlupl
RESULT tab = t001[]
.
BREAK-POINT.
I have checked this Program, This is perfect fine.
We can use this logic to generate the XML source code.</b>
Good Luck and thanks
AK
2007 May 08 9:28 AM
Hello Antonio
Simply use the <b>CALL TRANFORMATION</b> statement:
DATA:
ld_xml TYPE string.
CALL TRANSFORMATION ident
SOUCE itab = lt_itab " your itab with employee number
RESULT XML ld_xml.Regards
Uwe
2007 May 08 9:30 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |