cancel
Showing results for 
Search instead for 
Did you mean: 

Case Sensitivity Issue with ListPicker in SAP MDK 24.4

carlos_sanchez8
Explorer
0 Kudos
195

Hi community,

I recently developed an application in SAP MDK where I'm using a ListPicker control connected to an OData service. Previously, this control was not case-sensitive, so it didn't matter whether the search text had uppercase or lowercase letters.However, since updating to version 24.4 of MDK, I've noticed a change in behavior. Now, when performing a search in the ListPicker, the entered text must exactly match the format stored in the database. For example, if the value is stored as "HOUSE" in the database and I type "House," no matches are found.

Has anyone else experienced this case sensitivity issue with the ListPicker? I'd appreciate any insights or suggestions on how to ignore case sensitivity or if there’s a workaround for this behavior.

Thanks in advance for any help you can provide!

Do you have any knowledge about this behavior? @Jitendra_Canal

 

View Entire Topic
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

 

Is your MDK app online or offline?

    • Go to Mobile Connectivity.
    • Click Launch in Browser for the specified destination.

      If online:
      First, check if you can filter the results in lowercase for the given entity. Navigate to the Mobile Services Admin UI:
      Depending on the OData version (V2 or V4), use the following filters:

    • For V4, append ?$filter=contains(<PropertyName>, 'tobago') to the entity set.
    • For V2, append ?$filter=substringof('tobago', <PropertyName>) to the entity set.

    If you see the expected results there, you should also see them in your MDK online app. If not, then the behavior is as expected.

  1. If offline:
    The offline SDK automatically handles case insensitivity, so you should be able to search without worrying about case.
    However, for online searches, you can enable case-insensitive searching using the Query Builder:

    • In the Target Binding for the List Picker, assign a rule to the QueryOptions property.

 

//this is an example for OData V2.

export default function SearchCustomer(context) {
    let search = context.searchString;
    let qoB = context.dataQueryBuilder();
    if (search && search != '') {
        let suppName = qoB.filterTerm(`substringof(tolower('${search}'),tolower(SupplierName))`);
        let defaultSearch = qoB.mdkSearch(search);
        qoB.filter().or(suppName, defaultSearch);
        return qoB;
    }
}

 

See this document for more details.

 

carlos_sanchez8
Explorer
0 Kudos
Thank you very much for your prompt response. I am currently using an OData V4 service. I followed your suggestion and tested by opening the OData service in the browser from Mobile Services, and I confirmed that the search only works with exact matches, as you mentioned. I tried to replicate the rule you suggested, adapting it for OData version 4, but unfortunately, I didn’t get the expected results. The behavior remains the same, with the search being case-sensitive. I appreciate any further guidance you can provide.Thank you very much for your prompt response. I am currently using an OData V4 service. I followed your suggestion and tested by opening the OData service in the browser from Mobile Services, and I confirmed that the search only works with exact matches, as you mentioned. I tried to replicate the rule you suggested, adapting it for OData version 4, but unfortunately, I didn’t get the expected results. The behavior remains the same, with the search being case-sensitive. I appreciate any further guidance you can provide.