cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use CTE in a table functions in HANA?

former_member383962
Participant
0 Kudos

Hi Experts,

I just want to know, can we use CTE in a Table Functions in HANA?

Accepted Solutions (0)

Answers (1)

Answers (1)

eralper_yilmaz
Participant
0 Kudos

Hello,

Not CTE expression but you can assing the SELECT statement output to a table variable and then return that variable as follows

cte =    select 
     vbeln
   from "SAPABAP1"."VBAK"
   where 
     vbeln between :minV and :maxV;
return :cte;

You can place above code as the body of the table function where CTE select list maps to the columns of the returning table structure