2007 Mar 07 10:00 AM
Hi All,
I have a simply question. I have experience with microsoft SQL.
Can i use in ABAP SQL something else
SELECT column1 column2 'ABC'
FROM ...
INTO ....
'ABC' - some constant
Thanks for advice in advance
Martin
Hi,
Can you explain ur requirement?
Why wull you have constants as fields in tables
are you looking for this
tables mara.
select single matnr from mara into mara-matnr where matnr eq 'ABC'.
2007 Mar 07 10:02 AM
Hi,
No,You can't use constants, use only the Fields that are present in the Table in the Select statement in ABAP.
Regards,
Anji
2007 Mar 07 10:05 AM
Hello Martin,
Only u can select the fields from the table.
In ur case u can do like this:
SELECT column1 column2 column3
FROM ...
INTO ....
where column3 = 'ABC' " CHECK HEREVasanth
2007 Mar 07 10:05 AM
HI Martin
In select statement the fields should be in the table from which we are retrieving the data , and u need to give the names of fields only in that syntax , u can not use other than the fields of that table ,it will give a syntax error in this case.
2007 Mar 07 10:06 AM
Hi Martin,
As u are aware that, Select statement is basically used to get data from Database tables u cant select constants from it as u need to specify the fields names which u want to select from the DBtable.
Use
Select * from dbtable into corresponding fields of table itab.
Regards,
Priyanka.
2007 Mar 07 10:06 AM
hi,
this wont work because u have to specify only the fields present in the table that is in the from clause.
regards.
2007 Mar 07 10:07 AM
Hi,
Can you explain ur requirement?
Why wull you have constants as fields in tables
are you looking for this
tables mara.
select single matnr from mara into mara-matnr where matnr eq 'ABC'.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |