2021 Feb 01 7:06 AM
1) In the Below ABAP CDS View I have the column 'value' where i have some Data
2)In the below another ABAP CDS View I highlighted the column 'ItemText' which i have Data
3) Now My Requirement is that I need to develop another ABAP CDS View where I need to fetch only the records from the second ABAP CDS View which contains the data 'ItemText' column and the 'value ' column in the first ABAP CDS View and I cannot use the LIKE operator because I am getting error "comparison value of LIKE condition must be a character-type literal issue in ABAP CDS Views". please find the below screen shot and could any one please tell me how to handle this.
2021 Feb 01 8:22 AM
2021 Feb 01 9:06 AM
Hi Sandra,
Please find the screen shot as i am using Data Type Char.
2021 Feb 01 9:48 AM
Have you tried changing the condition columns' places? Like this:
JOIN zi_zdta_ruletext AS _sgtxt ON _sgtxt.bukrs = zacdoca.CompanyCode AND zacdoca.ItemText LIKE _sgtxt.value
2021 Feb 01 10:07 AM
Hi Sandra,
I have tried by changing the column but the issue is same
he same. please find the attached screen shot.
2021 Feb 01 10:15 AM
I see.
In this case try putting the LIKE condition in the WHERE clause.
2021 Feb 01 1:19 PM
2021 Feb 05 8:26 PM
Please see answer to this question: https://answers.sap.com/questions/401634/how-can-one-select-data-similar-to-sql-where-like-.html
I found it by copy-pasting the message text from your post into Google search.
2022 Jul 17 1:44 PM
Hi Durga,
you can't use LIKE in where condition in the view directly using parameters. It only allows literals (example below):
CHAR literal: 'example'
NUM literal: 456
To achieve your requirement you can create a table function and in the class implementation, you can put a nested select in the where condition.
Thanks,
Rowie