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

Select from view

Former Member
0 Likes
1,066

Hello all,

Is it possible to write select ststement for a view. If possible Please help me in the following

I want to select BATXT,

View is - V_T161,

Where condition based on BSART.

Please help,

Rakesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
966

Hi

If it is a Database View you can write the select statement similar to a Table

But it appears that this V_T161 appears to be a maintenance View

so you can't write a select statement

better write a select statement to the table T161 and use

select single bstxt from T161 into v_text where bsart = p_bsart.

Reward points for useful Answers

Regards

Anji

6 REPLIES 6
Read only

Former Member
0 Likes
967

Hi

If it is a Database View you can write the select statement similar to a Table

But it appears that this V_T161 appears to be a maintenance View

so you can't write a select statement

better write a select statement to the table T161 and use

select single bstxt from T161 into v_text where bsart = p_bsart.

Reward points for useful Answers

Regards

Anji

Read only

former_member404244
Active Contributor
0 Likes
966

Hi,

U cannot make a select,becoz it is a maintainence view.

Regards,

nagaraj

Read only

alex_m
Active Contributor
0 Likes
966
Read only

Former Member
0 Likes
966

Hi

Yes u can if it's a database view and u can use a SELECT statament, just as for a transparent table.

V_T161 is a maitenance view, so It can't do it a select, u need to read direclty T161 and T161T.

In your can u need T161T only:

SELECT SINGLE * FROM T161T WHERE SPRAS = SY-LANGU
                                   AND BSTYP = 'F' "< If it's a Purchase Order  
                                   AND BSART = <BSART>.
WRITE T161T-BATXT.

Max

Read only

Former Member
0 Likes
966

Hi.

V_T161 is a maitenance view, so It can't do it a select, u need to read direclty T161 and T161T.

In your can u need T161T only:

SELECT SINGLE * FROM T161T WHERE SPRAS = SY-LANGU

AND BSTYP = 'F' "< If it's a Purchase Order

AND BSART = <BSART>.

Reward all helpfull answers.

Regards.

Jay

Read only

0 Likes
966

Hi Jay!

Are you a good firend of Rakesh?

I don't know, but you should considere we are here to try to help and not to copy the answer in order to get some points.

Max