SAP ST TT EXTENSIBLE



Get Example source ABAP code based on a different SAP table
  


• extensible ABAP_ST_ELEMENT

ABAP_ST - tt:extensible, Extensibility of Literal XML Elements

ABAP_SYNTAX
... tt:extensible='on'$|'deep-static'$|'deep-dynamic'$|'off'$|'deep-off' ...

What does it do?
In deserializations, XML elements in the input stream that are not specified in the ST program normally produce an error. If the processed XML format is to be extensible, elements that are not specified explicitly can be skipped without further processing through specification of the optional attribute tt:extensible. The attribute can have the following values:
The value on states that the current element may have direct subelements that are not explicitly specified. This is the standard setting.
Values deep-static and deep-dynamic state that the current element and its subelements can be enhanced. The value off deactivates extensibility for the current element but not its subelements. In other words, direct subelements cannot be added to the element but its (specified) subelements can be.
The value deep-off deactivates extensibility for the current element and its subelements. These settings can be overwritten locally in individual subelements.
The values deep-static and deep-dynamic have different areas of validity:
deep-static only has an effect within the part of the program in which it is set.
deep-dynamic is effective across template calls using tt:apply and tt:call.
The deep extensibility that is configured using deep-static and deep-dynamic also takes effect in case distinctions with tt:switch and groupings with tt:group by skipping unexpected elements that are not covered by a case.

ABAP_EXAMPLE_VX5
The transformation DEMO_ST_EXTENSIBLE_1 shows that extensibility together with optional elements (such as elements that are only deserialized when a condition occurs) causes problems, since extensibility generally means that such optional elements are not found.
TRNS DEMO_ST_EXTENSIBLE_1
Passing an input stream < r > < x/> < a > 1 < /a> < b > 2 < /b><(><<)>/r>
does not produce the deserialization A=1 since the unexpected element x sets the condition for a to false. Both x and a are skipped as extension elements and only the mandatory element b is deserialized as B=2. The problem can be solved by using tt:group , although this also resolves the order of a and b:
TRNS DEMO_ST_EXTENSIBLE_2
The class CL_DEMO_ST_EXTENSIBLE calls both transformations with the XML data shown above and displays the results.
ABAP_EXAMPLE_END