07-19-2005 10:48 PM
hi,
I have a select-options field say,
data: ABC for f.
where ABC is an internal table.
let us say i have entered some set of 10 numbers and i want to move all these 10 numbers into another internal table. How can i move them into anther internal table.
If i enter some range of numbers like 1 to 50 then how should i retrieve all those numbers from 1 to 50 into another internal table.
Thanks in advance.
07-20-2005 4:17 AM
Hi,
You have not mentioned why you want to do that. It is helpful to know the reason becuase to meet your requirement we may not have to do this.
As far as I know, there's no function module which does this directly. You will have to write the logic for this yourself. For example, let us say that you have the select-options for <b>kunnr</b>.
You can code something like this -
select-options s_kunnr for kna1-kunnr.
data it_kunnr type kunnr occurs 0 with header line.
do 10000 times.
add 1 to it_kunnr.
check it_kunnr in s_kunnr.
append it_kunnr.
enddo.
The above method has certain limitations -
1. It works only when the field is to contain only the numeric values. Since kunnr is a character field, in some cases it can also contain character values.
2. There's an upper limit that has been placed for the loop termination. for example, here it is 10000. Otherwise the program will run for ever.
The best approach is to do a select from the database table directly -
SELECT KUNNR
FROM KNA1
INTO TABLE IT_KUNNR
WHERE KUNNR IN S_KUNNR.
Regards,
Anand Mandalika.
07-19-2005 10:59 PM
07-20-2005 4:17 AM
Hi,
You have not mentioned why you want to do that. It is helpful to know the reason becuase to meet your requirement we may not have to do this.
As far as I know, there's no function module which does this directly. You will have to write the logic for this yourself. For example, let us say that you have the select-options for <b>kunnr</b>.
You can code something like this -
select-options s_kunnr for kna1-kunnr.
data it_kunnr type kunnr occurs 0 with header line.
do 10000 times.
add 1 to it_kunnr.
check it_kunnr in s_kunnr.
append it_kunnr.
enddo.
The above method has certain limitations -
1. It works only when the field is to contain only the numeric values. Since kunnr is a character field, in some cases it can also contain character values.
2. There's an upper limit that has been placed for the loop termination. for example, here it is 10000. Otherwise the program will run for ever.
The best approach is to do a select from the database table directly -
SELECT KUNNR
FROM KNA1
INTO TABLE IT_KUNNR
WHERE KUNNR IN S_KUNNR.
Regards,
Anand Mandalika.