Skip to Content
0
Mar 28, 2018 at 02:03 PM

Can I select the records from a table PROJ where the length of the PSPID is 13 characters only?

153 Views

I am working on a requirement where I need to select the latest record from PROJ table where the PSPID starts with SE and the length of PSPID is 13 Characters only.

I have written the Select Query this way. But in this I cant restrict the selection of PSPID to 13 characters length. I do not want to select the entries with more than or less than 13 characters length and also which do not start with SE.

SELECT pspid from proj INTO TABLE @DATA(lt_proj)
UP TO 10 ROWS WHERE pspid LIKE 'SE%'
ORDER BY erdat DESCENDING.

In this select query the length restriction can not be possible. Can CDS views help us in achieving this requirement. Kindly let me know.