‎2007 Feb 23 7:19 AM
hi,
1) if i want to CREATE a VIEW base on the sql statement, I cannot find the 'IN' operator in the selection conditions tab in maintain view.
SELECT caaa cbbb cccc cddd
FROM tab1 AS a INNER JOIN tab2 AS b ON axxx = bxxx
INNER JOIN tab3 AS c ON byyy = cyyy
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE a~xxx = i_xxx AND
a~zzz IN ('04' , '08') AND
b~type = '1'.
2) let say i able to create a view base on the select statement above,
when i quote the select statement using view, the select statement is simplified as below:
select * from zview where a~xxx = i_xxx.
correct?
‎2007 Feb 23 7:39 AM
‎2007 Feb 23 7:47 AM
In SE11 when you create the View, in the Selection Conditions tab,
you can have two lines with TAB2-ZZZ = '04' OR
2nd line TAB2-ZZZ = '08'.
Regards,
Ravi
‎2007 Feb 23 7:56 AM
Hi,
1) IN is not allowed since it is generally used with selection options. ALso you can alternatively use OR and mention all the conditions that you want to mention using IN.
2) YES but since IN is not possible you have to use like below.
SELECT caaa cbbb cccc cddd
FROM tab1 AS a INNER JOIN tab2 AS b ON axxx = bxxx
INNER JOIN tab3 AS c ON byyy = cyyy
INTO CORRESPONDING FIELDS OF TABLE itab
WHERE axxx = i_xxx AND btype = '1'
AND ( azzz = '04' OR azzz = '08' ).
Regards,
Sesh
‎2007 Feb 23 8:16 AM
hi sesha,
the sql statement is working fine.
i am actually asking on creating view.
i got the 1st question and i need the clarification on my 2nd question.
thanks
rgds
‎2007 Feb 23 8:20 AM
AS PER YOR 2ND QUESTION YOU ARE CORRECT OR YOU CAN USE IT WITHOUT WHERE ALSO IF YOU ADD THAT CONDITION IN VIEW.
REGARDS
SHIBA DUTTA
‎2007 Feb 23 8:32 AM
hi shiba,
thanks.
i need to have where as the variable is passed from the abap program.
‎2007 Feb 23 8:37 AM
HI El,
For your 2nd question you don't nee A~ you can simple write:
select * from zview where xxx = i_xxx. "XXX must be a field in the view.
REgards,
Ravi