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 statement using alias names

Former Member
0 Likes
833

I have to fetch the maximum of lifnr and pass it to ITAB using TABLE alias names

Is this statement correct

Select * from Z123 A into table itab where lifnr = ( select max( lifnr ) from Z123 'B' where A.kunnr = B.kunnr) .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
642

Select * from Z123 <b>as</b> A into table itab where lifnr = ( select max( lifnr ) from Z123 <b>as</b> B where A.kunnr = B.kunnr) .

3 REPLIES 3
Read only

Former Member
0 Likes
643

Select * from Z123 <b>as</b> A into table itab where lifnr = ( select max( lifnr ) from Z123 <b>as</b> B where A.kunnr = B.kunnr) .

Read only

Former Member
0 Likes
642

Hi,

Use below code .

data:itab like Z123A occurs 0 with header line.

SELECT * FROM Z123A

INTO TABLE itab

WHERE matnr = ( SELECT MAX( lifnr )

FROM Z123B ) .

LOOP AT itab.

WRITE itab-lifnr.

ENDLOOP.

Here no need of using alias .

we then in case of joins for select stmt.

Please reward points if helpful...........

Thanks

Sivaparvathi.

Read only

0 Likes
642

its not working