SAP ST XSD TYPE



Get Example source ABAP code based on a different SAP table
  


• xsd-type ABAP_ST_ELEMENT
• xsd-maxInclusive ABAP_ST_ELEMENT
• xsd-maxExclusive ABAP_ST_ELEMENT
• xsd-minInclusive ABAP_ST_ELEMENT
• xsd-minExclusive ABAP_ST_ELEMENT
• xsd-totalDigits ABAP_ST_ELEMENT
• xsd-fractionDigits ABAP_ST_ELEMENT

ABAP_ST - xsd-type, Validation

ABAP_SYNTAX
... xsd-type='type'
$[xsd-maxInclusive='max'$]
$[xsd-maxExclusive ='max'$]
$[xsd-minInclusive='min'$]
$[xsd-minExclusive ='min'$]
$[xsd-totalDigits='dgts'$]
$[xsd-fractionDigits='dgts'$] ...

What does it do?
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. The following subtypes of xsd:decimal can be specified for type : xsd:byte, xsd:decimal, xsd:int, xsd:integer, xsd:long, xsd:negativeInteger, xsd:nonNegativeInteger, xsd:nonPosistiveInteger, xsd:positiveInteger, xsd:short, xsd:unsignedByte, xsd:unsignedInt, xsd:unsignedLong, and xsd:unsignedShort.
Together with the attribute xsd-type, the following restrictions (constraining facets) allowed by the XML schema can be specified as further attributes:
xsd-maxInclusive, xsd-maxExclusive The value must be less than or equal to or less than max. max must be in the value range of the XML schema data type and cannot be less than a simultaneous lower limit min.
xsd-minInclusive, xsd-minExclusive The value must be greater than or equal to or greater than min . min must be in the value range of the XML schema data type and cannot be greater than a simultaneous upper limit max.
xsd-totalDigits, fractionDigits The value can have a maximum of dgts digits or decimal places. dgts must fit the other restrictions.
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.

ABAP_EXAMPLE_VX5
Serialization of ABAP Data with Validation in the simple transformation DEMO_ST_XSD_TYPE.
TRNS DEMO_ST_XSD_TYPE
The transformation only accepts numbers between 30000 and 32767. The following ABAP program calls the transformation and catches the validation exceptions.
ABEXA 01718
ABAP_EXAMPLE_END