cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA CE Functions

Former Member
0 Kudos

Hi,

I want to use sub query using CE functions.

Below is query:

select matnr from EKPO where matnr in( select matnr from mara where attyp = '02');

How can we achieve this using CE functions??

Regards,

Shivani

Accepted Solutions (0)

Answers (2)

Answers (2)

rindia
Active Contributor
0 Kudos

Hi Shivani,

What Ravi said is true.

For your scenario instead of using sub-query, the same task can be accomplished using join which is more efficient than sub-query.

So the CE function equivalent is:

O_EKPO = CE_COLUMN_TABLE(EKPO,[MATNR]);

O_MARA = CE_COLUMN_TABLE(MARA,[MATNR]);

P_MARA = CE_PROJECTION(:O_MARA,[MATNR],'ATTYP=02');

VAR_OUT= CE_JOIN(:O_EKPO, :P_MARA, [MATNR]);

I not tested this code and in case of compilation error, modify 'ATTYP=02' to 'ATTYP=''02''' like that.

Regards

Raj

former_member184768
Active Contributor
0 Kudos

Hi Shivani,

What you are looking at is similar to having JOIN operation between EKPO and MARA on MATNR. You can use CE_JOIN for two table variables, one based on EKPO and other based on MARA with filter on ATTYP = '02'

Regards,

Ravi