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

How to convert table?

Former Member
0 Likes
652

Hi all,

i have following problem:

**********************************

types: begin of XML_LINE,

DATA(256) type x,

end of XML_LINE.

types: begin of XML_LINE2,

all(1000) TYPE c,

end of XML_LINE2.

data: XML_TABLE type table of XML_LINE.

data: XML_TABLE2 type table of XML_LINE2.

XML_TABLE2 has records in it. Those records i'd like to "convert" to xml_table. (From C to X)

Can anyone give me a hint?

Thanks in advance, best regards

Frank

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
610

Hi,

use 'SAP_CONVERT_TO_XML_FORMAT'......

or

to convert internal table to xml format you could use CALL TRANSFORMATION key word

data: xml_out type string .

call transformation (`ID`)

source output = youritab

result xml xml_out.

thanks,

Reward If Helpful.

Hi all,

i have following problem:

**********************************

types: begin of XML_LINE,

DATA(256) type x,

end of XML_LINE.

types: begin of XML_LINE2,

all(1000) TYPE c,

end of XML_LINE2.

data: XML_TABLE type table of XML_LINE.

data: XML_TABLE2 type table of XML_LINE2.

XML_TABLE2 has records in it. Those records i'd like to "convert" to xml_table. (From C to X)

Can anyone give me a hint?

Thanks in advance, best regards

Frank

3 REPLIES 3
Read only

Former Member
0 Likes
611

Hi,

use 'SAP_CONVERT_TO_XML_FORMAT'......

or

to convert internal table to xml format you could use CALL TRANSFORMATION key word

data: xml_out type string .

call transformation (`ID`)

source output = youritab

result xml xml_out.

thanks,

Reward If Helpful.

Read only

amit_khare
Active Contributor
0 Likes
610

Check FM - CHAR_HEX_CONVERSION

Also check this code -

Consider the following code snippet -

data : char type c,

hexa type x.

Now, both these variables are of 1 byte each. However, they store different kinds of data, so we have -

hexa = '41'.

write : hexa to char.

write: char , hexa.

hexa is going to store the hexadecimal number 41. (the decimal equivalent is 65). The first write statement does the automatic type conversion. so we get the 65th ASCII character in the character variable (which is the capital A).

~As found in forum.

Regards,

Amit

Reward all helpful replies.

Read only

0 Likes
610

Hi Amit,

the problem is i want to convert from char to hexa:

When i want to do this as you decribed it (write char to hexa. ),

i get following error:

hexa must be of type C,N,D or T

Thanks in advance, best regards

Frank