Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create view

Former Member
0 Likes
826

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?

7 REPLIES 7
Read only

Former Member
0 Likes
793

any help?

thanks

Read only

Former Member
0 Likes
793

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

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
793

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

Read only

0 Likes
793

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

Read only

Former Member
0 Likes
793

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

Read only

0 Likes
793

hi shiba,

thanks.

i need to have where as the variable is passed from the abap program.

Read only

Former Member
0 Likes
793

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