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 statment - fill internal table

Former Member
0 Likes
953

Hi,

I have following situation:


TYPES: BEGIN OF q_data,
         i_lqua LIKE lqua,
         v_xxx(20) type c,
       END OF q_data.

DATA: a_data TYPE STANDARD TABLE OF q_data.

Now I would write a select statment and fill the table a_data.


select lqua~matnr lqua~werks... from lqua inner join mch1 into (i_lqua-matnr, i_lqua-werks.....)...

Is it possible to write a statement without writing the whole structure (all the names of columns) of lqua in the SQL-statement (lquamatnr lquawerks lqua~........)?

Thanks

Michael

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
727

no in innerjoin you can not do that because if you use * instead of column name then system will be confuse on the common fields between two tables so you have to do like that only.

but 1 thing instead of lqua every time you can use a, b or any alias for that table.

select af1 af2 into corresponding fields of table itab from dbtab as a inner join dbtab1 as b on af1 = bf1.

regards

shiba dutta

no in innerjoin you can not do that because if you use * instead of column name then system will be confuse on the common fields between two tables so you have to do like that only.

but 1 thing instead of lqua every time you can use a, b or any alias for that table.

select af1 af2 into corresponding fields of table itab from dbtab as a inner join dbtab1 as b on af1 = bf1.

regards

shiba dutta

3 REPLIES 3
Read only

Former Member
0 Likes
727

1. you can write that but i think you have to write that in SELECT ...ENDSELECT.

select lquamatnr lquawerks... from lqua inner join mch1 into (i_lqua-matnr, i_lqua-werks.....

append i_lqua.

endselect.

2. OR you can use INTO CORRESPONDING FIELDS OF TABLE

select lquamatnr lquawerks... from lqua inner join mch1 into corresponding fields of table i_lqua.

Read only

Former Member
0 Likes
727

You could use Select * as the first field in your table is of type lqua.

Read only

Former Member
0 Likes
728

no in innerjoin you can not do that because if you use * instead of column name then system will be confuse on the common fields between two tables so you have to do like that only.

but 1 thing instead of lqua every time you can use a, b or any alias for that table.

select af1 af2 into corresponding fields of table itab from dbtab as a inner join dbtab1 as b on af1 = bf1.

regards

shiba dutta