Application Development 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: 

XML

Former Member
0 Kudos

Hi,

I hv one program it is used to convert ABAP datas to XML file . its working but datas r not coming to file. i attached the program also . PLZZZZZZZ

Its Urgent. points will be given.

DATA : ADRC LIKE TABLE OF ADRC WITH HEADER LINE.

DATA : BEGIN OF itab OCCURS 0,

a(100) TYPE c,

END OF itab.

DATA: xml_out TYPE string .

SELECT name1 name2 FROM ADRC INTO TABLE ADRC.

*----


XML

CALL TRANSFORMATION ('ID')

SOURCE tab = adrc[]

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 = 'c:\ADRC1.xml'

TABLES

data_tab = itab.

REFRESH ADRC.

CLEAR adrc.

Thanks

Girish M

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

check this modified code

DATA : ADRC LIKE TABLE OF ADRC WITH HEADER LINE.

DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.

data: begin of temp_tab occurs 0,
     name1 like adrc-name1,
     name2 like adrc-name2 ,
     end of temp_tab .

DATA: xml_out TYPE string .
refresh: temp_tab .
SELECT name1 name2 FROM ADRC INTO TABLE temp_tab.

*------------------- XML
CALL TRANSFORMATION ('ID')
SOURCE tab = temp_tab[]
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 = 'c:ADRC1.xml'
TABLES
data_tab = itab.

REFRESH ADRC.
CLEAR adrc.

2 REPLIES 2

athavanraja
Active Contributor
0 Kudos

check this modified code

DATA : ADRC LIKE TABLE OF ADRC WITH HEADER LINE.

DATA : BEGIN OF itab OCCURS 0,
a(100) TYPE c,
END OF itab.

data: begin of temp_tab occurs 0,
     name1 like adrc-name1,
     name2 like adrc-name2 ,
     end of temp_tab .

DATA: xml_out TYPE string .
refresh: temp_tab .
SELECT name1 name2 FROM ADRC INTO TABLE temp_tab.

*------------------- XML
CALL TRANSFORMATION ('ID')
SOURCE tab = temp_tab[]
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 = 'c:ADRC1.xml'
TABLES
data_tab = itab.

REFRESH ADRC.
CLEAR adrc.

0 Kudos

Hi Durairaj ,

Thanks yaar. i hv given the points also.

Another requriment is for me that is interface b/w EWM and Legacy .same thing EWM should send data's to legacy in XML file.can give me sample program.

Thanks

Girish M