06-25-2008 11:47 AM
Hi SAP gurus,
I was using a select stmt. with were clause of Select-options it was working fine,
now my scenerio is changed i need to read an internal table
with key of select-options....
how to read internal table with key S_MATNR (Select-options).
06-25-2008 11:52 AM
You cannot use READ TABLE but LOOP AT ITAB will work
data: t_mara type TABLE OF mara,
e_mara type mara.
SELECT-OPTIONS: s_matnr for mara-matnr.
LOOP at t_mara INTO e_mara WHERE matnr in s_matnr.
ENDLOOP.
06-25-2008 11:50 AM
reading a internal will always return single record. but in select options is itself works as a table. so you need to read the table for each value of select options by putting a loop.
Regards,
Azad.
06-25-2008 11:52 AM
You cannot use READ TABLE but LOOP AT ITAB will work
data: t_mara type TABLE OF mara,
e_mara type mara.
SELECT-OPTIONS: s_matnr for mara-matnr.
LOOP at t_mara INTO e_mara WHERE matnr in s_matnr.
ENDLOOP.
06-25-2008 11:58 AM
Hi,
We can certainly do this.
We need to loop the internal table with select-options condition.
Example :
LOOP AT ITAB WHERE FIELD = S_FIELD.
.............
ENDLOOP.
This should solve your problem.
Plz reward if useful.
Thanks,
Dhanashri.
06-25-2008 12:03 PM
Loop at the select option and read the table for each value of select option.
There is no other way out, we can't not use select-options as key for read statment.
Regards
Bikas