on 09-17-2013 6:59 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.