on 2016 Jan 19 9:27 AM
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
Request clarification before answering.
After checking the documentation for
I don't find INSTR() to be a supported SQL function.
In fact the SAP HANA expression editor for the information views seems to be the only place where this function is actually officially defined.
Where do you find this to be a supported function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lars,
goning via http://help.sap.com/abapdocu_750/en/index.htm --> ABAP Keyword Documentation -> ABAP Dictionary -> ABAP CDS in ABAP Dictionary -> ABAP CDS Entities -> ABAP CDS DDL Statements -> ABAP CDS DEFINE VIEW -> ABAP CDS SELECT -> ABAP CDS SELECT Predefined Functions -> ABAP CDS sql_functions -> ABAP CDS String Functions
there, this function is listed.
Best,
Johannes
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.