‎2007 Aug 07 12:22 PM
i made this
SELECT-OPTIONS : zkunnr for vbak-kunnr.
and i want to append to itab
this is write?????
it always take the low,what about the high??
LOOP AT zkunnr.
itab-kunnr = <b>zkunnr-low</b>.
APPEND itab.
ENDLOOP.
‎2007 Aug 07 12:25 PM
If the user enters a range of customers you cannot take the low and high values. You should do the following
select kunnr
into table itab
from kna1
where kunnr in zkunnr.
‎2007 Aug 07 12:25 PM
If the user enters a range of customers you cannot take the low and high values. You should do the following
select kunnr
into table itab
from kna1
where kunnr in zkunnr.
‎2007 Aug 07 12:26 PM
Hi,
What you can do if you want to concider HIGH also is
LOOP AT zkunnr.
itab-kunnr = zkunnr-low.
APPEND itab.
if zkunnr-high is not initial.
itab-kunnr = zkunnr-high.
APPEND itab.
endif.
ENDLOOP.
SORT ITAB.
DELETE ADJACENT DUPLICATES FROM itab.
BUT you cannot use itab in SELECT ...WHERE... kunnar IN .
Regards,
Sesh
‎2007 Aug 07 12:26 PM
Richi,
If you need to use the select options values in an sql query the u dont need to copy it into an ITAB .
Just use it like this select... where xyz IN 'select option var name'
The use of a select option will be lost if u put it in an itab. ranges will not work
‎2007 Aug 07 12:27 PM
Hi,
try this
LOOP AT zkunnr.
itab-kunnr = zkunnr-low.
APPEND itab.
if zkunnr-high is not initial.
itab-kunnr = zkunnr-high.
append itab.
endif.
ENDLOOP.
but this will be appending only the high and low values
or else some ranges only
better if you select the records from dbtable and store it in
an internal table
eg
select kunnr from kna1 into table zkna1 where kunnr in zkunnr.
now loop at zkunnr.
itab-kunnr = zkunnr-kunnr.
append itab.
endloop.
this will give the entire range.
reward points if helpful
thanks & regards,
venkatesh
‎2007 Aug 07 12:27 PM
HI,
Yes, this is correct but this will work if the user enter only the LOW value, if the user enters the Range then you need to write the select and get the values into internal table
Regards
Sudheer
‎2007 Aug 07 12:28 PM
Hi ,
Try This
itab-kunnr = zkunnr-low.
APPEND itab.
itab-kunnr = zkunnr-high.
APPEND itab
‎2007 Aug 07 12:30 PM
HI
WHEN EVER YOUR USEING
SELECT-OPTIONS
JUST DIFFERNTIAT B/W LOW AND HIGH LIK E
ZKUNNR-LOW
ZKUNNR-HIGH
IN YOUR CASE
LOOP AT zkunnr.
itab-kunnr = zkunnr-low.
ITAB-KUNNR = ZKUNNR-HIGH
APPEND itab.
ENDLOOP.
REWARD IF USEFULL
‎2007 Aug 07 12:32 PM
see even the select option is an interna table
so u can directly move the values from one internal table to another using work areas........so in this ur high low issue wod be definetly solved. ...
u wod be able to move whole range of values here in