Hi,
When using the built-in function instr() in an ABAP CDS view I face the issue that specifying a character literal that could also be a numeric literal result in a compilation error: "Funktion INSTR: Parameter an Position 2 hat den falschen Datentyp NUMC" Translated into english it would be like 'function INSTR: parameter at position 2 has the wrong data type NUMC'. The CDS view is defined as follows:
@AbapCatalog.sqlViewName: 'z_test_jg3'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'test 2'
define view Z_Test3 as select from vbak { //Key key vbak.vbeln as SalesDocument, instr(vbak.vbeln, '50') as test
}
As you can see literal '50' is used. If I change the literal to e.g. ' 50' or 'a50' is error is gone (of course). However, field vbeln of table vbak does only contain numeric values. Thus, the intention of this statement is to check if the vblen contains string '50'. Is there any possibility to either indicate that '50' should be interpreted as character literal? Or is there any other possibility or work-around?
Best Regards,
Johannes