SAP ABAP XSLT ASXML ENUM



Get Example source ABAP code based on a different SAP table
  



ABAP_ASXML - Mapping of Enumerated Types
The asXML representation of enumerated types is used in XSL transformations and in Simple Transformations. In both cases, the elementary values with enumerated types or the corresponding components of complex structures are converted in accordance with this mapping.
When an enumerated object is serialized, it is converted to string and the result is represented in the corresponding asXML format. The XML representation is the name of the associated enumerated constant or the component of the enumerated structure with a maximum of 30 characters.
When the enumerated variable is deserialized, the XML representation must correspond to the name of an enumerated value of the enumerated type in uppercase letters. The enumerated variable is then assigned the enumerated value in the base type. If the XML representation does not correspond to a name, this results in the exception CX_SY_CONVERSION_NO_ENUM_VALUE , which is usually wrapped in CX_TRANSFORMATION_ERROR.

ABAP_EXAMPLE_VX5
The example shows the serialization of an enumerated variable planet to XML. Then, the name of the value VENUS is replaced by JUPITER and the result is deserialized to planet. planet then contains the value 4. A deserialization of the XML value earth, on the other hand, fails, because the name must be specified in uppercase letters.
ABEXA 00812
ABAP_EXAMPLE_END