‎2008 Apr 23 10:15 AM
for select-options whether we have to give table names in TABLES statement.
if i dont give table names it is showing error
‎2008 Apr 23 10:17 AM
Hi,
For some fields you need to declare tables.
Example
tables: t247.
select-options: s_month for t247-mnr.
Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 23, 2008 11:18 AM
‎2008 Apr 23 10:18 AM
The FOR statement requires a reference. You will need to specify a table.
Or you could do something like.
DATA: w_matnr type matnr.
select-options s_matnr for w_matnr.
‎2008 Apr 23 10:18 AM
You use the statement SELECT-OPTIONS <seltab> for <f> to declare a selection table in the program that is linked to the <f> column of a database table, or to an internal <f> field in the program*. A selection table is an internal table object of the standard table type that has a standard key and a header line. Selection tables are used to store complex selections using a standardized procedure. They can be used in several ways. Their main purpose is to directly translate the selection criteria into database selections using the WHERE addition in Open SQL statements.
The basic form of the SELECT-OPTIONS statement is as follows:
SELECT-OPTIONS <seltab> FOR <f>.
It declares a selection criterion <seltab> that is linked to a field <f> that has already been declared locally in the program. The names of selection criteria are currently restricted to eight characters. Valid data types of <f> include all elementary ABAP types except data type F. You cannot use data type F, references and aggregate types. If you want to use the selection criterion to restrict database selections, it is a good idea to declare <f> with reference to a column of the corresponding database table. It then inherits all of the attributes of the data type already defined in the ABAP Dictionary. In particular, the field help (F1) and the possible entries help (F4) defined for these fields in the Dictionary are available to the user on the selection screen.
For more details have a look at below link.
[Selection Criteria|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba74635c111d1829f0000e829fbfe/frameset.htm]
I hope it helps.
Thanks,
Vibha
Please mark all the useful answers
‎2008 Apr 23 10:19 AM
hi,
for select-options must give tables statement, other wise it showing error.
if u use tables it creats default work area so it is performance issue.
so, u do like this
declare a variable of that data type, and use in that select-option declaration.
ex
data v_matnr type matnr.
select-option material for v_matnr.
reward if useful.
regards,
chandu.
‎2008 Apr 23 10:22 AM
tables: ekko.
select-options:
s_ebeln for ekko-ebeln.
or
data:ebeln like ekko-ebeln.
select-options:
s_ebeln for ebeln.
‎2008 Apr 23 10:23 AM
it should have either
tables:mara.
select-options:matnr for mara-matnr.
or
DATA spfli_wa TYPE spfli.
SELECT-OPTIONS s_carrid FOR spfli_wa-carrid.
SELECT *
FROM spfli
INTO spfli_wa
WHERE carrid IN s_carrid.
ENDSELECT.
reward if useful
‎2008 Apr 23 10:25 AM
Hi,
If you are using a field name in select-options,then it has no independent existance hence we need to declare it with respect to a table( hence we do tablename-field and so we declare with keyword "tables"..)
If you are using a domain,data element of the field then you will not require the declaration "tables"
Regards
Byju