Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select option

Former Member
0 Likes
810

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
793

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.

8 REPLIES 8
Read only

Former Member
0 Likes
794

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.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
793

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

Read only

Former Member
0 Likes
793

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

Read only

Former Member
0 Likes
793

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

Read only

Former Member
0 Likes
793

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

Read only

Former Member
0 Likes
793

Hi ,

Try This

itab-kunnr = zkunnr-low.

APPEND itab.

itab-kunnr = zkunnr-high.

APPEND itab

Read only

Former Member
0 Likes
793

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

Read only

Former Member
0 Likes
793

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