Application Development 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: 

select statment not working with variables

Former Member
0 Kudos

Hi experts,

Iam trying to select some data using the follwoing code

with radio buttons r6 & r7.

If r6 selected,it takes from parameter and

if r7 selected it takes from select options...

data: l_datbi type a005-datbi,l_datab type a005-datab.

if r6 = 'X'.

l_datbi = pvalid.

l_datab = pvalid.

elseif r7 = 'X'.

l_datab = svalid-low.

l_datbi = svalid-high.

endif.

select vtweg matnr knumh datbi datab into corresponding fields of i_itab

from A004

where kappl eq 'V'

and kschl eq pkschl

and vkorg eq pvkorg

and vtweg in svtweg

and matnr in smatnr

and datab le l_datab #######

and datbi ge l_databi. #######

This select statement is not working.

It is taking only one value at a time.(r6 value or r7value)

What might be the reason...?

reward gurarenteed

maggy

5 REPLIES 5

Former Member
0 Kudos

Hi Maggy,

You should use "INTO CORRESPONDING FIELDS OF TABLE I_ITAB".

Regards,

John.

0 Kudos

Hi John,

I have used "into corresponding"

maggy

0 Kudos

Hi Maggy,

Yes you did use INTO CORRESPONDING but it should be INTO CORRESPONDING FIELDS <b>OF TABLE</b>.

Regards,

John.

andreas_mann3
Active Contributor
0 Kudos

Hi,

-> here's the same problem:

Andreas

Former Member
0 Kudos

Hi,

You are trying to equate your low value with end date and high value with start date..

The correct logic will be,

data: l_datbi type a005-datbi,l_datab type a005-datab.

if r6 = 'X'.

l_datbi = pvalid. "Start Date

l_datab = pvalid. "End Date

elseif r7 = 'X'.

<b>*l_datab = svalid-low. "Wrong</b>

<b>l_datab = svalid-high. "Right</b>

<b>*l_datbi = svalid-high. "Wrong</b>

<b>l_datbi = svalid-low. "Right</b>

endif.

select vtweg matnr knumh datbi datab into corresponding fields of i_itab

from A004

where kappl eq 'V'

and kschl eq pkschl

and vkorg eq pvkorg

and vtweg in svtweg

and matnr in smatnr

and datab le l_datab ####### "This also doesnt look

and datbi ge l_databi. ####### "right to me, please check

Hope this helps..

Sri