Skip to Content
Author's profile photo William van Strien

Duet Enterprise ‘Query’ with non-nullable import parameters and default values

Duet Enterprise scenario:

  • Gateway DataModel ‘Query’ operation with one or more import parameters; with default values in the mapped RFC
  • ‘Query’ operation exposed via a BCS::Finder method in the BDC Model that is generated via the BDC Publisher; each of the import parameters mapped to BCS Filter parameters
  • SharePoint view on the ‘query’ result; e.g. via ExternalList, Business Data List, custom webpart

In such Duet Enterprise application context you might experience that when you (on purpose or by accident) do not enter concrete values for the Filter parameters, SharePoint retrieves + renders a different set of external SAP items as expected. You would expect the mapped SAP RFC to apply its default value(s). However, this is only true when the types of the import/filter parameters are nullable. If not nullable, SharePoint is required to submit a concrete value when invoking the Finder method. If missing from front-end invocation, SharePoint will submit the default value for the non-nullable type. E.g. for a DateTime, this means the value ‘1-1-1900’. 

You have 2 options to alter this SharePoint BCS invocation behavior:

  1. In the BCS Model, declare the non-nullable types as nullable.
    <TypeDescriptor TypeName=”System.Nullable`1[[System.DateTime, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089]]” Name=”IV_SEARCH_BEGDA” AssociatedFilter=”IV_SEARCH_BEGDA”>
  2. In the BCS Model, search for a method parameter with name “<filter-import-parameter>Specified”. If present, make sure it’s default value is set to ‘false’.
    <TypeDescriptor TypeName=”System.Boolean” Name=”IV_SEARCH_BEGDASpecified”>
            <DefaultValue MethodInstanceName2=”Find_ExternalItems” Type=”System.Boolean”>false</DefaultValue>

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi William,

      I have the same issue from sharepoint side   , my date field is nullabale as per option 1 but still while querying , I get the default value as 1-1-1900 and don't see that method in BCS model as per option2 . can you please suggest.