Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

XML

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

Tags:
Former Member
replied

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 View this answer in context
Not what you were looking for? View more on this topic or Ask a question