SAP ST XML LITERALS
Get Example source ABAP code based on a different SAP table
ABAP_ST - Literal XML Elements and Attributes
Literal XML elements are XML elements that are not ST statements or that are not in the namespace
During serialization, literal XML elements and their literal attributes are passed to the target XML document unchanged. In deserializations they are compared with the XML source document word by word. In addition to the literal attributes, literal XML elements can also contain certain attributes with the namespace prefix
General Literal XML Elements
ABAP_SYNTAX
$[tt:lax=...$]
$[tt:extensible=...$]>
...
< /element>>
What does it do?
Here,
The optional ST-specific attributes
Serializing Literal XML Elements
In serializations, the element beginning
Latest notes:
For information about handling namespaces, see
NON_V5_HINTS
ABAP_HINT_END
Deserializing Literal XML Elements
In deserializations, the beginning of the element is compared with the current position of the outbound XML data. By default, the source XML data must contain an identically named element with all literal attributes
After a successful comparison of the element beginning, the element content is deserialized and then the element ending is consumed.
Special Form of Literal XML Elements
A special form of literal XML attributes combines the
ABAP_SYNTAX
$[tt:lax=...$]
$[tt:map=...$]
$[tt:length$|tt:minLength$|tt:maxLength='len'$] />>
This special form is a short form of:
< tt:value ref='node' $[map=...$]
$[length$|minLength$|maxLength='len'$] />
< /element>>
This makes it easy to formulate the frequent use case of expressing an elementary value as the content of an XML element.
The attribute
ABAP_EXAMPLE_VX5
The following ST program
TRNS DEMO_ST_XML_LITERALS1
The result of a serialization is as follows if
It should be noted that literal text that contains nothing but blank spaces (blanks and line breaks) is irrelevant in ST programs by default. For this reason, the serialization does not produce the following, for example:
abc
< /X>>
If the results of serializations with indents and line breaks are shown in examples, they are usually used for clarification and are not actually part of the result.
The following ST program
TRNS DEMO_ST_XML_LITERALS2
The following ST program
TRNS DEMO_ST_XML_LITERALS3
The following ST program
TRNS DEMO_ST_XML_LITERALS4
The following ST program
TRNS DEMO_ST_XML_LITERALS5
A correct attribute name with an incorrect attribute content raises the exception
ABAP_EXAMPLE_END