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

abap to xml help

Former Member
0 Likes
618

Hallow

I move file from internal table to xml

And I wont to now if I can change this context that automatic I get In file

<b><?xml version="1.0" encoding="iso-8859-8-i" ?>

- <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"></b>

Next question my table is in lower case and In file I get it in upper case ,how can I get it like I send (lower case).

Next here in my code I use ID (I TAKE IT FROM SDN) WHAT DOES IT MEAN

CALL TRANSFORMATION <b>('ID')</b>

SOURCE itab = person_tab

RESULT XML xml_table.

REGARDS

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
584

Hi,

you can take the help from this code :

*----


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 .

*----


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:\file_name.xml'

TABLES

data_tab = itab.

Regards,

Sandeep Kaushik

Hallow

I move file from internal table to xml

And I wont to now if I can change this context that automatic I get In file

<b><?xml version="1.0" encoding="iso-8859-8-i" ?>

- <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"></b>

Next question my table is in lower case and In file I get it in upper case ,how can I get it like I send (lower case).

Next here in my code I use ID (I TAKE IT FROM SDN) WHAT DOES IT MEAN

CALL TRANSFORMATION <b>('ID')</b>

SOURCE itab = person_tab

RESULT XML xml_table.

REGARDS

3 REPLIES 3
Read only

athavanraja
Active Contributor
0 Likes
584

Q2. table name and filed name will always be in upper case

Q3. ID is the name of the XSLT program which is responsible for converting itab to xml format. (you can view the program from SE80->edito object->transformation)

Read only

Former Member
0 Likes
585

Hi,

you can take the help from this code :

*----


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 .

*----


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:\file_name.xml'

TABLES

data_tab = itab.

Regards,

Sandeep Kaushik

Read only

Former Member
0 Likes
584

Hello,

Why would you like to change the generated header?

It's generated automatically, so you can use the reverse transformation, ie from xml to abap...

Regards,

Walter