Skip to Content

Passing paramer in ABAP CDS Views

Hi Experts,

I am new to CDS , am getting below error while passing a parameter for LIKE is Where clause.

Error : The Like condition can only contain character like comparison values.

pstatus is character type. So am confused here.

And also i wanted a new column for some constant values , which is not part of the table (zmm_temp).

@AbapCatalog.sqlViewName: 'ZV_MY_REQ'
@AbapCatalog.compiler.CompareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Get All Request Based on User and Status'
define view ZCDS_REQUESTS with parameters pusername : syuname ,
                               pstatus : abap.char( 5 )
as select from zmm_temp 
} where requested_by = :pusername and status like :pstatus

Request your quick help .

Thanks in Advance


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 24, 2017 at 07:12 AM

    If you are new, it is a good idea, to learn to read the documentation (F1-help).

    Only character-like literals without domain prefix are allowed for rhs.

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Horst,

      Is this means I cannot use a string dynamically to use in WHERE clause for LIKE operation?

      Even by converting the parameter data type using a CONCAT(), etc function...

      I actually wonder how I can filter for example materials starting with 'M' for example, so I want to use WHERE clause similar to " matnr like 'M%' "

      But of course I want to pass M as a parametric value