2007 Feb 12 9:47 AM
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
2007 Feb 12 10:08 AM
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
2007 Feb 12 9:53 AM
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.
2007 Feb 12 9:53 AM
You could use Select * as the first field in your table is of type lqua.
2007 Feb 12 10:08 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |