‎2007 Oct 04 2:05 PM
Hi,
I want to move values from select option to an internal table.
eg. select-option : mat for mara-matnr.
if user gives value for matnr as 50000 to 50003.
now the value 50001, 50002, 50003 should be moved to an internal table which has the above values as individual record.
Regards,
Phyrose.
‎2007 Oct 04 2:07 PM
Hi
select-options: s_matnr for mara-matnr.
loop at s_matnr.
itab-matnr = s_matnr-low.
append itab.
clear itab.
endloop.
or try as
ITAB[] = s_matnr[].
regards
Anji
‎2007 Oct 04 2:09 PM
hi Camila,
you have to do:
SELECT matnr
INTO TABLE gt_mara
FROM mara
WHERE matnr IN s_matnr.
gt_mara is internal table with one field (matnr). Of course you have to modify, if you want to put into table which has more fields.
hope this helps
ec
‎2007 Oct 04 2:10 PM
Hi,
May be this way.
start-of-selection.
select matnr from mara into table itab where matnr in s_matnr.
after this itab contains the values of 50000, 50001 50002 50003.
a®
‎2007 Oct 04 2:10 PM
hI..
tables MARA.
select-option : mat for mara-matnr.
DATA: BEGIN OF ITAB OCCURS 0,
MATNR TYPE MARA-MATNR,
END OF ITAB.
START-OF-SELECTION.
LOOP AT MAT.
MOVE MAT-LOW TO ITAB-MANTR.
APPEND ITAB.
ENDLOOP.
<b>reward if Helpful.</b>
‎2007 Oct 04 2:12 PM
Hi
Try this
l_var = mat-low.
do
if l_var lt mat-high.
itab-matnr = l_var.
l_var = l_var + 1.
else.
exit.
endif.
‎2007 Oct 04 2:15 PM
Hi,
You can use the below code :
tables : bsis.
data : count type i.
data : begin of itab occurs 0,
buzei like bsis-buzei,
end of itab.
select-OPTIONS : num for bsis-buzei.
start-of-SELECTION.
count = 1.
do num-high times.
if count = 1.
count = num-low.
write : / count.
itab-buzei = count.
count = count + 1.
append itab.
clear itab.
else.
write : / count.
itab-buzei = count.
count = count + 1.
append itab.
clear itab.
endif.
if count GT num-high.
exit.
ENDIF.
enddo.
if num-high is initial.
write : / num-low.
ITAB-BUZEI = NUM-LOW.
APPEND ITAB.
CLEAR ITAB.
endif.
loop at itab.
write : / itab-buzei.
ENDLOOP.
Thanks,
Sriram Ponna.
Message was edited by:
Sriram Ponna
‎2007 Oct 04 2:18 PM
Hi,
The best way is doing with out complex logic.
**
select matnr from mara into table it_mara where matnr in s_matnr.
The internal table it_mara now filled with required materials.
regards,
Kishore