10-29-2007 2:11 PM
Hi,
I have a select-option on the selection screen,I want to read that data into an internal table, how should I do that ?
Please help, its urgent.
Thanks in advance.
Regards,
Dkaza
10-29-2007 2:18 PM
Hi,
tables mara.
data itab like mara occurs 0 with header line.
select-options: s_matnr for mara-matnr.
start-of-selection.
select * from mara into table itab where matnr in s_matnr.
loop at itab.
write:/...
endloop.
Try this,
kc
10-29-2007 2:13 PM
Hi Deepti,
The select-option is itself an internal table.
Do u want the low value and high value of the select-option in the internal table as 2 rows??
Thank you.
10-29-2007 2:17 PM
Hi,
I have the select option for material number.Now once the user enters the material numbers I want to read all those material numbers into a particular table and then for all these records I want to do a database fetch.
Tried to use READ Table but it doec not help the way I wanted.
Deepti
10-29-2007 2:33 PM
Using the select options in a select statement :
SELECT-OPTIONS: SO-MFRPN FOR MARA-MFRPN.
SELECT * INTO TABLE T_MARA
FROM MARA
WHERE MFRPN IN SO-MFRPN.
(Remember, there is a conversion exit on MATNR, so ranges are not adequate for this field)
Regards
10-29-2007 2:13 PM
SELECT-OPTIONS are internal tables, so loop AT <select-option-name> to get the values you want
LOOP AT <SO>.
<SO>-SIGN : I for include, E for exclude
<SO>-OPTIONS for the test EQ, BT, etc.
<SO>-LOW for the first value
<SO>-HIGH for the high value (BT, NB)
ENDLOOP.
Regards
10-29-2007 2:16 PM
Hi,
TYPES: BEGIN OF t_range,
sign(1),
option(2),
low(40),
high(40),
END OF t_range.
TYPES: ty_range TYPE STANDARD TABLE OF t_range.
DATA: wa_range TYPE t_range,
r_range TYPE ty_range.
loop at select-option.
move-corresponding select-option to wa_range.
append wa_range to r_range.
clear wa_range.
endloop.
That's all
10-29-2007 2:18 PM
Hi,
tables mara.
data itab like mara occurs 0 with header line.
select-options: s_matnr for mara-matnr.
start-of-selection.
select * from mara into table itab where matnr in s_matnr.
loop at itab.
write:/...
endloop.
Try this,
kc
10-29-2007 2:23 PM
Hi,
If you want to fetch the records for all the values in the select options, you do it directly as
Select * from database_table into i_tab
where field in select_option.
eg:
SELECT-OPTIONS:s_vstel FOR tvst-vstel.
SELECT vstel INTO TABLE i_vstel FROM tvst
WHERE vsttel IN s_vstel.
Reward if useful.
Thanks,
Muthu.
10-29-2007 2:31 PM
Hi Deepti,
TABLES : marc.
SELECT-OPTIONS: s_matnr FOR marc-matnr.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE marc-matnr,
END OF itab.
START-OF-SELECTION.
SELECT matnr INTO TABLE itab FROM marc
WHERE matnr IN s_matnr.
Message was edited by:
Perez C
10-29-2007 2:40 PM
Hi,
Refer following small code
Here p_orgunt is select-option field
and t_org_list is my internal table...
Looping through select-option field
LOOP AT p_orgunt.
Move org unit from select-option field into t_org_list
wa_org-objid = p_orgunt-low.
APPEND wa_org TO t_org_list.
ENDLOOP.
10-29-2007 4:36 PM