Deletion Indicator 
At runtime, a consumer application may need to explicitly tell a provider to delete elements of a particular data type. If this is not explicitly communicated and only a value is sent, a consumer application may not be able to determine whether a field is intended to be retained, replaced, or deleted. If the element will not be changed, the consumer application does not need to send the element to the provider. The element only needs to be sent if it will be changed.
This can be realized using a so-called deletion indicator. To use the deletion indicator for an element, you need to set the Deletable attribute for that element definition in the Enterprise Services Repository.
You can set the Deletable attribute for elements of aggregated and freestyle data types.
This new attribute results in a type extension in the XML schema.
The deletion indicator is defined in the namespace http://sap.com/xi/SAPGlobal/GDT.
The XML schema for the deletion indicator looks like the following:
Syntax
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmnls="http://sap.com/xi/SAPGlobal/GDT" targetNamespace="http://sap.com/xi/SAPGlobal/GDT"> <xsd:simpleType name="Indicator"> <xsd:restriction base="xsd:boolean" /> </xsd:simpleType> <xsd:attribute name="DeletionIndicator" type="Indicator" /> </xsd:schema>
Note
The Deletable attribute can only be set if you specify the values minOccurs = 0 and maxOccurs = 1 in the Occurrence field.
If the Deletable attribute is set for an element, that element is also set tonillable.
Using nillable, it is possible to send an element with DeletionIndicator=”true”, but without any additional content. This can be done using xsi:nil=”true”.
The Deletable element has XML schema similar to this example, for an element called e2:
Syntax
<xsd:schema targetNamespace="http://proxy.com/proxyveri/C2PFU" xmlns:sapgdt="http://sap.com/xi/SAPGlobal/GDT" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ccts="urn:un:unece:uncefact:documentation:standard:CoreComponentsTechnicalSpecification:3.0" xmlns:xi0="http://proxy.com/proxyveri/C2PFU" xmlns="http://proxy.com/proxyveri/C2PFU">
<xsd:import namespace="http://sap.com/xi/SAPGlobal/GDT"/>
<xsd:complexType name="C2PFU"
<xsd:sequence>
<xsd:element name="e1" nillable="true" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="text">
<xsd:attribute ref="sapgdt:DeletionIndicator"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="e2" nillable="true" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="e21" type="text"/>
</xsd:sequence>
<xsd:attribute ref="sapgdt:DeletionIndicator"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="text">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
<xsd:element name="C2PFU" type="C2PFU"/>
</xsd:schema>
The Deletable attribute is not generated as an additional field in the ABAP Dictionary structures. An enhanced controller structure and an enhanced controller table are used to handle the Deletable attribute. The controller structure has an additional boolean field for the Deletable attribute. This structure is used for the enhanced controller table.
If the Deletable attribute is active for any field in a proxy structure, the enhanced controller table is used instead of the old one when a proxy structure is generated.
If the Deletable attribute is active, values are mapped at runtime. The following ABAP constants are available to handle the field.
Enumeration Value |
Controller Structure Value (ABAP Constant) |
XML Value (ABAP Constant) |
X |
SAI_CTRL_TRUE |
true |
space |
SAI_CTRL_FALSE |
false |
Note
To handle the Deletable attribute, extended XML handling must be active.