cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Gateway - null values returned as empty string

cdata
Member
0 Kudos

Normally SAP returns NULL values as null in json format or includes the m:null="true" attribute in XML.

There are fields such as "Currency" which seem to reference fields of a navigation property. In case the navigation property is null, the field is also null (as seen from expanding it or by filtering with Currency eq null).

However, the field is returned as an empty string, which is incorrect. Is any way to return the correct value?

This can also be verified by filtering the values, using Currency eq '' returns no rows, Currency eq null returns all rows where to_Currency is null, but the 'Currency' field is returned as an empty string ''. There is a mismatch on filtering and returned value. The filter assumes the value is null but the value is returned as an empty string.

Screenshot and part of the schema included.

<EntityType Name="SEPMRA_C_POAPV_AnalyticsType" sap:semantics="aggregate" sap:label="Purchase Order" sap:content-version="1"> <Key> <PropertyRef Name="ID" /> </Key> <Property Name="ID" Type="Edm.String" Nullable="false" sap:sortable="false" sap:filterable="false" /> <Property Name="PurchaseOrder" Type="Edm.String" MaxLength="10" sap:aggregation-role="dimension" sap:display-format="UpperCase" sap:label="Purchase Order" sap:quickinfo="Purchase Order ID" sap:creatable="false" sap:updatable="false" /> <Property Name="Supplier" Type="Edm.String" MaxLength="10" sap:aggregation-role="dimension" sap:display-format="UpperCase" sap:text="SupplierT" sap:label="Supplier" sap:quickinfo="Supplier ID" sap:value-list="standard" /> <Property Name="SupplierT" Type="Edm.String" MaxLength="80" sap:attribute-for="Supplier" sap:display-format="UpperCase" sap:label="Supplier Name" /> <Property Name="Requestor" Type="Edm.String" MaxLength="10" sap:aggregation-role="dimension" sap:display-format="UpperCase" sap:text="RequestorT" sap:label="Requested by" sap:quickinfo="Requestor" sap:creatable="false" sap:updatable="false" sap:value-list="standard" /> <Property Name="RequestorT" Type="Edm.String" MaxLength="81" sap:attribute-for="Requestor" sap:label="Name" sap:quickinfo="Full Name" /> <Property Name="Currency" Type="Edm.String" MaxLength="5" sap:aggregation-role="dimension" sap:text="CurrencyT" sap:label="Currency" sap:value-list="standard" sap:semantics="currency-code" /> <Property Name="CurrencyT" Type="Edm.String" MaxLength="15" sap:attribute-for="Currency" sap:label="Short text" /> <Property Name="NumberOfItems" Type="Edm.Int32" sap:aggregation-role="measure" sap:label="Number of Items" sap:filterable="false" /> <Property Name="NetAmount" Type="Edm.Decimal" Precision="16" Scale="3" sap:aggregation-role="measure" sap:unit="Currency" sap:label="Net Amount" sap:quickinfo="EPM: Total Net Amount" sap:filterable="false" /> <Property Name="EarliestDeliveryDate" Type="Edm.DateTime" Precision="0" sap:aggregation-role="measure" sap:display-format="Date" sap:label="Earliest Delivery Date" sap:filterable="false" /> <Property Name="LatestDeliveryDate" Type="Edm.DateTime" Precision="0" sap:aggregation-role="measure" sap:display-format="Date" sap:label="Latest Delivery Date" sap:filterable="false" /> <NavigationProperty Name="to_Currency" Relationship="SEPMRA_PO_APV.assoc_0CA726A046D0955F87B8E71A1A25DB53" FromRole="FromRole_assoc_0CA726A046D0955F87B8E71A1A25DB53" ToRole="ToRole_assoc_0CA726A046D0955F87B8E71A1A25DB53" /> <NavigationProperty Name="to_Requestor" Relationship="SEPMRA_PO_APV.assoc_CF70BBF4C81BE4E1731A1ED0DD5F3D8E" FromRole="FromRole_assoc_CF70BBF4C81BE4E1731A1ED0DD5F3D8E" ToRole="ToRole_assoc_CF70BBF4C81BE4E1731A1ED0DD5F3D8E" /> <NavigationProperty Name="to_Supplier" Relationship="SEPMRA_PO_APV.assoc_CA89C968979FCBF2EBA72B84134060A5" FromRole="FromRole_assoc_CA89C968979FCBF2EBA72B84134060A5" ToRole="ToRole_assoc_CA89C968979FCBF2EBA72B84134060A5" /> </EntityType>

Accepted Solutions (0)

Answers (0)