Start of Content Area

Background documentation Mapping Rules  Locate the document in its SAP Library structure

The general asXML format (ABAP Serialization XML, canonical XML representation) is used to map values of elementary ABAP data objects to XML and to map XML to ABAP data objects. This involves a mapping of elementary ABAP types to XML schema data types (http://www.w3.org/TR/xmlschema-2/#built-in-datatypes). The asXML format is described in detail in the ABAP keyword documentation. The following table is intended only as a concise overview.

It shows you the mapping of the predefined elementary ABAP types to XML schema data types, with dates and times represented in accordance with ISO 8601 and binary data in base 64.

 

ABAP Type

ABAP Example

XML Schema Type

XML Example

c

" Hi"

string

" Hi"

d

"20020204"

date

"2002-02-04"

f

-3.140...0E+02

double

"-3.14E2"

i, b, s

-123

int, unsignedByte, short

"-123"

n

"001234"

string (pattern [0-9]+)

"001234"

p

-1.23

decimal

"-1.23"

string

" Hello "

string

" Hello "

t

"201501"

time

"20:15:01"

x

"ABCDEF"

base64Binary

"q83v"

xstring

"456789AB"

base64Binary

"RweJqw=="

 

In addition to the mapping for the predefined elementary ABAP types, a special mapping is defined for elementary ABAP data objects whose types reference special domains of ABAP Dictionary.

 

Domain

ABAP Example

XML Schema Type

XML Example

XSDBOOLEAN

"X", " "

boolean

"true", "false"

XSDDATETIME_Z, XSDDATETIME_LONG_Z, XSDDATETIME_OFFSET, XSDDATETIME_LOCAL

"20060727170334"

dateTime

"2006-07-27T17:03:34Z"

XSDLANGUAGE

"E", "D"

language

"EN", "DE"

XSDUUID_RAW, XSDUUID_CHAR

"123456781234ABCDEF12123456789012"

UUID

"12345678-1234-abcd-ef12-123456789012"

 

These domains permit mappings between ABAP data objects and XML schema data types that do not correspond directly to anything in ABAP. Conventions are defined in this case for serialization and deserialization. Deserialization requires the XML value to be in the expected format; otherwise an exception is raised.

 

 

End of Content Area