Skip to Content
0
May 19, 2020 at 09:32 AM

Match + In in HANA (compare multiple wildcards to record)

113 Views

Hi everyone,

In HANA, I want to get records based on wildcards. Currently I'm using the MATCH function which works against 1 pattern for comparison but I have multiple patterns.

The patters are in a Z table created in my SAP system with fields like "BUKRS" (Company Code), "UNAME" (User Name) which can be filled with wildcards such as "BUKRS" = '21*' or "BUKRS" = *01*. For example purposes, I'm only mentioning these fields but I have more.

MATCH is working fine with 1 pattern (I tested this with an input parameter as a procedure but also as a list from my Z table) but ignoring the rest. Combining MATCH and IN (for multiple patterns) gives an error.

I tried in SQL "BUKRS" like $$INPUT_BUKRS$$ (no commas), MATCH ("BUKRS", $$INPUT_BUKRS$$) with no success.

Any suggestions?

Thank you!

Cristian