SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Data Interfaces and Communication Interfaces → ABAP and XML → Transformations for XML → Simple Transformations → ST - Serialization and Deserialization → ST - Transformation of ABAP Values → ST - tt:value, Elementary Data Objects →ST - xsd-type, Validation
Syntax
... xsd-type="type"
[xsd-maxInclusive="max"]
[xsd-maxExclusive ="max"]
[xsd-minInclusive="min"]
[xsd-minExclusive ="min"]
[xsd-totalDigits="dgts"]
[xsd-fractionDigits="dgts"] ...
Effect
These attributes can be used with tt:value, and tt:write and tt:read to validate the value.
The attribute xsd-type can be used to specify an XML schema data type type. The serialized or deserialized value must be in the value range of this type. If not, an exception of the class CX_ST_VALIDATION_ERROR is raised, which is not caught directly but by using CX_ST_SERIALIZATION_ERROR, CX_ST_DESERIALIZATION_ERROR, and its superclasses instead. The following subtypes of xsd:decimal can be specified for type:
Together with the attribute xsd-type, the following "constraining facets" permitted by the XML schema can be specified as further attributes:
After the transformation from ABAP, serializations perform the validation to XML. Before the transformation from XML, deserializations perform the validation to ABAP. In both cases, the data type of the bound ABAP data object is ignored.
Example
Serialization of ABAP Data with Validation
The transformation only accepts numbers between 30000 and 32767. The following ABAP program calls the transformation and catches the validation exceptions.