‎2005 Dec 01 7:02 AM
Hello,
I would like to use select-options. Normally you can specify a selection tab (sel) and a row of an table being registered in the ABAP dictionary.
I would like to use an internal table instead.
First I read data into the internal table. Next I would refer on one column of that internal using the select-options:
SELECT * FROM database-tab INTO itab
WHERE key1 = 'a'.
SELECT-OPTIONS: sel FOR itab.
It does not work, although the internal table is filled!!!
Can I use internal tables with select-options?
thx, holger
‎2005 Dec 01 7:06 AM
Dear,
You can only use elementary types with select-options.
Since your internal table is not elementary type so you can't use internal tables.
Rg,
VM
‎2005 Dec 01 7:08 AM
Hi you can only use elementary type with ur select options
for eg
SELECT-OPTIONS s1 FOR itab-kunnr.
REgards,
Abdul
‎2005 Dec 01 7:15 AM
is there any other possibility to use only specified entries of a database table for the select-options?
i wanted to use an internal table, where i read in specified entries and use that table for the select-options, but this is not possible...
any suggesntions?
thx, holger
‎2005 Dec 01 8:50 AM
Hallo Holger,
i think i get it now - thanks Amit !
here's an example:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR matnr-low.
SELECT matnr maktg FROM m_mat1t
INTO CORRESPONDING FIELDS OF TABLE f4_itab
WHERE mtart = 'DIEN'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MATNR'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'MATNR'
window_title = 'select material no.'
value_org = 'S'
TABLES
value_tab = f4_itab[].Andreas
‎2013 May 14 12:32 PM
Hi Andreas,
Your example is very good i got my output.
my requirement was, in output screen if u press select option field then only selected fields suppose to come for display. i created internal table did select query for that and displayed my selected field in select option F4 help.
Thanks a lot.
Ankit Rai
‎2005 Dec 01 7:12 AM
Hi Internal Table You Cannot Use ,
But if you have any type of that ITAB existing in sap then I think you can use .
regards
vijay
‎2005 Dec 01 8:40 AM
Hi holger,
1. i could not make out ur exact requirement.
2. from ur last post, what i understood partially
(may be im wrong)
that u want to use a select-option on your screen.
when user wants to select some value
u want to show your internal table (and not the default input field)
3. we can use FM
F4IF_FIELD_VALUE_REQUEST
just see the documentation.
Hope it helps.
regards,
amit m.
‎2005 Dec 01 1:29 PM
Hi Holger,
if you want the results of your db-select (e.g. you get 5 kunnr and want this 5 entries in your field) in the select-options field, try this:
DATA: z_kunnr TYPE dbtab-kunnr.
SELECT-OPTIONS so_kunnr FOR z_kunnr.
INITIALIZATION.
SELECT * FROM database-tab INTO itab
WHERE key1 = 'a'.
loop at itab into wa.
so_kunnr-sign = 'I'.
so_kunnr-option = 'EQ'.
so_kunnr-low = wa-kunnr.
APPEND so_kunnr.
endloop.
Now you have for every selected row from the db an entry in the itab so_kunnr. If you want to select datas from a db, you can use:
select * from db into table itab where key in so_kunnr.
‎2005 Dec 01 4:08 PM
Can you please explain your requirement with an example?
Srinivas